Views
No views yet

1uv pip install -U --torch-backend=auto \
2 "vllm @ git+https://github.com/vllm-project/vllm.git@refs/pull/41703/head"uv pip install "git+https://github.com/sgl-project/sglang.git@refs/pull/23000/head#subdirectory=python"1vllm serve google/gemma-4-31B-it \
2 --speculative-config '{"method": "dflash", "model": "z-lab/gemma-4-31B-it-DFlash", "num_speculative_tokens": 15, "attention_backend": "flash_attn"}' \
3 --attention-backend triton_attn \
4 --max-num-batched-tokens 32768 \
5 --trust-remote-code1# Optional: enable schedule overlapping (experimental, may not be stable)
2# export SGLANG_ENABLE_SPEC_V2=1
3# export SGLANG_ENABLE_DFLASH_SPEC_V2=1
4# export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1
5
6python -m sglang.launch_server \
7 --model-path google/gemma-4-31B-it \
8 --speculative-algorithm DFLASH \
9 --speculative-draft-model-path z-lab/gemma-4-31B-it-DFlash \
10 --speculative-num-draft-tokens 16 \
11 --tp-size 1 \
12 --attention-backend triton \
13 --speculative-draft-attention-backend fa4 \
14 --trust-remote-code8000. For SGLang, use port 30000.1from openai import OpenAI
2
3client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
4
5response = client.chat.completions.create(
6 model="google/gemma-4-31B-it",
7 messages=[{"role": "user", "content": "Write a quicksort in Python."}],
8 max_tokens=4096,
9 temperature=0.0,
10 extra_body={"chat_template_kwargs": {"enable_thinking": True}},
11)
12print(response.choices[0].message.content)| Task | Concurrency | AR | DFlash |
|---|---|---|---|
| Math500 | 1 | 77 | 447 (5.8x) |
| 8 | 511 | 2650 (5.2x) | |
| 32 | 1308 | 4962 (3.8x) | |
| GSM8K | 1 | 78 | 408 (5.3x) |
| 8 | 520 | 2321 (4.5x) | |
| 32 | 1382 | 4447 (3.2x) | |
| HumanEval | 1 | 76 | 420 (5.6x) |
| 8 | 494 | 2389 (4.8x) | |
| 32 | 1145 | 4139 (3.6x) | |
| MBPP | 1 | 79 | 343 (4.4x) |
| 8 | 535 | 2036 (3.8x) | |
| 32 | 1389 | 3636 (2.6x) | |
| MT-Bench | 1 | 79 | 236 (3.0x) |
| 8 | 503 | 1334 (2.7x) | |
| 32 | 1177 | 2257 (1.9x) |
| Task | c1 | c8 | c32 |
|---|---|---|---|
| Math500 | 8.59 | 8.59 | 8.62 |
| GSM8K | 7.53 | 7.50 | 7.52 |
| HumanEval | 8.00 | 7.89 | 7.96 |
| MBPP | 6.13 | 6.13 | 6.14 |
| MT-Bench | 4.23 | 4.19 | 4.19 |
1@article{chen2026dflash,
2 title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
3 author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
4 journal = {arXiv preprint arXiv:2602.06036},
5 year = {2026}
6}