Update README.md
Browse files
README.md
CHANGED
@@ -93,7 +93,7 @@ print("thinking content:", thinking_content)
|
|
93 |
print("content:", content)
|
94 |
```
|
95 |
|
96 |
-
For deployment, you can use `sglang>=0.4.6.post1` or `vllm>=0.8.
|
97 |
- SGLang:
|
98 |
```shell
|
99 |
python -m sglang.launch_server --model-path Qwen/Qwen3-32B-FP8 --reasoning-parser qwen3
|
@@ -103,39 +103,16 @@ For deployment, you can use `sglang>=0.4.6.post1` or `vllm>=0.8.4` or to create
|
|
103 |
vllm serve Qwen/Qwen3-32B-FP8 --enable-reasoning --reasoning-parser deepseek_r1
|
104 |
```
|
105 |
|
106 |
-
For local use, applications such as
|
107 |
|
108 |
## Note on FP8
|
109 |
|
110 |
For convenience and performance, we have provided `fp8`-quantized model checkpoint for Qwen3, whose name ends with `-FP8`. The quantization method is fine-grained `fp8` quantization with block size of 128. You can find more details in the `quantization_config` field in `config.json`.
|
111 |
|
112 |
-
You can use the Qwen3-32B-FP8 model with serveral inference frameworks, including `transformers`, `
|
113 |
However, please pay attention to the following known issues:
|
114 |
- `transformers`:
|
115 |
- there are currently issues with the "fine-grained fp8" method in `transformers` for distributed inference. You may need to set the environment variable `CUDA_LAUNCH_BLOCKING=1` if multiple devices are used in inference.
|
116 |
-
- vLLM:
|
117 |
-
- there are currently compatibility issues with `vllm`. For a quick fix, you should make the following changes to `vllm/vllm/model_executor/layers/linear.py`:
|
118 |
-
```python
|
119 |
-
# these changes are in QKVParallelLinear.weight_loader_v2() of vllm/vllm/model_executor/layers/linear.py
|
120 |
-
...
|
121 |
-
shard_offset = self._get_shard_offset_mapping(loaded_shard_id)
|
122 |
-
shard_size = self._get_shard_size_mapping(loaded_shard_id)
|
123 |
-
|
124 |
-
# add the following code
|
125 |
-
if isinstance(param, BlockQuantScaleParameter):
|
126 |
-
weight_block_size = self.quant_method.quant_config.weight_block_size
|
127 |
-
block_n, _ = weight_block_size[0], weight_block_size[1]
|
128 |
-
shard_offset = (shard_offset + block_n - 1) // block_n
|
129 |
-
shard_size = (shard_size + block_n - 1) // block_n
|
130 |
-
# end of the modification
|
131 |
-
|
132 |
-
param.load_qkv_weight(loaded_weight=loaded_weight,
|
133 |
-
num_heads=self.num_kv_head_replicas,
|
134 |
-
shard_id=loaded_shard_id,
|
135 |
-
shard_offset=shard_offset,
|
136 |
-
shard_size=shard_size)
|
137 |
-
...
|
138 |
-
```
|
139 |
|
140 |
## Switching Between Thinking and Non-Thinking Mode
|
141 |
|
@@ -309,7 +286,7 @@ YaRN is currently supported by several inference frameworks, e.g., `transformers
|
|
309 |
{
|
310 |
...,
|
311 |
"rope_scaling": {
|
312 |
-
"
|
313 |
"factor": 4.0,
|
314 |
"original_max_position_embeddings": 32768
|
315 |
}
|
@@ -321,12 +298,12 @@ YaRN is currently supported by several inference frameworks, e.g., `transformers
|
|
321 |
|
322 |
For `vllm`, you can use
|
323 |
```shell
|
324 |
-
vllm serve ... --rope-scaling '{"
|
325 |
```
|
326 |
|
327 |
For `sglang`, you can use
|
328 |
```shell
|
329 |
-
python -m sglang.launch_server ... --json-model-override-args '{"rope_scaling":{"
|
330 |
```
|
331 |
|
332 |
For `llama-server` from `llama.cpp`, you can use
|
|
|
93 |
print("content:", content)
|
94 |
```
|
95 |
|
96 |
+
For deployment, you can use `sglang>=0.4.6.post1` or `vllm>=0.8.5` or to create an OpenAI-compatible API endpoint:
|
97 |
- SGLang:
|
98 |
```shell
|
99 |
python -m sglang.launch_server --model-path Qwen/Qwen3-32B-FP8 --reasoning-parser qwen3
|
|
|
103 |
vllm serve Qwen/Qwen3-32B-FP8 --enable-reasoning --reasoning-parser deepseek_r1
|
104 |
```
|
105 |
|
106 |
+
For local use, applications such as Ollama, LMStudio, MLX-LM, llama.cpp, and KTransformers have also supported Qwen3.
|
107 |
|
108 |
## Note on FP8
|
109 |
|
110 |
For convenience and performance, we have provided `fp8`-quantized model checkpoint for Qwen3, whose name ends with `-FP8`. The quantization method is fine-grained `fp8` quantization with block size of 128. You can find more details in the `quantization_config` field in `config.json`.
|
111 |
|
112 |
+
You can use the Qwen3-32B-FP8 model with serveral inference frameworks, including `transformers`, `sglang`, and `vllm`, as the original bfloat16 model.
|
113 |
However, please pay attention to the following known issues:
|
114 |
- `transformers`:
|
115 |
- there are currently issues with the "fine-grained fp8" method in `transformers` for distributed inference. You may need to set the environment variable `CUDA_LAUNCH_BLOCKING=1` if multiple devices are used in inference.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
## Switching Between Thinking and Non-Thinking Mode
|
118 |
|
|
|
286 |
{
|
287 |
...,
|
288 |
"rope_scaling": {
|
289 |
+
"rope_type": "yarn",
|
290 |
"factor": 4.0,
|
291 |
"original_max_position_embeddings": 32768
|
292 |
}
|
|
|
298 |
|
299 |
For `vllm`, you can use
|
300 |
```shell
|
301 |
+
vllm serve ... --rope-scaling '{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":32768}' --max-model-len 131072
|
302 |
```
|
303 |
|
304 |
For `sglang`, you can use
|
305 |
```shell
|
306 |
+
python -m sglang.launch_server ... --json-model-override-args '{"rope_scaling":{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":32768}}'
|
307 |
```
|
308 |
|
309 |
For `llama-server` from `llama.cpp`, you can use
|