mmnga commited on
Commit
4fc7faa
·
verified ·
1 Parent(s): 8dea635

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -318
README.md CHANGED
@@ -1,328 +1,31 @@
1
- <!-- markdownlint-disable first-line-h1 -->
2
- <!-- markdownlint-disable html -->
3
- <!-- markdownlint-disable no-duplicate-header -->
4
-
5
- <div align="center">
6
- <img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/logo.svg?raw=true" width="60%" alt="DeepSeek-V3" />
7
- </div>
8
- <hr>
9
- <div align="center" style="line-height: 1;">
10
- <a href="https://www.deepseek.com/" target="_blank" style="margin: 2px;">
11
- <img alt="Homepage" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/badge.svg?raw=true" style="display: inline-block; vertical-align: middle;"/>
12
- </a>
13
- <a href="https://chat.deepseek.com/" target="_blank" style="margin: 2px;">
14
- <img alt="Chat" src="https://img.shields.io/badge/🤖%20Chat-DeepSeek%20V3-536af5?color=536af5&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
15
- </a>
16
- <a href="https://huggingface.co/deepseek-ai" target="_blank" style="margin: 2px;">
17
- <img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-DeepSeek%20AI-ffc107?color=ffc107&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
18
- </a>
19
- </div>
20
-
21
- <div align="center" style="line-height: 1;">
22
- <a href="https://discord.gg/Tc7c45Zzu5" target="_blank" style="margin: 2px;">
23
- <img alt="Discord" src="https://img.shields.io/badge/Discord-DeepSeek%20AI-7289da?logo=discord&logoColor=white&color=7289da" style="display: inline-block; vertical-align: middle;"/>
24
- </a>
25
- <a href="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/qr.jpeg?raw=true" target="_blank" style="margin: 2px;">
26
- <img alt="Wechat" src="https://img.shields.io/badge/WeChat-DeepSeek%20AI-brightgreen?logo=wechat&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
27
- </a>
28
- <a href="https://twitter.com/deepseek_ai" target="_blank" style="margin: 2px;">
29
- <img alt="Twitter Follow" src="https://img.shields.io/badge/Twitter-deepseek_ai-white?logo=x&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
30
- </a>
31
- </div>
32
-
33
- <div align="center" style="line-height: 1;">
34
- <a href="https://github.com/deepseek-ai/DeepSeek-V3/blob/main/LICENSE-CODE" style="margin: 2px;">
35
- <img alt="Code License" src="https://img.shields.io/badge/Code_License-MIT-f5de53?&color=f5de53" style="display: inline-block; vertical-align: middle;"/>
36
- </a>
37
- <a href="https://github.com/deepseek-ai/DeepSeek-V3/blob/main/LICENSE-MODEL" style="margin: 2px;">
38
- <img alt="Model License" src="https://img.shields.io/badge/Model_License-Model_Agreement-f5de53?&color=f5de53" style="display: inline-block; vertical-align: middle;"/>
39
- </a>
40
- </div>
41
-
42
-
43
- <p align="center">
44
- <a href="https://github.com/deepseek-ai/DeepSeek-V3/blob/main/DeepSeek_V3.pdf"><b>Paper Link</b>👁️</a>
45
- </p>
46
-
47
-
48
- ## 1. Introduction
49
-
50
- We present DeepSeek-V3, a strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token.
51
- To achieve efficient inference and cost-effective training, DeepSeek-V3 adopts Multi-head Latent Attention (MLA) and DeepSeekMoE architectures, which were thoroughly validated in DeepSeek-V2.
52
- Furthermore, DeepSeek-V3 pioneers an auxiliary-loss-free strategy for load balancing and sets a multi-token prediction training objective for stronger performance.
53
- We pre-train DeepSeek-V3 on 14.8 trillion diverse and high-quality tokens, followed by Supervised Fine-Tuning and Reinforcement Learning stages to fully harness its capabilities.
54
- Comprehensive evaluations reveal that DeepSeek-V3 outperforms other open-source models and achieves performance comparable to leading closed-source models.
55
- Despite its excellent performance, DeepSeek-V3 requires only 2.788M H800 GPU hours for its full training.
56
- In addition, its training process is remarkably stable.
57
- Throughout the entire training process, we did not experience any irrecoverable loss spikes or perform any rollbacks.
58
- <p align="center">
59
- <img width="80%" src="figures/benchmark.png">
60
- </p>
61
-
62
- ## 2. Model Summary
63
-
64
  ---
65
-
66
- **Architecture: Innovative Load Balancing Strategy and Training Objective**
67
-
68
- - On top of the efficient architecture of DeepSeek-V2, we pioneer an auxiliary-loss-free strategy for load balancing, which minimizes the performance degradation that arises from encouraging load balancing.
69
- - We investigate a Multi-Token Prediction (MTP) objective and prove it beneficial to model performance.
70
- It can also be used for speculative decoding for inference acceleration.
71
-
72
  ---
 
73
 
74
- **Pre-Training: Towards Ultimate Training Efficiency**
75
-
76
- - We design an FP8 mixed precision training framework and, for the first time, validate the feasibility and effectiveness of FP8 training on an extremely large-scale model.
77
- - Through co-design of algorithms, frameworks, and hardware, we overcome the communication bottleneck in cross-node MoE training, nearly achieving full computation-communication overlap.
78
- This significantly enhances our training efficiency and reduces the training costs, enabling us to further scale up the model size without additional overhead.
79
- - At an economical cost of only 2.664M H800 GPU hours, we complete the pre-training of DeepSeek-V3 on 14.8T tokens, producing the currently strongest open-source base model. The subsequent training stages after pre-training require only 0.1M GPU hours.
80
 
 
 
81
  ---
82
 
83
- **Post-Training: Knowledge Distillation from DeepSeek-R1**
84
 
85
- - We introduce an innovative methodology to distill reasoning capabilities from the long-Chain-of-Thought (CoT) model, specifically from one of the DeepSeek R1 series models, into standard LLMs, particularly DeepSeek-V3. Our pipeline elegantly incorporates the verification and reflection patterns of R1 into DeepSeek-V3 and notably improves its reasoning performance. Meanwhile, we also maintain a control over the output style and length of DeepSeek-V3.
 
 
 
 
 
 
 
86
 
87
  ---
88
 
89
-
90
- ## 3. Model Downloads
91
-
92
- <div align="center">
93
-
94
- | **Model** | **#Total Params** | **#Activated Params** | **Context Length** | **Download** |
95
- | :------------: | :------------: | :------------: | :------------: | :------------: |
96
- | DeepSeek-V3-Base | 671B | 37B | 128K | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V3-Base) |
97
- | DeepSeek-V3 | 671B | 37B | 128K | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V3) |
98
-
99
- </div>
100
-
101
- **NOTE: 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.**
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
-
105
- For developers looking to dive deeper, we recommend exploring [README_WEIGHTS.md](./README_WEIGHTS.md) for details on the Main Model weights and the Multi-Token Prediction (MTP) Modules. Please note that MTP support is currently under active development within the community, and we welcome your contributions and feedback.
106
-
107
- ## 4. Evaluation Results
108
- ### Base Model
109
- #### Standard Benchmarks
110
-
111
- <div align="center">
112
-
113
-
114
- | | Benchmark (Metric) | # Shots | DeepSeek-V2 | Qwen2.5 72B | LLaMA3.1 405B | DeepSeek-V3 |
115
- |---|-------------------|----------|--------|-------------|---------------|---------|
116
- | | Architecture | - | MoE | Dense | Dense | MoE |
117
- | | # Activated Params | - | 21B | 72B | 405B | 37B |
118
- | | # Total Params | - | 236B | 72B | 405B | 671B |
119
- | English | Pile-test (BPB) | - | 0.606 | 0.638 | **0.542** | 0.548 |
120
- | | BBH (EM) | 3-shot | 78.8 | 79.8 | 82.9 | **87.5** |
121
- | | MMLU (Acc.) | 5-shot | 78.4 | 85.0 | 84.4 | **87.1** |
122
- | | MMLU-Redux (Acc.) | 5-shot | 75.6 | 83.2 | 81.3 | **86.2** |
123
- | | MMLU-Pro (Acc.) | 5-shot | 51.4 | 58.3 | 52.8 | **64.4** |
124
- | | DROP (F1) | 3-shot | 80.4 | 80.6 | 86.0 | **89.0** |
125
- | | ARC-Easy (Acc.) | 25-shot | 97.6 | 98.4 | 98.4 | **98.9** |
126
- | | ARC-Challenge (Acc.) | 25-shot | 92.2 | 94.5 | **95.3** | **95.3** |
127
- | | HellaSwag (Acc.) | 10-shot | 87.1 | 84.8 | **89.2** | 88.9 |
128
- | | PIQA (Acc.) | 0-shot | 83.9 | 82.6 | **85.9** | 84.7 |
129
- | | WinoGrande (Acc.) | 5-shot | **86.3** | 82.3 | 85.2 | 84.9 |
130
- | | RACE-Middle (Acc.) | 5-shot | 73.1 | 68.1 | **74.2** | 67.1 |
131
- | | RACE-High (Acc.) | 5-shot | 52.6 | 50.3 | **56.8** | 51.3 |
132
- | | TriviaQA (EM) | 5-shot | 80.0 | 71.9 | **82.7** | **82.9** |
133
- | | NaturalQuestions (EM) | 5-shot | 38.6 | 33.2 | **41.5** | 40.0 |
134
- | | AGIEval (Acc.) | 0-shot | 57.5 | 75.8 | 60.6 | **79.6** |
135
- | Code | HumanEval (Pass@1) | 0-shot | 43.3 | 53.0 | 54.9 | **65.2** |
136
- | | MBPP (Pass@1) | 3-shot | 65.0 | 72.6 | 68.4 | **75.4** |
137
- | | LiveCodeBench-Base (Pass@1) | 3-shot | 11.6 | 12.9 | 15.5 | **19.4** |
138
- | | CRUXEval-I (Acc.) | 2-shot | 52.5 | 59.1 | 58.5 | **67.3** |
139
- | | CRUXEval-O (Acc.) | 2-shot | 49.8 | 59.9 | 59.9 | **69.8** |
140
- | Math | GSM8K (EM) | 8-shot | 81.6 | 88.3 | 83.5 | **89.3** |
141
- | | MATH (EM) | 4-shot | 43.4 | 54.4 | 49.0 | **61.6** |
142
- | | MGSM (EM) | 8-shot | 63.6 | 76.2 | 69.9 | **79.8** |
143
- | | CMath (EM) | 3-shot | 78.7 | 84.5 | 77.3 | **90.7** |
144
- | Chinese | CLUEWSC (EM) | 5-shot | 82.0 | 82.5 | **83.0** | 82.7 |
145
- | | C-Eval (Acc.) | 5-shot | 81.4 | 89.2 | 72.5 | **90.1** |
146
- | | CMMLU (Acc.) | 5-shot | 84.0 | **89.5** | 73.7 | 88.8 |
147
- | | CMRC (EM) | 1-shot | **77.4** | 75.8 | 76.0 | 76.3 |
148
- | | C3 (Acc.) | 0-shot | 77.4 | 76.7 | **79.7** | 78.6 |
149
- | | CCPM (Acc.) | 0-shot | **93.0** | 88.5 | 78.6 | 92.0 |
150
- | Multilingual | MMMLU-non-English (Acc.) | 5-shot | 64.0 | 74.8 | 73.8 | **79.4** |
151
-
152
- </div>
153
-
154
- Note: 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.
155
- For more evaluation details, please check our paper.
156
-
157
- #### Context Window
158
- <p align="center">
159
- <img width="80%" src="figures/niah.png">
160
- </p>
161
-
162
- Evaluation results on the ``Needle In A Haystack`` (NIAH) tests. DeepSeek-V3 performs well across all context window lengths up to **128K**.
163
-
164
- ### Chat Model
165
- #### Standard Benchmarks (Models larger than 67B)
166
- <div align="center">
167
-
168
- | | **Benchmark (Metric)** | **DeepSeek V2-0506** | **DeepSeek V2.5-0905** | **Qwen2.5 72B-Inst.** | **Llama3.1 405B-Inst.** | **Claude-3.5-Sonnet-1022** | **GPT-4o 0513** | **DeepSeek V3** |
169
- |---|---------------------|---------------------|----------------------|---------------------|----------------------|---------------------------|----------------|----------------|
170
- | | Architecture | MoE | MoE | Dense | Dense | - | - | MoE |
171
- | | # Activated Params | 21B | 21B | 72B | 405B | - | - | 37B |
172
- | | # Total Params | 236B | 236B | 72B | 405B | - | - | 671B |
173
- | English | MMLU (EM) | 78.2 | 80.6 | 85.3 | **88.6** | **88.3** | 87.2 | **88.5** |
174
- | | MMLU-Redux (EM) | 77.9 | 80.3 | 85.6 | 86.2 | **88.9** | 88.0 | **89.1** |
175
- | | MMLU-Pro (EM) | 58.5 | 66.2 | 71.6 | 73.3 | **78.0** | 72.6 | 75.9 |
176
- | | DROP (3-shot F1) | 83.0 | 87.8 | 76.7 | 88.7 | 88.3 | 83.7 | **91.6** |
177
- | | IF-Eval (Prompt Strict) | 57.7 | 80.6 | 84.1 | 86.0 | **86.5** | 84.3 | 86.1 |
178
- | | GPQA-Diamond (Pass@1) | 35.3 | 41.3 | 49.0 | 51.1 | **65.0** | 49.9 | 59.1 |
179
- | | SimpleQA (Correct) | 9.0 | 10.2 | 9.1 | 17.1 | 28.4 | **38.2** | 24.9 |
180
- | | FRAMES (Acc.) | 66.9 | 65.4 | 69.8 | 70.0 | 72.5 | **80.5** | 73.3 |
181
- | | LongBench v2 (Acc.) | 31.6 | 35.4 | 39.4 | 36.1 | 41.0 | 48.1 | **48.7** |
182
- | Code | HumanEval-Mul (Pass@1) | 69.3 | 77.4 | 77.3 | 77.2 | 81.7 | 80.5 | **82.6** |
183
- | | LiveCodeBench (Pass@1-COT) | 18.8 | 29.2 | 31.1 | 28.4 | 36.3 | 33.4 | **40.5** |
184
- | | LiveCodeBench (Pass@1) | 20.3 | 28.4 | 28.7 | 30.1 | 32.8 | 34.2 | **37.6** |
185
- | | Codeforces (Percentile) | 17.5 | 35.6 | 24.8 | 25.3 | 20.3 | 23.6 | **51.6** |
186
- | | SWE Verified (Resolved) | - | 22.6 | 23.8 | 24.5 | **50.8** | 38.8 | 42.0 |
187
- | | Aider-Edit (Acc.) | 60.3 | 71.6 | 65.4 | 63.9 | **84.2** | 72.9 | 79.7 |
188
- | | Aider-Polyglot (Acc.) | - | 18.2 | 7.6 | 5.8 | 45.3 | 16.0 | **49.6** |
189
- | Math | AIME 2024 (Pass@1) | 4.6 | 16.7 | 23.3 | 23.3 | 16.0 | 9.3 | **39.2** |
190
- | | MATH-500 (EM) | 56.3 | 74.7 | 80.0 | 73.8 | 78.3 | 74.6 | **90.2** |
191
- | | CNMO 2024 (Pass@1) | 2.8 | 10.8 | 15.9 | 6.8 | 13.1 | 10.8 | **43.2** |
192
- | Chinese | CLUEWSC (EM) | 89.9 | 90.4 | **91.4** | 84.7 | 85.4 | 87.9 | 90.9 |
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 |
210
- | Qwen2.5-72B-Instruct | 81.2 | 49.1 |
211
- | LLaMA-3.1 405B | 69.3 | 40.5 |
212
- | GPT-4o-0513 | 80.4 | 51.1 |
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)
222
-
223
- We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.com](https://platform.deepseek.com/)
224
-
225
- ## 6. How to Run Locally
226
-
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/8 quantization, with FP8 support coming soon.
233
- 5. **vLLM**: Support DeekSeek-V3 model with FP8 and BF16 modes for tensor parallelism and pipeline parallelism.
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
-
237
- Since FP8 training is natively adopted in our framework, we only provide FP8 weights. If you require BF16 weights for experimentation, you can use the provided conversion script to perform the transformation.
238
-
239
- Here is an example of converting FP8 weights to BF16:
240
-
241
- ```shell
242
- 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
- **NOTE: Huggingface's Transformers has not been directly supported yet.**
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:
253
-
254
- ```shell
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 HuggingFace, and put them into `/path/to/DeepSeek-V3` folder.
266
-
267
- #### Model Weights Conversion
268
-
269
- Convert HuggingFace model weights to a specific format:
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
273
- ```
274
-
275
- #### Run
276
-
277
- Then you can chat with DeepSeek-V3:
278
-
279
- ```shell
280
- torchrun --nnodes 2 --nproc-per-node 8 generate.py --node-rank $RANK --master-addr $ADDR --ckpt-path /path/to/DeepSeek-V3-Demo --config configs/config_671B.json --interactive --temperature 0.7 --max-new-tokens 200
281
- ```
282
-
283
- Or batch inference on a given file:
284
-
285
- ```shell
286
- torchrun --nnodes 2 --nproc-per-node 8 generate.py --node-rank $RANK --master-addr $ADDR --ckpt-path /path/to/DeepSeek-V3-Demo --config configs/config_671B.json --input-file $FILE
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)
298
- [LMDeploy](https://github.com/InternLM/lmdeploy), a flexible and high-performance inference and serving framework tailored for large language models, now supports DeepSeek-V3. It offers both offline pipeline processing and online deployment capabilities, seamlessly integrating with PyTorch-based workflows.
299
-
300
- For comprehensive step-by-step instructions on running DeepSeek-V3 with LMDeploy, please refer to here: https://github.com/InternLM/lmdeploy/issues/2960
301
-
302
-
303
- ### 6.4 Inference with TRT-LLM (recommended)
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.
310
-
311
- ### 6.6 Recommended Inference Functionality with AMD GPUs
312
-
313
- In collaboration with the AMD team, we have achieved Day-One support for AMD GPUs using SGLang, with full compatibility for both FP8 and BF16 precision. For detailed guidance, please refer to the [SGLang instructions](#63-inference-with-lmdeploy-recommended).
314
-
315
- ### 6.7 Recommended Inference Functionality with Huawei Ascend NPUs
316
- The [MindIE](https://www.hiascend.com/en/software/mindie) framework from the Huawei Ascend community has successfully adapted the BF16 version of DeepSeek-V3. For step-by-step guidance on Ascend NPUs, please follow the [instructions here](https://modelers.cn/models/MindIE/deepseekv3).
317
-
318
-
319
- ## 7. License
320
- This code repository is licensed under [the MIT License](LICENSE-CODE). The use of DeepSeek-V3 Base/Chat models is subject to [the Model License](LICENSE-MODEL). DeepSeek-V3 series (including Base and Chat) supports commercial use.
321
-
322
- ## 8. Citation
323
- ```
324
-
325
- ```
326
-
327
- ## 9. Contact
328
- If you have any questions, please raise an issue or contact us at [service@deepseek.com](service@deepseek.com).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: other
3
+ language:
4
+ - ja
5
+ base_model:
6
+ - deepseek-ai/DeepSeek-V3
 
 
7
  ---
8
+ # DeepSeek-V3-slice-jp64
9
 
10
+ 本モデルは [DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3) をベースに、日本語の例文を元に頻出する MoE (Mixture of Experts) の各レイヤーごとのexpertsを厳選して再構成したモデルです。
11
+ 元のモデルでは 256 のexpertsを搭載していますが、日本語出力における安定性とパフォーマンスのバランスを重視し、各層で頻出する 64 のexpertsを使用するように調整しています。
 
 
 
 
12
 
13
+ ### 例文出力時の各layerごとのexpertsの頻出分布
14
+ ![](layer_topk_idx_distribution_bubble.png)
15
  ---
16
 
17
+ ## 特徴
18
 
19
+ - MoEモデルのexpertsから、日本語の例文出力をして各layerごとに頻出する64のexpertをして組み直したモデルです。
20
+ - 16ではまともに動かず、32では安定しなかったため64expertsにしています。
21
+ - scripts/layer_topk_idx_distribution.json
22
+ - 各layerごとに頻出順に128のexpertのrankが記録されています。
23
+ - scripts/deepseek_slice.py
24
+ - 元モデル(bf16)から、64のexpertを使用したモデル(bf16)を作成します。
25
+ - scripts/model_test.py
26
+ - モデル実行用テスト用のスクリプトです。コメントアウトされている例文を元に頻出するexpertを計測しています
27
 
28
  ---
29
 
30
+ ## 使い方
31
+ `scripts/model_test.py`に実行コードあります