Update SGLang quickstart to the official SGLang cookbook recipe

#6
by JustinTong - opened
Files changed (1) hide show
  1. README.md +29 -38
README.md CHANGED
@@ -76,71 +76,62 @@ We evaluate the quantized models using several datasets. The FP8 quantized model
76
 
77
 
78
  ## Quickstart
79
- ### SGlang
80
- #### Install our SGLang
81
- ```bash
82
- pip install uv
83
 
84
- uv venv ~/my_ling_env
85
-
86
- source ~/my_ling_env/bin/activate
87
 
88
- git clone -b ling_v3_support https://github.com/inclusionAI/sglang_ling_v3.git
89
 
90
- cd sglang_ling_v3
91
 
92
- pip install --upgrade pip
93
 
94
- pip install -e "python"
 
95
  ```
96
 
97
  #### Run Inference
98
- Here is an example to run Ling-3.0-flash with 4 GPUs, where the master node IP is `${MASTER_IP}` and server port is `${PORT}`:
99
-
100
- **Server**
101
 
102
- Since the model is trained with MTP, we recommend enabling MTP during inference (i.e., --speculative-algorithm NEXTN) for lower latency.
103
 
104
  ```bash
105
- export SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1
106
- export SGLANG_JIT_DEEPGEMM_PRECOMPILE=1
107
- export SGLANG_ENABLE_SPEC_V2=1
108
- python -m sglang.launch_server \
109
- --model-path $MODEL_PATH \
110
- --dist-init-addr $MASTER_IP:2345 \
111
- --port $PORT \
112
- --nnodes 1 \
113
- --mem-fraction-static 0.8 \
114
- --max-running-requests 32 \
115
- --tp-size 2 \
116
- --chunked-prefill-size 8192 \
117
- --allow-auto-truncate \
118
- --tool-call-parser ling3 \
119
- --reasoning-parser ling3 \
120
  --context-length 262144 \
121
  --speculative-algorithm NEXTN \
122
- --max-mamba-cache-size 160 \
123
- --enable-fp32-lm-head \
124
- --disable-shared-experts-fusion
 
125
  ```
126
 
 
 
127
  **Client**
128
 
129
- We recommend using the sampling parameters `temperature=0.6`, `top_p=0.95`, and `top_k=20`, and enabling `enable_thinking` for better performance.
130
 
131
  ```bash
132
- curl -s http://${MASTER_IP}:${PORT}/v1/chat/completions \
133
  -H "Content-Type: application/json" \
134
- -d '{"model": "auto",
135
  "messages": [{"role": "user", "content": "hello!"}],
136
- "chat_template_kwargs": {"enable_thinking": true},
137
  "stream": true,
138
- "temperature": 0.6,
139
  "top_k": 20,
140
  "top_p": 0.95
141
  }'
142
  ```
143
 
 
 
144
  ### vLLM
145
  #### Install our vLLM
146
  ```bash
 
76
 
77
 
78
  ## Quickstart
79
+ ### SGLang
 
 
 
80
 
81
+ The hardware- and recipe-specific launch matrix (BF16/FP8 × Low-Latency / High-Throughput / HiCache + Mooncake), with a live command generator and verified configurations, lives in the SGLang cookbook:
 
 
82
 
83
+ **Cookbook:** https://docs.sglang.io/cookbook/autoregressive/InclusionAI/Ling-3.0-flash
84
 
85
+ #### Install SGLang
86
 
87
+ Use the pre-built image that tracks the Ling-3.0 runtime:
88
 
89
+ ```bash
90
+ docker pull lmsysorg/sglang:dev-Ling-3.0-flash
91
  ```
92
 
93
  #### Run Inference
 
 
 
94
 
95
+ Recommended low-latency recipe for the FP8 checkpoint (built-in MTP / NEXTN, 256K YaRN context) on 141GB-class GPUs (H20-3e / H200) or 4-GPU Blackwell nodes (B200 / GB300). The checkpoint uses blockwise (128×128) E4M3 expert weights, so the FP8 recipes pair TP with expert parallelism; SGLang detects the quantization format from the checkpoint's `quantization_config`, so no explicit quantization flag is needed:
96
 
97
  ```bash
98
+ docker run --rm --gpus all --ipc=host --shm-size 32g \
99
+ -p 30000:30000 \
100
+ -e HF_TOKEN=<your-hf-token> \
101
+ lmsysorg/sglang:dev-Ling-3.0-flash \
102
+ env SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 \
103
+ python3 -m sglang.launch_server \
104
+ --model-path inclusionAI/Ling-3.0-flash-fp8 \
105
+ --tp 4 \
106
+ --ep-size 4 \
 
 
 
 
 
 
107
  --context-length 262144 \
108
  --speculative-algorithm NEXTN \
109
+ --json-model-override-args '{"rope_scaling":{"rope_type":"yarn","factor":2.0,"rope_theta":6000000,"partial_rotary_factor":0.5,"original_max_position_embeddings":131072}}' \
110
+ --mem-fraction-static 0.8 \
111
+ --host 0.0.0.0 \
112
+ --port 30000
113
  ```
114
 
115
+ On H100 / H800 use `--tp 8 --ep-size 8` with the same flags; see the cookbook cell for your hardware.
116
+
117
  **Client**
118
 
119
+ Thinking is enabled by default by both the chat template and the `ling3` reasoning parser. Disable it per request with `"chat_template_kwargs": {"enable_thinking": false}`. We recommend the sampling parameters `temperature=0.6`, `top_p=0.95`, and `top_k=20`.
120
 
121
  ```bash
122
+ curl -s http://localhost:30000/v1/chat/completions \
123
  -H "Content-Type: application/json" \
124
+ -d '{"model": "inclusionAI/Ling-3.0-flash-fp8",
125
  "messages": [{"role": "user", "content": "hello!"}],
 
126
  "stream": true,
127
+ "temperature": 0.6,
128
  "top_k": 20,
129
  "top_p": 0.95
130
  }'
131
  ```
132
 
133
+ For `--reasoning-parser ling3` / `--tool-call-parser ling3`, the HiCache + Mooncake L3 setup, and GSM8K / `bench_serving` reproduction commands, see the cookbook page linked above.
134
+
135
  ### vLLM
136
  #### Install our vLLM
137
  ```bash