xinhe commited on
Commit
135e39c
·
verified ·
1 Parent(s): ca146b5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -215
README.md CHANGED
@@ -1,237 +1,53 @@
1
  ---
2
- license: apache-2.0
3
- library_name: transformers
4
- pipeline_tag: text-generation
5
  tags:
6
- - hunyuan
7
- - hy3
8
- - moe
9
- - text-generation
10
- ---
11
- <p align="left">
12
- <a href="https://huggingface.co/tencent/Hy3/blob/main/README_CN.md">中文</a>&nbsp;|&nbsp;English
13
- </p>
14
- <br>
15
-
16
- <p align="center">
17
- <img src="assets/logo-en.png" width="400"/> <br>
18
- </p>
19
-
20
- <div align="center" style="line-height: 1;">
21
-
22
-
23
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue)](#license)
24
- &nbsp;&nbsp;
25
- [![HuggingFace](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Tencent%20Hy-ffc107?color=ffc107&logoColor=white)](https://huggingface.co/tencent/Hy3)
26
- &nbsp;&nbsp;
27
- [![ModelScope](https://img.shields.io/badge/ModelScope-Tencent%20Hy-624aff)](https://modelscope.cn/models/Tencent-Hunyuan/Hy3)
28
- &nbsp;&nbsp;
29
- [![cnb.cool](https://img.shields.io/badge/cnb.cool-Tencent%20Hy-blue?logoColor=white)](https://cnb.cool/ai-models/tencent/Hy3)
30
- &nbsp;&nbsp;
31
- [![GitCode](https://img.shields.io/badge/GitCode-Tencent%20Hy-red?logoColor=white)](https://ai.gitcode.com/tencent_hunyuan/Hy3)
32
-
33
- </div>
34
-
35
- <p align="center">
36
- 🖥️&nbsp;<a href="https://aistudio.tencent.com/"><b>Official Website</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;
37
- 💬&nbsp;<a href="https://github.com/Tencent-Hunyuan/Hy3"><b>GitHub</b></a></p>
38
-
39
- ---
40
-
41
- ## Table of Contents
42
-
43
- - [Model Introduction](#model-introduction)
44
- - [Stronger Agent Capabilities](#stronger-agent-capabilities)
45
- - [More Reliable Product Experiences](#more-reliable-product-experiences)
46
- - [Benchmark Appendix](#benchmark-appendix)
47
- - [News](#news)
48
- - [Model Links](#model-links)
49
- - [Quickstart](#quickstart)
50
- - [Deployment](#deployment)
51
- - [vLLM](#vllm)
52
- - [SGLang](#sglang)
53
- - [Finetuning](#finetuning)
54
- - [Quantization](#quantization)
55
- - [License](#license)
56
- - [Contact Us](#contact-us)
57
-
58
  ---
 
59
 
60
- ## Model Introduction
61
-
62
- **Hy3** is a 295B-parameter Mixture-of-Experts (MoE) model with 21B active parameters and 3.8B MTP layer parameters, developed by the Tencent Hy Team. Following the Hy3 Preview launch in late April, we gathered feedback from 50+ products and scaled up post-training with higher quality data. Today, we introduce Hy3, which outperforms similar-size models and rivals flagship open-source models with 2-5x parameters. It also shows significant gains in utility across various products and productivity tasks.
63
-
64
-
65
- | Property | Value |
66
- |:---|:---|
67
- | Architecture | Mixture-of-Experts (MoE) |
68
- | Total Parameters | 295B |
69
- | Activated Parameters | 21B |
70
- | MTP Layer Parameters | 3.8B |
71
- | Number of Layers (excluding MTP layer) | 80 |
72
- | Number of MTP Layers | 1 |
73
- | Attention Heads | 64 (GQA, 8 KV heads, head dim 128) |
74
- | Hidden Size | 4096 |
75
- | Intermediate Size | 13312 |
76
- | Context Length | 256K |
77
- | Vocabulary Size | 120832 |
78
- | Number of Experts | 192 experts, top-8 activated |
79
- | Supported Precisions | BF16 |
80
-
81
- ## Stronger Agent Capabilities
82
-
83
- Building on Hy3 Preview, we further improved the quality and diversity of post-training data while scaling up RL training. Hy3 shows solid gains across reasoning, agentic, and long-context tasks, competitive with much larger flagship models.
84
-
85
- <p align="center">
86
- <img src="assets/benchmark.png" width="100%"/>
87
- </p>
88
-
89
- In productivity scenarios such as coding, office work, financial modeling, frontend design, and game development, Hy3 has made remarkable progress and can now serve as a reliable, cost-effective model option.
90
-
91
- We don't think public benchmark scores tell the full story. So we ran a blind evaluation with 270 experts using tasks from their work, and Hy3 scored 2.67/4, outperforming GLM-5.1 at 2.51/4. The advantage was most substantial in frontend development, data & storage, and CI/CD tasks.
92
-
93
- ## More Reliable Product Experiences
94
-
95
- Model usefulness is not fully captured by benchmarks. Based on extensive product feedback, we identified and fixed the following issues, receiving consistently positive feedback from product teams.
96
-
97
- **Stability of tool calls and output formats**: We fixed multiple baseline reliability issues, bringing the model to production-grade standards across tool configurations and output constraints. Tool-call error recovery and overall efficiency improved. Hy3 also generalizes across different agent scaffoldings. On SWE-Bench Verified, accuracy variance across scaffoldings like CodeBuddy, Cline, and KiloCode remains within 4%.
98
-
99
- **Knowledge and anti-hallucination**: Guided by the ideal of "answer when grounded, state when evidence is missing, do not conflate sources or fabricate data," we implemented fine-grained data cleaning and training constraints. In internal evaluations based on real-world scenarios, Hy3's hallucination rate dropped from 12.5% to 5.4%, and commonsense error rates fell from 25.4% to 12.7%. These improvements materially reduce fact conflation, fabrication, and logical contradiction.
100
 
101
- **Complex context retention and multi-turn intent tracking**: Through joint optimization of SFT and RL, Hy3 improved on operational pain points like coreference resolution, ellipsis recovery, and multi-turn constraint inheritance. On internal comprehensive multi-turn tests, the issue rate dropped from 17.4% to 7.9%. Hy3 also improved markedly on long-dialogue evals like MRCR. Its outputs are more concise while ensuring complex intents do not decay or drift over long-horizon interactions.
 
 
 
 
 
102
 
103
- ## Benchmark Appendix
104
 
105
- <p align="center">
106
- <img src="assets/benchmark-appendix.png" width="100%"/>
107
- </p>
108
 
109
- ## News
110
 
 
 
 
111
 
112
- * 🔥 We open-source **Hy3** and **Hy3-FP8** model weights on [Hugging Face](https://huggingface.co/tencent/Hy3), [ModelScope](https://modelscope.cn/models/Tencent-Hunyuan/Hy3), [GitCode](https://ai.gitcode.com/tencent_hunyuan/Hy3), and [CNB](https://cnb.cool/ai-models/tencent/Hy3).
113
 
114
- ## Model Links
115
 
 
116
 
117
- | Model Name | Description | Hugging Face | ModelScope | GitCode | CNB |
118
- |:---|:---|:---:|:---:|:---:|:---:|
119
- | Hy3 | Instruct model | 🤗 [Model](https://huggingface.co/tencent/Hy3) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3) | [Model](https://cnb.cool/ai-models/tencent/Hy3) |
120
- | Hy3-FP8 | FP8 quantized instruct model | 🤗 [Model](https://huggingface.co/tencent/Hy3-FP8) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3-FP8) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3-FP8) | [Model](https://cnb.cool/ai-models/tencent/Hy3-FP8) |
121
 
122
- ## Quickstart
123
 
124
- Deploy Hy3 with [vLLM](#vllm) or [SGLang](#sglang) first, then call the OpenAI-compatible API:
125
 
126
- ```python
127
- from openai import OpenAI
128
 
129
- client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
130
 
131
- response = client.chat.completions.create(
132
- model="hy3",
133
- messages=[
134
- {"role": "user", "content": "Hello! Can you briefly introduce yourself?"},
135
- ],
136
- temperature=0.9,
137
- top_p=1.0,
138
- # reasoning_effort: "no_think" (default, direct response), "low", "high" (deep chain-of-thought)
139
- extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}},
140
- )
141
- print(response.choices[0].message.content)
142
- ```
143
 
144
- > **Recommended parameters**: `temperature=0.9`, `top_p=1.0`.
145
- >
146
- > **Reasoning mode**: Set `reasoning_effort` to `"high"` for complex tasks (math, coding, reasoning) or `"no_think"` for direct responses.
147
 
148
- See the [Deployment](#deployment) section below for how to start the API server.
149
 
150
- ## Deployment
151
-
152
- Hy3 has 295B parameters in total. To serve it on 8 GPUs, we recommend using H20-3e or other GPUs with larger memory capacity.
153
-
154
- For production serving, we recommend using vLLM or SGLang, both of which provide dedicated recipes for Hy3:
155
-
156
- - [vLLM](https://github.com/vllm-project/vllm) - see [vLLM recipes](https://recipes.vllm.ai/tencent/Hy3)
157
-
158
- - [SGLang](https://docs.sglang.io/) - see [SGLang cookbook](https://lmsysorg.mintlify.app/cookbook/autoregressive/Tencent/Hy3)
159
-
160
- ### vLLM
161
-
162
- Build vLLM from source:
163
- ```bash
164
- uv venv --python 3.12 --seed --managed-python
165
- source .venv/bin/activate
166
- git clone https://github.com/vllm-project/vllm.git
167
- cd vllm
168
- uv pip install --editable . --torch-backend=auto
169
- ```
170
-
171
- Start the vLLM server with MTP enabled:
172
-
173
- ```bash
174
- # Switch to trtllm backend to work-around mnnvl workspace size issue.
175
- export VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
176
- vllm serve tencent/Hy3 \
177
- --tensor-parallel-size 8 \
178
- --speculative-config.method mtp \
179
- --speculative-config.num_speculative_tokens 2 \
180
- --tool-call-parser hy_v3 \
181
- --reasoning-parser hy_v3 \
182
- --enable-auto-tool-choice \
183
- --port 8000 \
184
- --served-model-name hy3
185
- ```
186
-
187
- ### SGLang
188
-
189
- Build SGLang from source:
190
- ```bash
191
- git clone https://github.com/sgl-project/sglang
192
- cd sglang
193
- pip3 install pip --upgrade
194
- pip3 install "transformers>=5.6.0"
195
- pip3 install -e "python"
196
- ```
197
-
198
- Launch SGLang server with MTP enabled:
199
-
200
- ```bash
201
- python3 -m sglang.launch_server \
202
- --model tencent/Hy3 \
203
- --tp-size 8 \
204
- --tool-call-parser hunyuan \
205
- --reasoning-parser hunyuan \
206
- --speculative-num-steps 2 \
207
- --speculative-eagle-topk 1 \
208
- --speculative-num-draft-tokens 3 \
209
- --speculative-algorithm EAGLE \
210
- --port 8000 \
211
- --served-model-name hy3
212
- ```
213
-
214
- ## Finetuning
215
-
216
- Hy3 provides a complete model finetuning pipeline. For detailed documentation, please refer to: [Finetuning Guide](https://huggingface.co/tencent/Hy3/blob/main/finetune/README.md)
217
-
218
- ## Quantization
219
-
220
- We provide [AngelSlim](https://github.com/tencent/AngelSlim), a more accessible, comprehensive, and efficient toolkit for large model compression. AngelSlim supports a comprehensive suite of compression tools for large-scale multimodal models, including common quantization algorithms, low-bit quantization, and speculative sampling.
221
-
222
- ## License
223
-
224
-
225
- Hy3 is released under the **Apache License 2.0**. See [LICENSE](https://huggingface.co/tencent/Hy3/blob/main/LICENSE) for details.
226
-
227
- ## Contact Us
228
-
229
- If you would like to leave a message for our R&D and product teams, welcome to contact us. You can also reach us via email:
230
-
231
- 📧 **hunyuan_opensource@tencent.com**
232
-
233
- ---
234
 
235
- <p align="center">
236
- <i>Hy3 is developed by the Tencent Hy Team.</i>
237
- </p>
 
1
  ---
 
 
 
2
  tags:
3
+ - auto-round
4
+ license: other
5
+ license_name: apache-2.0
6
+ library_name: transformers
7
+ base_model:
8
+ - tencent/Hy3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  ---
10
+ ## Model Details
11
 
12
+ This model is a MXFP4 and MXFP8 mixed model of [tencent/Hy3](https://huggingface.co/tencent/Hy3) generated by [intel/auto-round](https://github.com/intel/auto-round) with RTN mode. The model format is Compressed Tensor (CT), fully compatible with vLLM.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ <!-- Not real data
15
+ | GLM-5.2 | gsm8k | mmlu | piqa | hellaswag | avg | ratio |
16
+ |-------------------|---------|---------|---------|------------|--------|--------|
17
+ | Raw | 0.9386 | 0.8898 | 0.8471 | 0.7747 | 0.863 | |
18
+ | **INCModel2/GLM-5.2-MXFP4-Mixed-LLMC** | 0.9439 | 0.8847 | 0.8411 | 0.7646 | 0.859 | 99.54% |
19
+ -->
20
 
 
21
 
22
+ ## Generate the Model
 
 
23
 
24
+ RTN version
25
 
26
+ ~~~bash
27
+ auto-round tencent/Hy3 --model_free --scheme MXFP8 --format llm_compressor --layer_config "{mlp.experts:{scheme:MXFP4}}" --output_dir /workspace/models/tencent/Hy3-MXFP4-Mixed-CT-AutoRound
28
+ ~~~
29
 
 
30
 
31
+ ## Ethical Considerations and Limitations
32
 
33
+ The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
34
 
35
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
 
 
 
36
 
37
+ ## Caveats and Recommendations
38
 
39
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
40
 
41
+ Here are a couple of useful links to learn more about Intel's AI software:
 
42
 
43
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
44
 
45
+ ## Disclaimer
 
 
 
 
 
 
 
 
 
 
 
46
 
47
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
 
 
48
 
49
+ ## Cite
50
 
51
+ @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)