Add library name and pipeline tag
#66
by
nielsr
HF staff
- opened
README.md
CHANGED
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<!-- markdownlint-disable first-line-h1 -->
|
2 |
<!-- markdownlint-disable html -->
|
3 |
<!-- markdownlint-disable no-duplicate-header -->
|
@@ -98,7 +105,8 @@ Throughout the entire training process, we did not experience any irrecoverable
|
|
98 |
|
99 |
</div>
|
100 |
|
101 |
-
|
|
|
102 |
|
103 |
To ensure optimal performance and flexibility, we have partnered with open-source communities and hardware vendors to provide multiple ways to run the model locally. For step-by-step guidance, check out Section 6: [How_to Run_Locally](#6-how-to-run-locally).
|
104 |
|
@@ -151,8 +159,9 @@ For developers looking to dive deeper, we recommend exploring [README_WEIGHTS.md
|
|
151 |
|
152 |
</div>
|
153 |
|
154 |
-
|
155 |
-
|
|
|
156 |
|
157 |
#### Context Window
|
158 |
<p align="center">
|
@@ -193,17 +202,16 @@ Evaluation results on the ``Needle In A Haystack`` (NIAH) tests. DeepSeek-V3 pe
|
|
193 |
| | C-Eval (EM) | 78.6 | 79.5 | 86.1 | 61.5 | 76.7 | 76.0 | **86.5** |
|
194 |
| | C-SimpleQA (Correct) | 48.5 | 54.1 | 48.4 | 50.4 | 51.3 | 59.3 | **64.8** |
|
195 |
|
196 |
-
Note: All models are evaluated in a configuration that limits the output length to 8K. Benchmarks containing fewer than 1000 samples are tested multiple times using varying temperature settings to derive robust final results. DeepSeek-V3 stands as the best-performing open-source model, and also exhibits competitive performance against frontier closed-source models.
|
197 |
-
|
198 |
</div>
|
199 |
|
|
|
|
|
|
|
200 |
|
201 |
#### Open Ended Generation Evaluation
|
202 |
|
203 |
<div align="center">
|
204 |
|
205 |
-
|
206 |
-
|
207 |
| Model | Arena-Hard | AlpacaEval 2.0 |
|
208 |
|-------|------------|----------------|
|
209 |
| DeepSeek-V2.5-0905 | 76.2 | 50.5 |
|
@@ -213,9 +221,11 @@ Note: All models are evaluated in a configuration that limits the output length
|
|
213 |
| Claude-Sonnet-3.5-1022 | 85.2 | 52.0 |
|
214 |
| DeepSeek-V3 | **85.5** | **70.0** |
|
215 |
|
216 |
-
Note: English open-ended conversation evaluations. For AlpacaEval 2.0, we use the length-controlled win rate as the metric.
|
217 |
</div>
|
218 |
|
|
|
|
|
|
|
219 |
|
220 |
## 5. Chat Website & API Platform
|
221 |
You can chat with DeepSeek-V3 on DeepSeek's official website: [chat.deepseek.com](https://chat.deepseek.com/sign_in)
|
@@ -227,10 +237,10 @@ We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.c
|
|
227 |
DeepSeek-V3 can be deployed locally using the following hardware and open-source community software:
|
228 |
|
229 |
1. **DeepSeek-Infer Demo**: We provide a simple and lightweight demo for FP8 and BF16 inference.
|
230 |
-
2. **SGLang**: Fully support the DeepSeek-V3 model in both BF16 and FP8 inference modes.
|
231 |
3. **LMDeploy**: Enables efficient FP8 and BF16 inference for local and cloud deployment.
|
232 |
-
4. **TensorRT-LLM**: Currently supports BF16 inference and INT4/
|
233 |
-
5. **vLLM**: Support
|
234 |
6. **AMD GPU**: Enables running the DeepSeek-V3 model on AMD GPUs via SGLang in both BF16 and FP8 modes.
|
235 |
7. **Huawei Ascend NPU**: Supports running DeepSeek-V3 on Huawei Ascend devices.
|
236 |
|
@@ -243,10 +253,23 @@ cd inference
|
|
243 |
python fp8_cast_bf16.py --input-fp8-hf-path /path/to/fp8_weights --output-bf16-hf-path /path/to/bf16_weights
|
244 |
```
|
245 |
|
246 |
-
|
|
|
247 |
|
248 |
### 6.1 Inference with DeepSeek-Infer Demo (example only)
|
249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
#### Model Weights & Demo Code Preparation
|
251 |
|
252 |
First, clone our DeepSeek-V3 GitHub repository:
|
@@ -255,18 +278,18 @@ First, clone our DeepSeek-V3 GitHub repository:
|
|
255 |
git clone https://github.com/deepseek-ai/DeepSeek-V3.git
|
256 |
```
|
257 |
|
258 |
-
Navigate to the `inference` folder and install dependencies listed in `requirements.txt`.
|
259 |
|
260 |
```shell
|
261 |
cd DeepSeek-V3/inference
|
262 |
pip install -r requirements.txt
|
263 |
```
|
264 |
|
265 |
-
Download the model weights from
|
266 |
|
267 |
#### Model Weights Conversion
|
268 |
|
269 |
-
Convert
|
270 |
|
271 |
```shell
|
272 |
python convert.py --hf-ckpt-path /path/to/DeepSeek-V3 --save-path /path/to/DeepSeek-V3-Demo --n-experts 256 --model-parallel 16
|
@@ -277,21 +300,25 @@ python convert.py --hf-ckpt-path /path/to/DeepSeek-V3 --save-path /path/to/DeepS
|
|
277 |
Then you can chat with DeepSeek-V3:
|
278 |
|
279 |
```shell
|
280 |
-
torchrun --nnodes 2 --nproc-per-node 8
|
281 |
```
|
282 |
|
283 |
Or batch inference on a given file:
|
284 |
|
285 |
```shell
|
286 |
-
torchrun --nnodes 2 --nproc-per-node 8
|
287 |
```
|
288 |
|
289 |
### 6.2 Inference with SGLang (recommended)
|
290 |
|
291 |
-
[SGLang](https://github.com/sgl-project/sglang) currently supports MLA optimizations, FP8 (W8A8), FP8 KV Cache, and Torch Compile, delivering state-of-the-art latency and throughput performance among open-source frameworks.
|
292 |
|
293 |
Notably, [SGLang v0.4.1](https://github.com/sgl-project/sglang/releases/tag/v0.4.1) fully supports running DeepSeek-V3 on both **NVIDIA and AMD GPUs**, making it a highly versatile and robust solution.
|
294 |
|
|
|
|
|
|
|
|
|
295 |
Here are the launch instructions from the SGLang team: https://github.com/sgl-project/sglang/tree/main/benchmark/deepseek_v3
|
296 |
|
297 |
### 6.3 Inference with LMDeploy (recommended)
|
@@ -304,6 +331,7 @@ For comprehensive step-by-step instructions on running DeepSeek-V3 with LMDeploy
|
|
304 |
|
305 |
[TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) now supports the DeepSeek-V3 model, offering precision options such as BF16 and INT4/INT8 weight-only. Support for FP8 is currently in progress and will be released soon. You can access the custom branch of TRTLLM specifically for DeepSeek-V3 support through the following link to experience the new features directly: https://github.com/NVIDIA/TensorRT-LLM/tree/deepseek/examples/deepseek_v3.
|
306 |
|
|
|
307 |
### 6.5 Inference with vLLM (recommended)
|
308 |
|
309 |
[vLLM](https://github.com/vllm-project/vllm) v0.6.6 supports DeepSeek-V3 inference for FP8 and BF16 modes on both NVIDIA and AMD GPUs. Aside from standard techniques, vLLM offers _pipeline parallelism_ allowing you to run this model on multiple machines connected by networks. For detailed guidance, please refer to the [vLLM instructions](https://docs.vllm.ai/en/latest/serving/distributed_serving.html). Please feel free to follow [the enhancement plan](https://github.com/vllm-project/vllm/issues/11539) as well.
|
@@ -323,14 +351,5 @@ This code repository is licensed under [the MIT License](LICENSE-CODE). The use
|
|
323 |
```
|
324 |
@misc{deepseekai2024deepseekv3technicalreport,
|
325 |
title={DeepSeek-V3 Technical Report},
|
326 |
-
author={DeepSeek-AI and Aixin Liu and Bei Feng and Bing Xue and Bingxuan Wang and Bochao Wu and Chengda Lu and Chenggang Zhao and Chengqi Deng and Chenyu Zhang and Chong Ruan and Damai Dai and Daya Guo and Dejian Yang and Deli Chen and Dongjie Ji and Erhang Li and Fangyun Lin and Fucong Dai and Fuli Luo and Guangbo Hao and Guanting Chen and Guowei Li and H. Zhang and Han Bao and Hanwei Xu and Haocheng Wang and Haowei Zhang and Honghui Ding and Huajian Xin and Huazuo Gao and Hui Li and Hui Qu and J. L. Cai and Jian Liang and Jianzhong Guo and Jiaqi Ni and Jiashi Li and Jiawei Wang and Jin Chen and Jingchang Chen and Jingyang Yuan and Junjie Qiu and Junlong Li and Junxiao Song and Kai Dong and Kai Hu and Kaige Gao and Kang Guan and Kexin Huang and Kuai Yu and Lean Wang and Lecong Zhang and Lei Xu and Leyi Xia and Liang Zhao and Litong Wang and Liyue Zhang and Meng Li and Miaojun Wang and Mingchuan Zhang and Minghua Zhang and Minghui Tang and Mingming Li and Ning Tian and Panpan Huang and Peiyi Wang and Peng Zhang and Qiancheng Wang and Qihao Zhu and Qinyu Chen and Qiushi Du and R. J. Chen and R. L. Jin and Ruiqi Ge and Ruisong Zhang and Ruizhe Pan and Runji Wang and Runxin Xu and Ruoyu Zhang and Ruyi Chen and S. S. Li and Shanghao Lu and Shangyan Zhou and Shanhuang Chen and Shaoqing Wu and Shengfeng Ye and Shengfeng Ye and Shirong Ma and Shiyu Wang and Shuang Zhou and Shuiping Yu and Shunfeng Zhou and Shuting Pan and T. Wang and Tao Yun and Tian Pei and Tianyu Sun and W. L. Xiao and Wangding Zeng and Wanjia Zhao and Wei An and Wen Liu and Wenfeng Liang and Wenjun Gao and Wenqin Yu and Wentao Zhang and X. Q. Li and Xiangyue Jin and Xianzu Wang and Xiao Bi and Xiaodong Liu and Xiaohan Wang and Xiaojin Shen and Xiaokang Chen and Xiaokang Zhang and Xiaosha Chen and Xiaotao Nie and Xiaowen Sun and Xiaoxiang Wang and Xin Cheng and Xin Liu and Xin Xie and Xingchao Liu and Xingkai Yu and Xinnan Song and Xinxia Shan and Xinyi Zhou and
|
327 |
-
|
328 |
-
eprint={2412.19437},
|
329 |
-
archivePrefix={arXiv},
|
330 |
-
primaryClass={cs.CL},
|
331 |
-
url={https://arxiv.org/abs/2412.19437},
|
332 |
-
}
|
333 |
-
```
|
334 |
-
|
335 |
-
## 9. Contact
|
336 |
-
If you have any questions, please raise an issue or contact us at [service@deepseek.com](service@deepseek.com).
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
library_name: transformers
|
4 |
+
pipeline_tag: text-generation
|
5 |
+
---
|
6 |
+
|
7 |
+
```markdown
|
8 |
<!-- markdownlint-disable first-line-h1 -->
|
9 |
<!-- markdownlint-disable html -->
|
10 |
<!-- markdownlint-disable no-duplicate-header -->
|
|
|
105 |
|
106 |
</div>
|
107 |
|
108 |
+
> [!NOTE]
|
109 |
+
> The total size of DeepSeek-V3 models on HuggingFace is 685B, which includes 671B of the Main Model weights and 14B of the Multi-Token Prediction (MTP) Module weights.
|
110 |
|
111 |
To ensure optimal performance and flexibility, we have partnered with open-source communities and hardware vendors to provide multiple ways to run the model locally. For step-by-step guidance, check out Section 6: [How_to Run_Locally](#6-how-to-run-locally).
|
112 |
|
|
|
159 |
|
160 |
</div>
|
161 |
|
162 |
+
> [!NOTE]
|
163 |
+
> Best results are shown in bold. Scores with a gap not exceeding 0.3 are considered to be at the same level. DeepSeek-V3 achieves the best performance on most benchmarks, especially on math and code tasks.
|
164 |
+
> For more evaluation details, please check our paper.
|
165 |
|
166 |
#### Context Window
|
167 |
<p align="center">
|
|
|
202 |
| | C-Eval (EM) | 78.6 | 79.5 | 86.1 | 61.5 | 76.7 | 76.0 | **86.5** |
|
203 |
| | C-SimpleQA (Correct) | 48.5 | 54.1 | 48.4 | 50.4 | 51.3 | 59.3 | **64.8** |
|
204 |
|
|
|
|
|
205 |
</div>
|
206 |
|
207 |
+
> [!NOTE]
|
208 |
+
> All models are evaluated in a configuration that limits the output length to 8K. Benchmarks containing fewer than 1000 samples are tested multiple times using varying temperature settings to derive robust final results. DeepSeek-V3 stands as the best-performing open-source model, and also exhibits competitive performance against frontier closed-source models.
|
209 |
+
|
210 |
|
211 |
#### Open Ended Generation Evaluation
|
212 |
|
213 |
<div align="center">
|
214 |
|
|
|
|
|
215 |
| Model | Arena-Hard | AlpacaEval 2.0 |
|
216 |
|-------|------------|----------------|
|
217 |
| DeepSeek-V2.5-0905 | 76.2 | 50.5 |
|
|
|
221 |
| Claude-Sonnet-3.5-1022 | 85.2 | 52.0 |
|
222 |
| DeepSeek-V3 | **85.5** | **70.0** |
|
223 |
|
|
|
224 |
</div>
|
225 |
|
226 |
+
> [!NOTE]
|
227 |
+
> English open-ended conversation evaluations. For AlpacaEval 2.0, we use the length-controlled win rate as the metric.
|
228 |
+
|
229 |
|
230 |
## 5. Chat Website & API Platform
|
231 |
You can chat with DeepSeek-V3 on DeepSeek's official website: [chat.deepseek.com](https://chat.deepseek.com/sign_in)
|
|
|
237 |
DeepSeek-V3 can be deployed locally using the following hardware and open-source community software:
|
238 |
|
239 |
1. **DeepSeek-Infer Demo**: We provide a simple and lightweight demo for FP8 and BF16 inference.
|
240 |
+
2. **SGLang**: Fully support the DeepSeek-V3 model in both BF16 and FP8 inference modes, with Multi-Token Prediction [coming soon](https://github.com/sgl-project/sglang/issues/2591).
|
241 |
3. **LMDeploy**: Enables efficient FP8 and BF16 inference for local and cloud deployment.
|
242 |
+
4. **TensorRT-LLM**: Currently supports BF16 inference and INT4/INT8 weight-only. Support for FP8 is currently in progress and will be released soon.
|
243 |
+
5. **vLLM**: Support DeepSeek-V3 model with FP8 and BF16 modes for tensor parallelism and pipeline parallelism.
|
244 |
6. **AMD GPU**: Enables running the DeepSeek-V3 model on AMD GPUs via SGLang in both BF16 and FP8 modes.
|
245 |
7. **Huawei Ascend NPU**: Supports running DeepSeek-V3 on Huawei Ascend devices.
|
246 |
|
|
|
253 |
python fp8_cast_bf16.py --input-fp8-hf-path /path/to/fp8_weights --output-bf16-hf-path /path/to/bf16_weights
|
254 |
```
|
255 |
|
256 |
+
> [!NOTE]
|
257 |
+
> Hugging Face's Transformers has not been directly supported yet.
|
258 |
|
259 |
### 6.1 Inference with DeepSeek-Infer Demo (example only)
|
260 |
|
261 |
+
#### System Requirements
|
262 |
+
|
263 |
+
> [!NOTE]
|
264 |
+
> Linux with Python 3.10 only. Mac and Windows are not supported.
|
265 |
+
|
266 |
+
Dependencies:
|
267 |
+
```pip-requirements
|
268 |
+
torch==2.4.1
|
269 |
+
triton==3.0.0
|
270 |
+
transformers==4.46.3
|
271 |
+
safetensors==0.4.5
|
272 |
+
```
|
273 |
#### Model Weights & Demo Code Preparation
|
274 |
|
275 |
First, clone our DeepSeek-V3 GitHub repository:
|
|
|
278 |
git clone https://github.com/deepseek-ai/DeepSeek-V3.git
|
279 |
```
|
280 |
|
281 |
+
Navigate to the `inference` folder and install dependencies listed in `requirements.txt`. Easiest way is to use a package manager like `conda` or `uv` to create a new virtual environment and install the dependencies.
|
282 |
|
283 |
```shell
|
284 |
cd DeepSeek-V3/inference
|
285 |
pip install -r requirements.txt
|
286 |
```
|
287 |
|
288 |
+
Download the model weights from Hugging Face, and put them into `/path/to/DeepSeek-V3` folder.
|
289 |
|
290 |
#### Model Weights Conversion
|
291 |
|
292 |
+
Convert Hugging Face model weights to a specific format:
|
293 |
|
294 |
```shell
|
295 |
python convert.py --hf-ckpt-path /path/to/DeepSeek-V3 --save-path /path/to/DeepSeek-V3-Demo --n-experts 256 --model-parallel 16
|
|
|
300 |
Then you can chat with DeepSeek-V3:
|
301 |
|
302 |
```shell
|
303 |
+
torchrun --nnodes 2 --nproc-per-node 8 --node-rank $RANK --master-addr $ADDR generate.py --ckpt-path /path/to/DeepSeek-V3-Demo --config configs/config_671B.json --interactive --temperature 0.7 --max-new-tokens 200
|
304 |
```
|
305 |
|
306 |
Or batch inference on a given file:
|
307 |
|
308 |
```shell
|
309 |
+
torchrun --nnodes 2 --nproc-per-node 8 --node-rank $RANK --master-addr $ADDR generate.py --ckpt-path /path/to/DeepSeek-V3-Demo --config configs/config_671B.json --input-file $FILE
|
310 |
```
|
311 |
|
312 |
### 6.2 Inference with SGLang (recommended)
|
313 |
|
314 |
+
[SGLang](https://github.com/sgl-project/sglang) currently supports [MLA optimizations](https://lmsys.org/blog/2024-09-04-sglang-v0-3/#deepseek-multi-head-latent-attention-mla-throughput-optimizations), [DP Attention](https://lmsys.org/blog/2024-12-04-sglang-v0-4/#data-parallelism-attention-for-deepseek-models), FP8 (W8A8), FP8 KV Cache, and Torch Compile, delivering state-of-the-art latency and throughput performance among open-source frameworks.
|
315 |
|
316 |
Notably, [SGLang v0.4.1](https://github.com/sgl-project/sglang/releases/tag/v0.4.1) fully supports running DeepSeek-V3 on both **NVIDIA and AMD GPUs**, making it a highly versatile and robust solution.
|
317 |
|
318 |
+
SGLang also supports [multi-node tensor parallelism](https://github.com/sgl-project/sglang/tree/main/benchmark/deepseek_v3#example-serving-with-2-h208), enabling you to run this model on multiple network-connected machines.
|
319 |
+
|
320 |
+
Multi-Token Prediction (MTP) is in development, and progress can be tracked in the [optimization plan](https://github.com/sgl-project/sglang/issues/2591).
|
321 |
+
|
322 |
Here are the launch instructions from the SGLang team: https://github.com/sgl-project/sglang/tree/main/benchmark/deepseek_v3
|
323 |
|
324 |
### 6.3 Inference with LMDeploy (recommended)
|
|
|
331 |
|
332 |
[TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) now supports the DeepSeek-V3 model, offering precision options such as BF16 and INT4/INT8 weight-only. Support for FP8 is currently in progress and will be released soon. You can access the custom branch of TRTLLM specifically for DeepSeek-V3 support through the following link to experience the new features directly: https://github.com/NVIDIA/TensorRT-LLM/tree/deepseek/examples/deepseek_v3.
|
333 |
|
334 |
+
|
335 |
### 6.5 Inference with vLLM (recommended)
|
336 |
|
337 |
[vLLM](https://github.com/vllm-project/vllm) v0.6.6 supports DeepSeek-V3 inference for FP8 and BF16 modes on both NVIDIA and AMD GPUs. Aside from standard techniques, vLLM offers _pipeline parallelism_ allowing you to run this model on multiple machines connected by networks. For detailed guidance, please refer to the [vLLM instructions](https://docs.vllm.ai/en/latest/serving/distributed_serving.html). Please feel free to follow [the enhancement plan](https://github.com/vllm-project/vllm/issues/11539) as well.
|
|
|
351 |
```
|
352 |
@misc{deepseekai2024deepseekv3technicalreport,
|
353 |
title={DeepSeek-V3 Technical Report},
|
354 |
+
author={DeepSeek-AI and Aixin Liu and Bei Feng and Bing Xue and Bingxuan Wang and Bochao Wu and Chengda Lu and Chenggang Zhao and Chengqi Deng and Chenyu Zhang and Chong Ruan and Damai Dai and Daya Guo and Dejian Yang and Deli Chen and Dongjie Ji and Erhang Li and Fangyun Lin and Fucong Dai and Fuli Luo and Guangbo Hao and Guanting Chen and Guowei Li and H. Zhang and Han Bao and Hanwei Xu and Haocheng Wang and Haowei Zhang and Honghui Ding and Huajian Xin and Huazuo Gao and Hui Li and Hui Qu and J. L. Cai and Jian Liang and Jianzhong Guo and Jiaqi Ni and Jiashi Li and Jiawei Wang and Jin Chen and Jingchang Chen and Jingyang Yuan and Junjie Qiu and Junlong Li and Junxiao Song and Kai Dong and Kai Hu and Kaige Gao and Kang Guan and Kexin Huang and Kuai Yu and Lean Wang and Lecong Zhang and Lei Xu and Leyi Xia and Liang Zhao and Litong Wang and Liyue Zhang and Meng Li and Miaojun Wang and Mingchuan Zhang and Minghua Zhang and Minghui Tang and Mingming Li and Ning Tian and Panpan Huang and Peiyi Wang and Peng Zhang and Qiancheng Wang and Qihao Zhu and Qinyu Chen and Qiushi Du and R. J. Chen and R. L. Jin and Ruiqi Ge and Ruisong Zhang and Ruizhe Pan and Runji Wang and Runxin Xu and Ruoyu Zhang and Ruyi Chen and S. S. Li and Shanghao Lu and Shangyan Zhou and Shanhuang Chen and Shaoqing Wu and Shengfeng Ye and Shengfeng Ye and Shirong Ma and Shiyu Wang and Shuang Zhou and Shuiping Yu and Shunfeng Zhou and Shuting Pan and T. Wang and Tao Yun and Tian Pei and Tianyu Sun and W. L. Xiao and Wangding Zeng and Wanjia Zhao and Wei An and Wen Liu and Wenfeng Liang and Wenjun Gao and Wenqin Yu and Wentao Zhang and X. Q. Li and Xiangyue Jin and Xianzu Wang and Xiao Bi and Xiaodong Liu and Xiaohan Wang and Xiaojin Shen and Xiaokang Chen and Xiaokang Zhang and Xiaosha Chen and Xiaotao Nie and Xiaowen Sun and Xiaoxiang Wang and Xin Cheng and Xin Liu and Xin Xie and Xingchao Liu and Xingkai Yu and Xinnan Song and Xinxia Shan and Xinyi Zhou and
|
355 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|