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-26B-A4B-it \
2 --speculative-config '{"method": "dflash", "model": "z-lab/gemma-4-26B-A4B-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-26B-A4B-it \
8 --speculative-algorithm DFLASH \
9 --speculative-draft-model-path z-lab/gemma-4-26B-A4B-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-26B-A4B-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 | 259 | 925 (3.6x) |
| 8 | 1296 | 4837 (3.7x) | |
| 32 | 3233 | 11435 (3.5x) | |
| GSM8K | 1 | 256 | 825 (3.2x) |
| 8 | 1217 | 4241 (3.5x) | |
| 32 | 3174 | 10306 (3.2x) | |
| HumanEval | 1 | 246 | 818 (3.3x) |
| 8 | 1182 | 4240 (3.6x) | |
| 32 | 2881 | 9150 (3.2x) | |
| MBPP | 1 | 272 | 698 (2.6x) |
| 8 | 1288 | 3387 (2.6x) | |
| 32 | 2950 | 7898 (2.7x) | |
| MT-Bench | 1 | 272 | 492 (1.8x) |
| 8 | 1146 | 2259 (2.0x) | |
| 32 | 2164 | 4829 (2.2x) |
| Task | c1 | c8 | c32 |
|---|---|---|---|
| Math500 | 8.61 | 8.55 | 8.60 |
| GSM8K | 7.71 | 7.76 | 7.72 |
| HumanEval | 7.80 | 7.87 | 7.83 |
| MBPP | 6.09 | 5.99 | 6.03 |
| MT-Bench | 4.33 | 4.33 | 4.24 |
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}