JunHowie commited on
Commit
bf14887
·
verified ·
1 Parent(s): 945378b

Delete .ipynb_checkpoints

Browse files
.ipynb_checkpoints/README-checkpoint.md DELETED
@@ -1,217 +0,0 @@
1
- ---
2
- license: mit
3
- library_name: transformers
4
- pipeline_tag: text-generation
5
- tags:
6
- - vLLM
7
- - AWQ
8
- base_model:
9
- - deepseek-ai/DeepSeek-V3.2
10
- base_model_relation: quantized
11
-
12
- ---
13
- # DeepSeek-V3.2-AWQ
14
- Base model: [deepseek-ai/DeepSeek-V3.2](https://www.modelscope.cn/models/deepseek-ai/DeepSeek-V3.2)
15
-
16
- ```
17
- Note:
18
- 1. Tested on Hopper device, we don't know if
19
- ada / ampere devices could run this repo yet.
20
- 2. Waiting for official chat_template.jinja;
21
- The file in this repo is borrowed from v3.1
22
- with thinking mode turned off by default.
23
- To enable thinking mode, include:
24
- extra_body = {"chat_template_kwargs": {"thinking": True}}
25
- in the post requests.
26
- ```
27
-
28
- ### 【Dependencies / Installation】
29
-
30
- As of **2025-12-02**, make sure your system has cuda12.8 installed.
31
-
32
- Then, create a fresh Python environment (e.g. python3.12 venv) and run:
33
- ```bash
34
- # install vllm
35
- pip install vllm==0.11.2
36
- # install deep_gemm
37
- git clone https://github.com/deepseek-ai/DeepGEMM.git
38
- cd DeepGEMM/third-party
39
- git clone https://github.com/NVIDIA/cutlass.git
40
- git clone https://github.com/fmtlib/fmt.git
41
- cd ../
42
- git checkout v2.1.1.post3
43
- pip install . --no-build-isolation
44
- ```
45
-
46
- or
47
-
48
- ```
49
- uv pip install vllm --extra-index-url https://wheels.vllm.ai/nightly
50
- uv pip install git+https://github.com/deepseek-ai/[email protected] --no-build-isolation # Other versions may also work. We recommend using the latest released version from https://github.com/deepseek-ai/DeepGEMM/releases
51
- ```
52
-
53
- see [Official vLLM Deepseek-V3.2 Guide](https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-V3_2-Exp.html)
54
-
55
-
56
- ### 【vLLM Startup Command】
57
- <i>Note: It could take a little while to load, if `--enable-expert-parallel` is enabled;
58
-
59
- ```
60
- export VLLM_USE_DEEP_GEMM=0 # ATM, this line is a "must" for Hopper devices
61
- CONTEXT_LENGTH=32768
62
- vllm serve \
63
- __YOUR_PATH__/tclf90/DeepSeek-V3.2-AWQ \
64
- --served-model-name MY_MODEL_NAME \
65
- --enable-auto-tool-choice \
66
- --tool-call-parser deepseek_v31 \
67
- --reasoning-parser deepseek_v3 \
68
- --swap-space 16 \
69
- --max-num-seqs 32 \
70
- --max-model-len $CONTEXT_LENGTH \
71
- --gpu-memory-utilization 0.9 \
72
- --tensor-parallel-size 8 \
73
- --enable-expert-parallel \ # optional
74
- --speculative-config '{"model": "__YOUR_PATH__/tclf90/DeepSeek-V3.2-AWQ", "num_speculative_tokens": 1}' \ # optional, 50%+- throughput increase is observed
75
- --trust-remote-code \
76
- --host 0.0.0.0 \
77
- --port 8000
78
- ```
79
-
80
- ### 【Logs】
81
- ```
82
- 2025-12-02
83
- 1. Initial commit
84
- ```
85
-
86
- ### 【Model Files】
87
- | File Size | Last Updated |
88
- |-----------|--------------|
89
- | `338 GiB` | `2025-12-02` |
90
-
91
- ### 【Model Download】
92
- ```python
93
- from modelscope import snapshot_download
94
- snapshot_download('tclf90/DeepSeek-V3.2-AWQ', cache_dir="your_local_path")
95
- ```
96
-
97
- ### 【Overview】
98
- # DeepSeek-V3.2: Efficient Reasoning & Agentic AI
99
-
100
- <!-- markdownlint-disable first-line-h1 -->
101
- <!-- markdownlint-disable html -->
102
- <!-- markdownlint-disable no-duplicate-header -->
103
-
104
- <div align="center">
105
- <img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/logo.svg?raw=true" width="60%" alt="DeepSeek-V3" />
106
- </div>
107
- <hr>
108
- <div align="center" style="line-height: 1;">
109
- <a href="https://www.deepseek.com/" target="_blank" style="margin: 2px;">
110
- <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;"/>
111
- </a>
112
- <a href="https://chat.deepseek.com/" target="_blank" style="margin: 2px;">
113
- <img alt="Chat" src="https://img.shields.io/badge/🤖%20Chat-DeepSeek%20V3-536af5?color=536af5&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
114
- </a>
115
- <a href="https://huggingface.co/deepseek-ai" target="_blank" style="margin: 2px;">
116
- <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;"/>
117
- </a>
118
- </div>
119
- <div align="center" style="line-height: 1;">
120
- <a href="https://discord.gg/Tc7c45Zzu5" target="_blank" style="margin: 2px;">
121
- <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;"/>
122
- </a>
123
- <a href="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/qr.jpeg?raw=true" target="_blank" style="margin: 2px;">
124
- <img alt="Wechat" src="https://img.shields.io/badge/WeChat-DeepSeek%20AI-brightgreen?logo=wechat&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
125
- </a>
126
- <a href="https://twitter.com/deepseek_ai" target="_blank" style="margin: 2px;">
127
- <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;"/>
128
- </a>
129
- </div>
130
- <div align="center" style="line-height: 1;">
131
- <a href="LICENSE" style="margin: 2px;">
132
- <img alt="License" src="https://img.shields.io/badge/License-MIT-f5de53?&color=f5de53" style="display: inline-block; vertical-align: middle;"/>
133
- </a>
134
- </div>
135
-
136
- <p align="center">
137
- <a href="assets/paper.pdf"><b>Technical Report</b>👁️</a>
138
- </p>
139
-
140
- ## Introduction
141
-
142
- We introduce **DeepSeek-V3.2**, a model that harmonizes high computational efficiency with superior reasoning and agent performance. Our approach is built upon three key technical breakthroughs:
143
-
144
- 1. **DeepSeek Sparse Attention (DSA):** We introduce DSA, an efficient attention mechanism that substantially reduces computational complexity while preserving model performance, specifically optimized for long-context scenarios.
145
- 2. **Scalable Reinforcement Learning Framework:** By implementing a robust RL protocol and scaling post-training compute, *DeepSeek-V3.2* performs comparably to GPT-5. Notably, our high-compute variant, **DeepSeek-V3.2-Speciale**, **surpasses GPT-5** and exhibits reasoning proficiency on par with Gemini-3.0-Pro.
146
- - *Achievement:* 🥇 **Gold-medal performance** in the 2025 International Mathematical Olympiad (IMO) and International Olympiad in Informatics (IOI).
147
- 3. **Large-Scale Agentic Task Synthesis Pipeline:** To integrate **reasoning into tool-use** scenarios, we developed a novel synthesis pipeline that systematically generates training data at scale. This facilitates scalable agentic post-training, improving compliance and generalization in complex interactive environments.
148
-
149
- <div align="center">
150
- <img src="assets/benchmark.png" >
151
- </div>
152
-
153
- We have also released the final submissions for IOI 2025, ICPC World Finals, IMO 2025 and CMO 2025, which were selected based on our designed pipeline. These materials are provided for the community to conduct secondary verification. The files can be accessed at `assets/olympiad_cases`.
154
-
155
- ## Chat Template
156
-
157
- DeepSeek-V3.2 introduces significant updates to its chat template compared to prior versions. The primary changes involve a revised format for tool calling and the introduction of a "thinking with tools" capability.
158
-
159
- To assist the community in understanding and adapting to this new template, we have provided a dedicated `encoding` folder, which contains Python scripts and test cases demonstrating how to encode messages in OpenAI-compatible format into input strings for the model and how to parse the model's text output.
160
-
161
- A brief example is illustrated below:
162
-
163
- ```python
164
- import transformers
165
- # encoding/encoding_dsv32.py
166
- from encoding_dsv32 import encode_messages, parse_message_from_completion_text
167
-
168
- tokenizer = transformers.AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-V3.2")
169
-
170
- messages = [
171
- {"role": "user", "content": "hello"},
172
- {"role": "assistant", "content": "Hello! I am DeepSeek.", "reasoning_content": "thinking..."},
173
- {"role": "user", "content": "1+1=?"}
174
- ]
175
- encode_config = dict(thinking_mode="thinking", drop_thinking=True, add_default_bos_token=True)
176
-
177
- # messages -> string
178
- prompt = encode_messages(messages, **encode_config)
179
- # Output: "<|begin▁of▁sentence|><|User|>hello<|Assistant|></think>Hello! I am DeepSeek.<|end▁of▁sentence|><|User|>1+1=?<|Assistant|><think>"
180
-
181
- # string -> tokens
182
- tokens = tokenizer.encode(prompt)
183
- # Output: [0, 128803, 33310, 128804, 128799, 19923, 3, 342, 1030, 22651, 4374, 1465, 16, 1, 128803, 19, 13, 19, 127252, 128804, 128798]
184
- ```
185
-
186
- Important Notes:
187
-
188
- 1. This release does not include a Jinja-format chat template. Please refer to the Python code mentioned above.
189
- 2. The output parsing function included in the code is designed to handle well-formatted strings only. It does not attempt to correct or recover from malformed output that the model might occasionally generate. It is not suitable for production use without robust error handling.
190
- 3. A new role named `developer` has been introduced in the chat template. This role is dedicated exclusively to search agent scenarios and is designated for no other tasks. The official API does not accept messages assigned to `developer`.
191
-
192
- ## How to Run Locally
193
-
194
- The model structure of DeepSeek-V3.2 and DeepSeek-V3.2-Speciale are the same as DeepSeek-V3.2-Exp. Please visit [DeepSeek-V3.2-Exp](https://github.com/deepseek-ai/DeepSeek-V3.2-Exp) repo for more information about running this model locally.
195
-
196
- Usage Recommendations:
197
-
198
- 1. For local deployment, we recommend setting the sampling parameters to `temperature = 1.0, top_p = 0.95`.
199
- 2. Please note that the DeepSeek-V3.2-Speciale variant is designed exclusively for deep reasoning tasks and does not support the tool-calling functionality.
200
-
201
- ## License
202
-
203
- This repository and the model weights are licensed under the [MIT License](LICENSE).
204
-
205
- ## Citation
206
-
207
- ```
208
- @misc{deepseekai2025deepseekv32,
209
- title={DeepSeek-V3.2: Pushing the Frontier of Open Large Language Models},
210
- author={DeepSeek-AI},
211
- year={2025},
212
- }
213
- ```
214
-
215
- ## Contact
216
-
217
- If you have any questions, please raise an issue or contact us at [[email protected]]([email protected]).