Update README.md
Browse files
README.md
CHANGED
|
@@ -3,7 +3,6 @@
|
|
| 3 |
license: other
|
| 4 |
license_link: https://huggingface.co/stepfun-ai/Step-5-Preview/blob/main/LICENSE.txt
|
| 5 |
---
|
| 6 |
-
---
|
| 7 |
<p align="center">
|
| 8 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65dc9de42a6348b052a3286e/-R9DERgmQiBfO2cF0HXoD.png" alt="StepFun logo" width="64" />
|
| 9 |
</p>
|
|
@@ -15,7 +14,14 @@ license_link: https://huggingface.co/stepfun-ai/Step-5-Preview/blob/main/LICENSE
|
|
| 15 |
</p>
|
| 16 |
|
| 17 |
<p align="center">
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</p>
|
| 20 |
|
| 21 |
<p align="center">
|
|
@@ -30,7 +36,8 @@ license_link: https://huggingface.co/stepfun-ai/Step-5-Preview/blob/main/LICENSE
|
|
| 30 |
<a href="#model-specifications">Specifications</a> ·
|
| 31 |
<a href="#performance">Performance</a> ·
|
| 32 |
<a href="#deployment">Deployment</a> ·
|
| 33 |
-
<a href="#resources">Resources</a>
|
|
|
|
| 34 |
</p>
|
| 35 |
|
| 36 |
---
|
|
@@ -94,44 +101,99 @@ Step 5 Preview can be served through an OpenAI-compatible API with vLLM or SGLan
|
|
| 94 |
|
| 95 |
Use a framework build that includes Step 5 Preview support, including the reasoning, tool-call, and speculative decoding features used in the serving commands.
|
| 96 |
|
| 97 |
-
### Deployment
|
| 98 |
|
| 99 |
| Framework | Precision | Hardware | Parallelism | Interface |
|
| 100 |
| --- | --- | --- | --- | --- |
|
| 101 |
-
| vLLM | FP8 | One
|
| 102 |
-
| vLLM |
|
|
|
|
|
|
|
| 103 |
| Transformers | FP8 | One H200 node, 8 GPUs | TP8 / EP8 | Offline generation |
|
| 104 |
| Transformers | BF16 | Two H200 nodes, 16 GPUs | TP16 / EP16 | Offline generation (see validation note below) |
|
| 105 |
|
| 106 |
-
DP, TP, and EP refer to data, tensor, and expert parallelism, respectively. These example configurations are sized for the deployments below. Actual memory requirements, usable context length, and concurrency vary with the checkpoint, inference framework, and KV cache allocation.
|
| 107 |
|
| 108 |
**Deployment guides:** [vLLM](#vllm) · [Transformers](#transformers) · [SGLang](#sglang) · [Send a Request](#send-a-request)
|
| 109 |
|
| 110 |
### vLLM
|
| 111 |
|
|
|
|
|
|
|
| 112 |
#### Environment Setup
|
| 113 |
|
| 114 |
-
|
| 115 |
|
| 116 |
```bash
|
| 117 |
-
docker pull vllm/vllm-openai:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
```
|
| 119 |
|
| 120 |
-
|
| 121 |
|
| 122 |
<details>
|
| 123 |
-
<summary><strong>FP8:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
```bash
|
| 128 |
vllm serve stepfun-ai/Step-5-Preview \
|
|
|
|
|
|
|
| 129 |
--served-model-name "step5" \
|
| 130 |
--tensor-parallel-size 4 \
|
| 131 |
-
--data-parallel-size 2 \
|
| 132 |
--data-parallel-backend mp \
|
| 133 |
--distributed-executor-backend mp \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
--enable-expert-parallel \
|
|
|
|
|
|
|
|
|
|
| 135 |
--disable-custom-all-reduce \
|
| 136 |
--max-model-len 1048576 \
|
| 137 |
--max-num-batched-tokens 16384 \
|
|
@@ -145,77 +207,144 @@ vllm serve stepfun-ai/Step-5-Preview \
|
|
| 145 |
--tool-call-parser step5
|
| 146 |
```
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
</details>
|
| 149 |
|
| 150 |
<details>
|
| 151 |
-
<summary><strong>BF16
|
|
|
|
|
|
|
| 152 |
|
| 153 |
-
|
| 154 |
|
| 155 |
-
|
| 156 |
|
| 157 |
```bash
|
| 158 |
export MODEL="<STEP5_BF16_MODEL_PATH>"
|
| 159 |
-
export DP_ADDRESS="<NODE_0_HIGH_SPEED_NETWORK_IP>"
|
| 160 |
-
export DP_RPC_PORT=29550
|
| 161 |
-
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
|
| 162 |
-
vllm serve "$MODEL" \
|
| 163 |
-
--host 0.0.0.0 \
|
| 164 |
-
--port 18000 \
|
| 165 |
-
--served-model-name step5 \
|
| 166 |
-
--tensor-parallel-size 4 \
|
| 167 |
-
--data-parallel-size 4 \
|
| 168 |
-
--data-parallel-size-local 2 \
|
| 169 |
-
--data-parallel-address "$DP_ADDRESS" \
|
| 170 |
-
--data-parallel-rpc-port "$DP_RPC_PORT" \
|
| 171 |
-
--data-parallel-backend mp \
|
| 172 |
-
--distributed-executor-backend mp \
|
| 173 |
-
--enable-expert-parallel \
|
| 174 |
-
--disable-custom-all-reduce \
|
| 175 |
-
--max-model-len 1048576 \
|
| 176 |
-
--max-num-batched-tokens 16384 \
|
| 177 |
-
--max-num-seqs 64 \
|
| 178 |
-
--gpu-memory-utilization 0.85 \
|
| 179 |
-
--enable-prefix-caching \
|
| 180 |
-
--spec-method mtp \
|
| 181 |
-
--spec-tokens 3 \
|
| 182 |
-
--reasoning-parser step5 \
|
| 183 |
-
--enable-auto-tool-choice \
|
| 184 |
-
--tool-call-parser step5
|
| 185 |
```
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
```
|
| 217 |
|
| 218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
|
| 220 |
</details>
|
| 221 |
|
|
@@ -232,18 +361,23 @@ Use separate checkpoints and output directories for FP8 and BF16. Conversion pre
|
|
| 232 |
<details>
|
| 233 |
<summary><strong>FP8: One H200 Node, 8 GPUs</strong></summary>
|
| 234 |
|
|
|
|
|
|
|
| 235 |
Convert the FP8 checkpoint once, then launch eight local processes for TP8 / EP8 generation:
|
| 236 |
|
| 237 |
```bash
|
| 238 |
export STEP5_FP8_CHECKPOINT="<FP8_CHECKPOINT_DIRECTORY>"
|
| 239 |
export STEP5_FP8_OUT="<FP8_SHARD_OUTPUT_DIRECTORY>"
|
|
|
|
| 240 |
python3 convert.py \
|
| 241 |
--checkpoint "$STEP5_FP8_CHECKPOINT" \
|
| 242 |
--tp-size 8 --ep-size 8 --check-only
|
|
|
|
| 243 |
python3 convert.py \
|
| 244 |
--checkpoint "$STEP5_FP8_CHECKPOINT" \
|
| 245 |
--out-dir "$STEP5_FP8_OUT" \
|
| 246 |
--tp-size 8 --ep-size 8
|
|
|
|
| 247 |
torchrun --standalone --nproc-per-node=8 generate.py \
|
| 248 |
--tp-dir "$STEP5_FP8_OUT/tp8" --ep-size 8 \
|
| 249 |
--prompt "Please introduce tensor parallelism." \
|
|
@@ -255,14 +389,18 @@ torchrun --standalone --nproc-per-node=8 generate.py \
|
|
| 255 |
<details>
|
| 256 |
<summary><strong>BF16: Two H200 Nodes, 16 GPUs</strong></summary>
|
| 257 |
|
|
|
|
|
|
|
| 258 |
For TP16 / EP16 generation across two nodes, first convert the BF16 checkpoint into 16 shards. Make the resulting `tp16/` and `tokenizer_files/` directories accessible to both nodes:
|
| 259 |
|
| 260 |
```bash
|
| 261 |
export STEP5_BF16_CHECKPOINT="<BF16_CHECKPOINT_DIRECTORY>"
|
| 262 |
export STEP5_BF16_OUT="<BF16_SHARD_OUTPUT_DIRECTORY>"
|
|
|
|
| 263 |
python3 convert.py \
|
| 264 |
--checkpoint "$STEP5_BF16_CHECKPOINT" \
|
| 265 |
--tp-size 16 --ep-size 16 --check-only
|
|
|
|
| 266 |
python3 convert.py \
|
| 267 |
--checkpoint "$STEP5_BF16_CHECKPOINT" \
|
| 268 |
--out-dir "$STEP5_BF16_OUT" \
|
|
@@ -276,6 +414,7 @@ export STEP5_BF16_OUT="<BF16_SHARD_OUTPUT_DIRECTORY>"
|
|
| 276 |
export MASTER_ADDR="<NODE_0_REACHABLE_IP_OR_HOSTNAME>"
|
| 277 |
export MASTER_PORT=29500
|
| 278 |
export NODE_RANK=0 # Set to 1 on node 1.
|
|
|
|
| 279 |
torchrun --nnodes=2 --nproc-per-node=8 \
|
| 280 |
--node-rank="$NODE_RANK" \
|
| 281 |
--master-addr="$MASTER_ADDR" \
|
|
@@ -296,58 +435,192 @@ This launches 16 processes across the two nodes, matching the 16-shard checkpoin
|
|
| 296 |
|
| 297 |
#### Environment Setup
|
| 298 |
|
| 299 |
-
Pull the
|
| 300 |
|
| 301 |
```bash
|
| 302 |
-
docker pull lmsysorg/sglang:
|
| 303 |
```
|
| 304 |
|
| 305 |
-
|
| 306 |
|
| 307 |
<details>
|
| 308 |
-
<summary><strong>
|
|
|
|
|
|
|
| 309 |
|
| 310 |
-
|
| 311 |
|
| 312 |
```bash
|
|
|
|
|
|
|
| 313 |
python -m sglang.launch_server \
|
| 314 |
-
--
|
| 315 |
-
--
|
| 316 |
-
--
|
| 317 |
-
--
|
| 318 |
-
--
|
| 319 |
--moe-runner-backend flashinfer_trtllm \
|
| 320 |
-
--
|
| 321 |
-
--
|
| 322 |
-
--
|
|
|
|
|
|
|
| 323 |
--chunked-prefill-size 16384 \
|
| 324 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
```
|
| 326 |
|
| 327 |
</details>
|
| 328 |
|
| 329 |
### Send a Request
|
| 330 |
|
| 331 |
-
Once the server is ready,
|
| 332 |
|
| 333 |
| Serving configuration | Base URL on the server host |
|
| 334 |
| --- | --- |
|
| 335 |
-
| vLLM FP8 | `http://localhost:
|
| 336 |
| vLLM BF16 | `http://localhost:18000` (node 0) |
|
| 337 |
| SGLang FP8 | `http://localhost:30000` |
|
| 338 |
|
| 339 |
The example below targets vLLM FP8:
|
| 340 |
|
| 341 |
```bash
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
}'
|
| 351 |
```
|
| 352 |
|
| 353 |
## Resources
|
|
@@ -355,4 +628,10 @@ curl "$BASE_URL/v1/chat/completions" \
|
|
| 355 |
- [Step 5 Preview Model Page](https://www.stepfun.com/step-5-preview) — Model overview, evaluation context, and long-horizon case studies.
|
| 356 |
- [Documentation](https://platform.stepfun.ai/docs/en/guides/models/step-5-preview) — Official documentation and developer guides.
|
| 357 |
- [API Platform](https://platform.stepfun.ai/) — Model access and platform services.
|
| 358 |
-
- [StepFun Website](https://www.stepfun.com/) — Company information and model announcements.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
license: other
|
| 4 |
license_link: https://huggingface.co/stepfun-ai/Step-5-Preview/blob/main/LICENSE.txt
|
| 5 |
---
|
|
|
|
| 6 |
<p align="center">
|
| 7 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65dc9de42a6348b052a3286e/-R9DERgmQiBfO2cF0HXoD.png" alt="StepFun logo" width="64" />
|
| 8 |
</p>
|
|
|
|
| 14 |
</p>
|
| 15 |
|
| 16 |
<p align="center">
|
| 17 |
+
600B total parameters · 27B active parameters · Up to 1M context
|
| 18 |
+
</p>
|
| 19 |
+
|
| 20 |
+
<p align="center">
|
| 21 |
+
<a href="https://huggingface.co/stepfun-ai/Step-5-Preview"><img src="https://img.shields.io/badge/Hugging_Face-FP8-FFD21E?style=flat-square" alt="Hugging Face FP8" /></a>
|
| 22 |
+
<a href="https://huggingface.co/stepfun-ai/Step-5-Preview-BF16"><img src="https://img.shields.io/badge/Hugging_Face-BF16-FFD21E?style=flat-square" alt="Hugging Face BF16" /></a>
|
| 23 |
+
<a href="https://modelscope.ai/models/stepfun-ai/Step-5-Preview"><img src="https://img.shields.io/badge/ModelScope-FP8-624AFF?style=flat-square" alt="ModelScope FP8" /></a>
|
| 24 |
+
<a href="https://modelscope.ai/models/stepfun-ai/Step-5-Preview-BF16"><img src="https://img.shields.io/badge/ModelScope-BF16-624AFF?style=flat-square" alt="ModelScope BF16" /></a>
|
| 25 |
</p>
|
| 26 |
|
| 27 |
<p align="center">
|
|
|
|
| 36 |
<a href="#model-specifications">Specifications</a> ·
|
| 37 |
<a href="#performance">Performance</a> ·
|
| 38 |
<a href="#deployment">Deployment</a> ·
|
| 39 |
+
<a href="#resources">Resources</a> ·
|
| 40 |
+
<a href="#license">License</a>
|
| 41 |
</p>
|
| 42 |
|
| 43 |
---
|
|
|
|
| 101 |
|
| 102 |
Use a framework build that includes Step 5 Preview support, including the reasoning, tool-call, and speculative decoding features used in the serving commands.
|
| 103 |
|
| 104 |
+
### Deployment Configurations
|
| 105 |
|
| 106 |
| Framework | Precision | Hardware | Parallelism | Interface |
|
| 107 |
| --- | --- | --- | --- | --- |
|
| 108 |
+
| vLLM | FP8 | One B300 node, 4 GPUs | TP4, TEP4, or DEP4 | OpenAI-compatible API |
|
| 109 |
+
| vLLM | FP8 | One H200 node, 8 GPUs | TP8, TEP8, or DEP8 | OpenAI-compatible API |
|
| 110 |
+
| vLLM | BF16 | One B300 node, 8 GPUs | TP8, TEP8, or DEP8 | OpenAI-compatible API |
|
| 111 |
+
| vLLM | BF16 | Two H200 nodes, 16 GPUs | TP16, TEP16, or DEP16 | OpenAI-compatible API |
|
| 112 |
| Transformers | FP8 | One H200 node, 8 GPUs | TP8 / EP8 | Offline generation |
|
| 113 |
| Transformers | BF16 | Two H200 nodes, 16 GPUs | TP16 / EP16 | Offline generation (see validation note below) |
|
| 114 |
|
| 115 |
+
DP, TP, and EP refer to data, tensor, and expert parallelism, respectively. TEP combines tensor and expert parallelism; DEP combines data and expert parallelism. These example configurations are sized for the deployments below. Actual memory requirements, usable context length, and concurrency vary with the checkpoint, inference framework, and KV cache allocation.
|
| 116 |
|
| 117 |
**Deployment guides:** [vLLM](#vllm) · [Transformers](#transformers) · [SGLang](#sglang) · [Send a Request](#send-a-request)
|
| 118 |
|
| 119 |
### vLLM
|
| 120 |
|
| 121 |
+
The examples below expose Step 5 Preview through an OpenAI-compatible API at port `18000`, with `step5` as the model name used in requests.
|
| 122 |
+
|
| 123 |
#### Environment Setup
|
| 124 |
|
| 125 |
+
Pull the Step 5 Preview image and start an interactive container with GPU access:
|
| 126 |
|
| 127 |
```bash
|
| 128 |
+
docker pull vllm/vllm-openai:step-5-preview
|
| 129 |
+
|
| 130 |
+
docker run --rm -it \
|
| 131 |
+
--gpus all \
|
| 132 |
+
--ipc=host \
|
| 133 |
+
--network=host \
|
| 134 |
+
--volume "$HOME/.cache/huggingface:/root/.cache/huggingface" \
|
| 135 |
+
--entrypoint /bin/bash \
|
| 136 |
+
vllm/vllm-openai:step-5-preview
|
| 137 |
```
|
| 138 |
|
| 139 |
+
Run the serving commands below inside the container. If the checkpoint requires authentication, sign in with `hf auth login` before starting the server.
|
| 140 |
|
| 141 |
<details>
|
| 142 |
+
<summary><strong>FP8: Single Node on 4 B300 GPUs</strong></summary>
|
| 143 |
+
|
| 144 |
+
#### FP8: Single Node on 4 B300 GPUs
|
| 145 |
+
|
| 146 |
+
Choose one of the following parallel configurations for a single node with four B300 GPUs:
|
| 147 |
|
| 148 |
+
| Mode | Tensor parallel | Data parallel | Expert parallel |
|
| 149 |
+
| :---: | :---: | :---: | :---: |
|
| 150 |
+
| TP4 | 4 | 1 | Disabled |
|
| 151 |
+
| TEP4 | 4 | 1 | 4 |
|
| 152 |
+
| DEP4 | 1 | 4 | 4 |
|
| 153 |
+
|
| 154 |
+
Make all four GPUs visible, then run the command for your chosen configuration:
|
| 155 |
+
|
| 156 |
+
```bash
|
| 157 |
+
export CUDA_VISIBLE_DEVICES=0,1,2,3
|
| 158 |
+
```
|
| 159 |
+
|
| 160 |
+
On B300 (Blackwell), the TEP4 and DEP4 commands select MegaMoE with `--moe-backend deep_gemm_mega_moe`. The TP4 command uses the default MoE backend, since MegaMoE requires expert parallelism.
|
| 161 |
+
|
| 162 |
+
##### TP4: Tensor Parallelism
|
| 163 |
|
| 164 |
```bash
|
| 165 |
vllm serve stepfun-ai/Step-5-Preview \
|
| 166 |
+
--host 0.0.0.0 \
|
| 167 |
+
--port 18000 \
|
| 168 |
--served-model-name "step5" \
|
| 169 |
--tensor-parallel-size 4 \
|
|
|
|
| 170 |
--data-parallel-backend mp \
|
| 171 |
--distributed-executor-backend mp \
|
| 172 |
+
--disable-custom-all-reduce \
|
| 173 |
+
--max-model-len 1048576 \
|
| 174 |
+
--max-num-batched-tokens 16384 \
|
| 175 |
+
--max-num-seqs 64 \
|
| 176 |
+
--gpu-memory-utilization 0.85 \
|
| 177 |
+
--enable-prefix-caching \
|
| 178 |
+
--spec-method mtp \
|
| 179 |
+
--spec-tokens 3 \
|
| 180 |
+
--reasoning-parser step5 \
|
| 181 |
+
--enable-auto-tool-choice \
|
| 182 |
+
--tool-call-parser step5
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
##### TEP4: Tensor and Expert Parallelism
|
| 186 |
+
|
| 187 |
+
```bash
|
| 188 |
+
vllm serve stepfun-ai/Step-5-Preview \
|
| 189 |
+
--host 0.0.0.0 \
|
| 190 |
+
--port 18000 \
|
| 191 |
+
--served-model-name "step5" \
|
| 192 |
+
--tensor-parallel-size 4 \
|
| 193 |
--enable-expert-parallel \
|
| 194 |
+
--moe-backend deep_gemm_mega_moe \
|
| 195 |
+
--data-parallel-backend mp \
|
| 196 |
+
--distributed-executor-backend mp \
|
| 197 |
--disable-custom-all-reduce \
|
| 198 |
--max-model-len 1048576 \
|
| 199 |
--max-num-batched-tokens 16384 \
|
|
|
|
| 207 |
--tool-call-parser step5
|
| 208 |
```
|
| 209 |
|
| 210 |
+
##### DEP4: Data and Expert Parallelism
|
| 211 |
+
|
| 212 |
+
```bash
|
| 213 |
+
vllm serve stepfun-ai/Step-5-Preview \
|
| 214 |
+
--host 0.0.0.0 \
|
| 215 |
+
--port 18000 \
|
| 216 |
+
--served-model-name "step5" \
|
| 217 |
+
--tensor-parallel-size 1 \
|
| 218 |
+
--data-parallel-size 4 \
|
| 219 |
+
--enable-expert-parallel \
|
| 220 |
+
--moe-backend deep_gemm_mega_moe \
|
| 221 |
+
--data-parallel-backend mp \
|
| 222 |
+
--distributed-executor-backend mp \
|
| 223 |
+
--disable-custom-all-reduce \
|
| 224 |
+
--max-model-len 1048576 \
|
| 225 |
+
--max-num-batched-tokens 16384 \
|
| 226 |
+
--max-num-seqs 64 \
|
| 227 |
+
--gpu-memory-utilization 0.85 \
|
| 228 |
+
--enable-prefix-caching \
|
| 229 |
+
--spec-method mtp \
|
| 230 |
+
--spec-tokens 3 \
|
| 231 |
+
--reasoning-parser step5 \
|
| 232 |
+
--enable-auto-tool-choice \
|
| 233 |
+
--tool-call-parser step5
|
| 234 |
+
```
|
| 235 |
+
|
| 236 |
+
##### FP8 on H200
|
| 237 |
+
|
| 238 |
+
For a single node with eight H200 GPUs, adapt one of the B300 commands above:
|
| 239 |
+
|
| 240 |
+
1. Set `CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7`.
|
| 241 |
+
2. For TP8 or TEP8, set `--tensor-parallel-size 8`. For DEP8, keep `--tensor-parallel-size 1` and set `--data-parallel-size 8`.
|
| 242 |
+
3. For TEP8 or DEP8, retain `--enable-expert-parallel` and remove `--moe-backend deep_gemm_mega_moe`; H200 (Hopper) uses the default MoE backend.
|
| 243 |
+
|
| 244 |
+
TP and TEP use DP=1; DEP uses TP=1. In all configurations, `--max-num-seqs` applies per DP rank. The 1M-token context limit covers input and output combined. If KV cache memory is insufficient, reduce `--max-model-len` or concurrency.
|
| 245 |
+
|
| 246 |
</details>
|
| 247 |
|
| 248 |
<details>
|
| 249 |
+
<summary><strong>BF16</strong></summary>
|
| 250 |
+
|
| 251 |
+
#### BF16
|
| 252 |
|
| 253 |
+
BF16 deployments require a BF16 checkpoint. Setting `--dtype bfloat16` on the FP8 checkpoint does not convert its quantized weights to BF16.
|
| 254 |
|
| 255 |
+
Mount the BF16 checkpoint directory at the same path inside the container, then set `MODEL` to that path:
|
| 256 |
|
| 257 |
```bash
|
| 258 |
export MODEL="<STEP5_BF16_MODEL_PATH>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
```
|
| 260 |
|
| 261 |
+
Choose a configuration for your hardware:
|
| 262 |
|
| 263 |
+
| Hardware | BF16 layout | MoE backend |
|
| 264 |
+
| :---: | :---: | :---: |
|
| 265 |
+
| 8 B300 GPUs | TP8, TEP8, or DEP8 | MegaMoE for TEP/DEP; default for TP |
|
| 266 |
+
| 2 × 8 H200 GPUs | TP16, TEP16, or DEP16 | Default |
|
| 267 |
+
|
| 268 |
+
These configurations provide a starting point for loading the BF16 weights. They do not guarantee enough memory for a 1M-token request; KV cache and runtime buffers also require GPU memory.
|
| 269 |
+
|
| 270 |
+
##### B300: One Node, 8 GPUs
|
| 271 |
+
|
| 272 |
+
Set `CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7` inside the container. Start from the [TP4 command](#tp4-tensor-parallelism), replace `stepfun-ai/Step-5-Preview` with `"$MODEL"`, and replace `--tensor-parallel-size 4` with one of the argument sets below:
|
| 273 |
+
|
| 274 |
+
| Mode | Parallel arguments |
|
| 275 |
+
| :---: | :--- |
|
| 276 |
+
| TP8 | `--tensor-parallel-size 8` |
|
| 277 |
+
| TEP8 | `--tensor-parallel-size 8 --enable-expert-parallel --moe-backend deep_gemm_mega_moe` |
|
| 278 |
+
| DEP8 | `--tensor-parallel-size 1 --data-parallel-size 8 --enable-expert-parallel --moe-backend deep_gemm_mega_moe` |
|
| 279 |
+
|
| 280 |
+
Retain the remaining serving arguments, including `--served-model-name "step5"`, `--reasoning-parser step5`, and `--tool-call-parser step5`.
|
| 281 |
+
|
| 282 |
+
##### H200: Two Nodes, 16 GPUs
|
| 283 |
+
|
| 284 |
+
Use the same BF16 checkpoint path and container image on both nodes. Replace `<NODE_0_IP>` below with node 0's high-speed-network IP, reachable from node 1. H200 uses the default MoE backend; omit `--moe-backend deep_gemm_mega_moe`.
|
| 285 |
+
|
| 286 |
+
On each node:
|
| 287 |
+
|
| 288 |
+
1. Set `MODEL` to the mounted BF16 checkpoint path and `CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7`.
|
| 289 |
+
2. Start from the [TP4 command](#tp4-tensor-parallelism) and replace `stepfun-ai/Step-5-Preview` with `"$MODEL"`.
|
| 290 |
+
3. Remove `--host`, `--port`, and `--tensor-parallel-size` from that command, then insert the argument block for your configuration and node below. These blocks contain arguments to append to `vllm serve`, rather than standalone commands.
|
| 291 |
+
|
| 292 |
+
Keep all other serving arguments, including `--data-parallel-backend mp`, `--distributed-executor-backend mp`, the model name, and both parsers. Run one completed command per node. Only node 0 exposes the API, on port `18000`.
|
| 293 |
+
|
| 294 |
+
**TP16 / TEP16**
|
| 295 |
+
|
| 296 |
+
For TP16, use the following arguments. For TEP16, also add `--enable-expert-parallel` on both nodes. Both configurations use DP=1.
|
| 297 |
+
|
| 298 |
+
Node 0:
|
| 299 |
+
|
| 300 |
+
```text
|
| 301 |
+
--host 0.0.0.0 \
|
| 302 |
+
--port 18000 \
|
| 303 |
+
--tensor-parallel-size 16 \
|
| 304 |
+
--nnodes 2 \
|
| 305 |
+
--node-rank 0 \
|
| 306 |
+
--master-addr <NODE_0_IP>
|
| 307 |
```
|
| 308 |
|
| 309 |
+
Node 1:
|
| 310 |
+
|
| 311 |
+
```text
|
| 312 |
+
--tensor-parallel-size 16 \
|
| 313 |
+
--nnodes 2 \
|
| 314 |
+
--node-rank 1 \
|
| 315 |
+
--master-addr <NODE_0_IP> \
|
| 316 |
+
--headless
|
| 317 |
+
```
|
| 318 |
+
|
| 319 |
+
**DEP16**
|
| 320 |
+
|
| 321 |
+
DEP16 uses TP=1 and distributes the experts across 16 data-parallel ranks, with eight ranks on each node. Use the same data-parallel address and RPC port on both nodes.
|
| 322 |
+
|
| 323 |
+
Node 0:
|
| 324 |
+
|
| 325 |
+
```text
|
| 326 |
+
--host 0.0.0.0 \
|
| 327 |
+
--port 18000 \
|
| 328 |
+
--tensor-parallel-size 1 \
|
| 329 |
+
--data-parallel-size 16 \
|
| 330 |
+
--data-parallel-size-local 8 \
|
| 331 |
+
--data-parallel-address <NODE_0_IP> \
|
| 332 |
+
--data-parallel-rpc-port 29550 \
|
| 333 |
+
--enable-expert-parallel
|
| 334 |
+
```
|
| 335 |
+
|
| 336 |
+
Node 1:
|
| 337 |
+
|
| 338 |
+
```text
|
| 339 |
+
--tensor-parallel-size 1 \
|
| 340 |
+
--data-parallel-size 16 \
|
| 341 |
+
--data-parallel-size-local 8 \
|
| 342 |
+
--data-parallel-start-rank 8 \
|
| 343 |
+
--data-parallel-address <NODE_0_IP> \
|
| 344 |
+
--data-parallel-rpc-port 29550 \
|
| 345 |
+
--enable-expert-parallel \
|
| 346 |
+
--headless
|
| 347 |
+
```
|
| 348 |
|
| 349 |
</details>
|
| 350 |
|
|
|
|
| 361 |
<details>
|
| 362 |
<summary><strong>FP8: One H200 Node, 8 GPUs</strong></summary>
|
| 363 |
|
| 364 |
+
#### FP8: One H200 Node, 8 GPUs
|
| 365 |
+
|
| 366 |
Convert the FP8 checkpoint once, then launch eight local processes for TP8 / EP8 generation:
|
| 367 |
|
| 368 |
```bash
|
| 369 |
export STEP5_FP8_CHECKPOINT="<FP8_CHECKPOINT_DIRECTORY>"
|
| 370 |
export STEP5_FP8_OUT="<FP8_SHARD_OUTPUT_DIRECTORY>"
|
| 371 |
+
|
| 372 |
python3 convert.py \
|
| 373 |
--checkpoint "$STEP5_FP8_CHECKPOINT" \
|
| 374 |
--tp-size 8 --ep-size 8 --check-only
|
| 375 |
+
|
| 376 |
python3 convert.py \
|
| 377 |
--checkpoint "$STEP5_FP8_CHECKPOINT" \
|
| 378 |
--out-dir "$STEP5_FP8_OUT" \
|
| 379 |
--tp-size 8 --ep-size 8
|
| 380 |
+
|
| 381 |
torchrun --standalone --nproc-per-node=8 generate.py \
|
| 382 |
--tp-dir "$STEP5_FP8_OUT/tp8" --ep-size 8 \
|
| 383 |
--prompt "Please introduce tensor parallelism." \
|
|
|
|
| 389 |
<details>
|
| 390 |
<summary><strong>BF16: Two H200 Nodes, 16 GPUs</strong></summary>
|
| 391 |
|
| 392 |
+
#### BF16: Two H200 Nodes, 16 GPUs
|
| 393 |
+
|
| 394 |
For TP16 / EP16 generation across two nodes, first convert the BF16 checkpoint into 16 shards. Make the resulting `tp16/` and `tokenizer_files/` directories accessible to both nodes:
|
| 395 |
|
| 396 |
```bash
|
| 397 |
export STEP5_BF16_CHECKPOINT="<BF16_CHECKPOINT_DIRECTORY>"
|
| 398 |
export STEP5_BF16_OUT="<BF16_SHARD_OUTPUT_DIRECTORY>"
|
| 399 |
+
|
| 400 |
python3 convert.py \
|
| 401 |
--checkpoint "$STEP5_BF16_CHECKPOINT" \
|
| 402 |
--tp-size 16 --ep-size 16 --check-only
|
| 403 |
+
|
| 404 |
python3 convert.py \
|
| 405 |
--checkpoint "$STEP5_BF16_CHECKPOINT" \
|
| 406 |
--out-dir "$STEP5_BF16_OUT" \
|
|
|
|
| 414 |
export MASTER_ADDR="<NODE_0_REACHABLE_IP_OR_HOSTNAME>"
|
| 415 |
export MASTER_PORT=29500
|
| 416 |
export NODE_RANK=0 # Set to 1 on node 1.
|
| 417 |
+
|
| 418 |
torchrun --nnodes=2 --nproc-per-node=8 \
|
| 419 |
--node-rank="$NODE_RANK" \
|
| 420 |
--master-addr="$MASTER_ADDR" \
|
|
|
|
| 435 |
|
| 436 |
#### Environment Setup
|
| 437 |
|
| 438 |
+
Pull the Step 5 Preview SGLang Docker image:
|
| 439 |
|
| 440 |
```bash
|
| 441 |
+
docker pull lmsysorg/sglang:step-5-preview
|
| 442 |
```
|
| 443 |
|
| 444 |
+
Then, launch the server using the configuration for your hardware.
|
| 445 |
|
| 446 |
<details>
|
| 447 |
+
<summary><strong>B300: Low latency (4 GPUs, TP4/EP1)</strong></summary>
|
| 448 |
+
|
| 449 |
+
#### B300: Low latency (4 GPUs, TP4/EP1)
|
| 450 |
|
| 451 |
+
For single-user chat and latency-sensitive serving.
|
| 452 |
|
| 453 |
```bash
|
| 454 |
+
export CUDA_VISIBLE_DEVICES=0,1,2,3
|
| 455 |
+
|
| 456 |
python -m sglang.launch_server \
|
| 457 |
+
--trust-remote-code \
|
| 458 |
+
--model-path stepfun-ai/Step-5-Preview \
|
| 459 |
+
--served-model-name step5 \
|
| 460 |
+
--tp 4 \
|
| 461 |
+
--ep-size 1 \
|
| 462 |
--moe-runner-backend flashinfer_trtllm \
|
| 463 |
+
--attention-backend fa4 \
|
| 464 |
+
--page-size 64 \
|
| 465 |
+
--kv-cache-dtype bfloat16 \
|
| 466 |
+
--mem-fraction-static 0.9 \
|
| 467 |
+
--swa-full-tokens-ratio 0.03 \
|
| 468 |
--chunked-prefill-size 16384 \
|
| 469 |
+
--max-running-requests 64 \
|
| 470 |
+
--cuda-graph-backend-prefill breakable \
|
| 471 |
+
--flashinfer-allreduce-fusion-backend trtllm \
|
| 472 |
+
--speculative-algorithm EAGLE \
|
| 473 |
+
--speculative-num-steps 3 \
|
| 474 |
+
--speculative-eagle-topk 1 \
|
| 475 |
+
--speculative-num-draft-tokens 4 \
|
| 476 |
+
--enable-multi-layer-eagle \
|
| 477 |
+
--reasoning-parser step3p5 \
|
| 478 |
+
--tool-call-parser step3p5 \
|
| 479 |
+
--host 0.0.0.0 \
|
| 480 |
+
--port 30000
|
| 481 |
+
```
|
| 482 |
+
|
| 483 |
+
</details>
|
| 484 |
+
|
| 485 |
+
<details>
|
| 486 |
+
<summary><strong>B300: Balanced (4 GPUs, TP4/EP1)</strong></summary>
|
| 487 |
+
|
| 488 |
+
#### B300: Balanced (4 GPUs, TP4/EP1)
|
| 489 |
+
|
| 490 |
+
For serving several users concurrently with MegaMoE.
|
| 491 |
+
|
| 492 |
+
```bash
|
| 493 |
+
export CUDA_VISIBLE_DEVICES=0,1,2,3
|
| 494 |
+
|
| 495 |
+
python -m sglang.launch_server \
|
| 496 |
+
--trust-remote-code \
|
| 497 |
+
--model-path stepfun-ai/Step-5-Preview \
|
| 498 |
+
--served-model-name step5 \
|
| 499 |
+
--tp 4 \
|
| 500 |
+
--ep-size 1 \
|
| 501 |
+
--moe-a2a-backend megamoe \
|
| 502 |
+
--attention-backend fa4 \
|
| 503 |
+
--page-size 64 \
|
| 504 |
+
--kv-cache-dtype bfloat16 \
|
| 505 |
+
--mem-fraction-static 0.9 \
|
| 506 |
+
--swa-full-tokens-ratio 0.03 \
|
| 507 |
+
--chunked-prefill-size 16384 \
|
| 508 |
+
--max-running-requests 64 \
|
| 509 |
+
--cuda-graph-backend-prefill breakable \
|
| 510 |
+
--flashinfer-allreduce-fusion-backend trtllm \
|
| 511 |
+
--speculative-algorithm EAGLE \
|
| 512 |
+
--speculative-num-steps 3 \
|
| 513 |
+
--speculative-eagle-topk 1 \
|
| 514 |
+
--speculative-num-draft-tokens 4 \
|
| 515 |
+
--enable-multi-layer-eagle \
|
| 516 |
+
--reasoning-parser step3p5 \
|
| 517 |
+
--tool-call-parser step3p5 \
|
| 518 |
+
--host 0.0.0.0 \
|
| 519 |
+
--port 30000
|
| 520 |
+
```
|
| 521 |
+
|
| 522 |
+
</details>
|
| 523 |
+
|
| 524 |
+
<details>
|
| 525 |
+
<summary><strong>B300: High throughput (8 GPUs, TP8/Attention DP2/EP8)</strong></summary>
|
| 526 |
+
|
| 527 |
+
#### B300: High throughput (8 GPUs, TP8/Attention DP2/EP8)
|
| 528 |
+
|
| 529 |
+
For batch generation and high-concurrency serving.
|
| 530 |
+
|
| 531 |
+
```bash
|
| 532 |
+
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
|
| 533 |
+
|
| 534 |
+
python -m sglang.launch_server \
|
| 535 |
+
--trust-remote-code \
|
| 536 |
+
--model-path stepfun-ai/Step-5-Preview \
|
| 537 |
+
--served-model-name step5 \
|
| 538 |
+
--tp 8 \
|
| 539 |
+
--attn-dp-size 2 \
|
| 540 |
+
--ep-size 8 \
|
| 541 |
+
--moe-runner-backend flashinfer_trtllm \
|
| 542 |
+
--attention-backend fa4 \
|
| 543 |
+
--page-size 64 \
|
| 544 |
+
--kv-cache-dtype bfloat16 \
|
| 545 |
+
--mem-fraction-static 0.9 \
|
| 546 |
+
--swa-full-tokens-ratio 0.03 \
|
| 547 |
+
--chunked-prefill-size 16384 \
|
| 548 |
+
--max-running-requests 64 \
|
| 549 |
+
--cuda-graph-backend-prefill disabled \
|
| 550 |
+
--flashinfer-allreduce-fusion-backend trtllm \
|
| 551 |
+
--speculative-algorithm EAGLE \
|
| 552 |
+
--speculative-num-steps 3 \
|
| 553 |
+
--speculative-eagle-topk 1 \
|
| 554 |
+
--speculative-num-draft-tokens 4 \
|
| 555 |
+
--enable-multi-layer-eagle \
|
| 556 |
+
--reasoning-parser step3p5 \
|
| 557 |
+
--tool-call-parser step3p5 \
|
| 558 |
+
--host 0.0.0.0 \
|
| 559 |
+
--port 30000
|
| 560 |
+
```
|
| 561 |
+
|
| 562 |
+
</details>
|
| 563 |
+
|
| 564 |
+
<details>
|
| 565 |
+
<summary><strong>H200: Balanced (8 GPUs, TP8/EP8)</strong></summary>
|
| 566 |
+
|
| 567 |
+
#### H200: Balanced (8 GPUs, TP8/EP8)
|
| 568 |
+
|
| 569 |
+
For single-node H200 serving with Triton MoE and FA3 attention.
|
| 570 |
+
|
| 571 |
+
```bash
|
| 572 |
+
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
|
| 573 |
+
|
| 574 |
+
python -m sglang.launch_server \
|
| 575 |
+
--trust-remote-code \
|
| 576 |
+
--model-path stepfun-ai/Step-5-Preview \
|
| 577 |
+
--served-model-name step5 \
|
| 578 |
+
--tp 8 \
|
| 579 |
+
--ep-size 8 \
|
| 580 |
+
--moe-runner-backend triton \
|
| 581 |
+
--attention-backend fa3 \
|
| 582 |
+
--page-size 64 \
|
| 583 |
+
--kv-cache-dtype bfloat16 \
|
| 584 |
+
--mem-fraction-static 0.9 \
|
| 585 |
+
--swa-full-tokens-ratio 0.03 \
|
| 586 |
+
--chunked-prefill-size 16384 \
|
| 587 |
+
--max-running-requests 64 \
|
| 588 |
+
--cuda-graph-backend-prefill breakable \
|
| 589 |
+
--flashinfer-allreduce-fusion-backend trtllm \
|
| 590 |
+
--speculative-algorithm EAGLE \
|
| 591 |
+
--speculative-num-steps 3 \
|
| 592 |
+
--speculative-eagle-topk 1 \
|
| 593 |
+
--speculative-num-draft-tokens 4 \
|
| 594 |
+
--enable-multi-layer-eagle \
|
| 595 |
+
--reasoning-parser step3p5 \
|
| 596 |
+
--tool-call-parser step3p5 \
|
| 597 |
+
--host 0.0.0.0 \
|
| 598 |
+
--port 30000
|
| 599 |
```
|
| 600 |
|
| 601 |
</details>
|
| 602 |
|
| 603 |
### Send a Request
|
| 604 |
|
| 605 |
+
Once the server is ready, use the base URL for your deployment:
|
| 606 |
|
| 607 |
| Serving configuration | Base URL on the server host |
|
| 608 |
| --- | --- |
|
| 609 |
+
| vLLM FP8 | `http://localhost:18000` |
|
| 610 |
| vLLM BF16 | `http://localhost:18000` (node 0) |
|
| 611 |
| SGLang FP8 | `http://localhost:30000` |
|
| 612 |
|
| 613 |
The example below targets vLLM FP8:
|
| 614 |
|
| 615 |
```bash
|
| 616 |
+
curl http://127.0.0.1:18000/v1/chat/completions \
|
| 617 |
+
--header 'Content-Type: application/json' \
|
| 618 |
+
--data '{
|
| 619 |
+
"model": "step5",
|
| 620 |
+
"messages": [{"role": "user", "content": "Hello!"}],
|
| 621 |
+
"max_tokens": 4096,
|
| 622 |
+
"stream": true
|
| 623 |
+
}'
|
|
|
|
| 624 |
```
|
| 625 |
|
| 626 |
## Resources
|
|
|
|
| 628 |
- [Step 5 Preview Model Page](https://www.stepfun.com/step-5-preview) — Model overview, evaluation context, and long-horizon case studies.
|
| 629 |
- [Documentation](https://platform.stepfun.ai/docs/en/guides/models/step-5-preview) — Official documentation and developer guides.
|
| 630 |
- [API Platform](https://platform.stepfun.ai/) — Model access and platform services.
|
| 631 |
+
- [StepFun Website](https://www.stepfun.com/) — Company information and model announcements.
|
| 632 |
+
|
| 633 |
+
## License
|
| 634 |
+
|
| 635 |
+
This model, including its weights, parameters, configuration, tokenizer, model-specific code, and documentation, is licensed under the StepFun Model License 1.0. The full text of the License is available in the [LICENSE](LICENSE) file in this repository. The StepFun Model License 1.0 is an Apache-2.0-Style license, with additional attribution and commercial-license conditions specific to model use, modification and distribution.
|
| 636 |
+
|
| 637 |
+
Where accompanying materials in this repository, including sample code, datasets, third-party components and other documentation, are separately marked as subject to a different license, such materials are licensed under that license.
|