112
stars
44
commits
5
repos using this model
4
linked in READMEs
Jun 19, 2026
updated
This DFlash draft model is a joint retrain from Z-Lab and Modal, trained with 40k sequence length and sliding-window attention for improved long-context performance. It is mirrored across the following Hugging Face repositories:
This repository contains a DFlash draft model for Qwen/Qwen3.5-27B. It is not a standalone language model. It is intended to be paired with the target model in a speculative decoding server.
DFlash uses a lightweight block diffusion draft model to propose multiple tokens in parallel. The target model verifies those proposals, improving serving throughput while preserving the target model's output distribution.
Install a recent SGLang build with DFlash support:
uv pip install --upgrade "sglang[all]"
For best performance on Blackwell GPUs, use an SGLang build that includes DFlash, FA4/TRT-LLM attention, and FlashInfer support.
For vLLM support, please refer to vllm-project/vllm#40898. We will update the PR to make it merge-ready soon.
This model should be used with an inference server that supports DFlash speculative decoding. An example SGLang deployment is:
export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1
python -m sglang.launch_server \
--model-path Qwen/Qwen3.5-27B \
--trust-remote-code \
--speculative-algorithm DFLASH \
--speculative-draft-model-path z-lab/Qwen3.5-27B-DFlash \
--speculative-dflash-block-size 8 \
--speculative-draft-attention-backend fa4 \
--attention-backend trtllm_mha \
--linear-attn-prefill-backend flashinfer \
--linear-attn-decode-backend flashinfer \
--mamba-scheduler-strategy extra_buffer \
--tp-size 1 \
--max-running-requests 32 \
--cuda-graph-max-bs-decode 32 \
--cuda-graph-backend-prefill tc_piecewise \
--enable-flashinfer-allreduce-fusion \
--mem-fraction-static 0.8 \
--host 0.0.0.0 \
--port 30000
Block size 8 is the recommended default for higher-concurrency serving. Block size 16 gives longer accept lengths and strong concurrency-1 throughput in most workloads.
We benchmarked DFlash against the autoregressive baseline and Qwen's built-in MTP draft path. DFlash reaches up to 6.20x speedup at concurrency 1 and 3.01x at concurrency 32. Across the benchmark suite, DFlash delivers higher throughput than MTP at every matched setting where both completed.
bfloat16trtllm_mha target attention, fa4 DFlash draft attention, flashinfer linear-attention prefill and decodecompletion_tokens / spec_verify_ct per generation turn, averaged across generation turnsEach cell is output tok/s (speedup). Bold marks the fastest speculative configuration in each row.
| Workload | Baseline | MTP steps=3 | DFlash block=4 | MTP steps=7 | DFlash block=8 | MTP steps=15 | DFlash block=16 |
|---|---|---|---|---|---|---|---|
| gsm8k | 92.8 (1.00x) | 250.0 (2.70x) | 262.7 (2.83x) | 306.7 (3.31x) | 393.6 (4.24x) | 269.0 (2.90x) | 460.5 (4.96x) |
| math500 | 92.9 (1.00x) | 259.6 (2.80x) | 275.5 (2.97x) | 332.6 (3.58x) | 434.9 (4.68x) | 296.9 (3.20x) | 550.5 (5.93x) |
| humaneval | 92.4 (1.00x) | 252.6 (2.73x) | 273.6 (2.96x) | 320.6 (3.47x) | 440.0 (4.76x) | 289.2 (3.13x) | 572.4 (6.20x) |
| mbpp | 92.9 (1.00x) | 244.5 (2.63x) | 269.4 (2.90x) | 298.4 (3.21x) | 413.8 (4.45x) | 245.4 (2.64x) | 495.3 (5.33x) |
| mt-bench | 93.0 (1.00x) | 228.5 (2.46x) | 239.6 (2.58x) | 254.8 (2.74x) | 323.3 (3.48x) | 210.0 (2.26x) | 350.2 (3.77x) |
| Workload | Baseline | MTP steps=3 | DFlash block=4 | MTP steps=7 | DFlash block=8 | MTP steps=15 | DFlash block=16 |
|---|---|---|---|---|---|---|---|
| gsm8k | 2094.6 (1.00x) | 4652.7 (2.22x) | 4987.3 (2.38x) | 4821.9 (2.30x) | 5643.8 (2.69x) | 3161.8 (1.51x) | 4108.4 (1.96x) |
| math500 | 2123.6 (1.00x) | 4972.4 (2.34x) | 5270.3 (2.48x) | 5345.8 (2.52x) | 6339.6 (2.99x) | 3577.1 (1.68x) | 4990.8 (2.35x) |
| humaneval | 1972.2 (1.00x) | 4253.9 (2.16x) | 4821.1 (2.44x) | 4581.8 (2.32x) | 5928.1 (3.01x) | 3178.7 (1.61x) | 4866.3 (2.47x) |
| mbpp | 2081.1 (1.00x) | 4320.8 (2.08x) | 4945.9 (2.38x) | 4149.0 (1.99x) | 5478.8 (2.63x) | 2743.3 (1.32x) | 4191.0 (2.01x) |
| mt-bench | 2020.9 (1.00x) | 4001.9 (1.98x) | 4207.2 (2.08x) | 3827.4 (1.89x) | 4323.2 (2.14x) | 2427.1 (1.20x) | 2967.1 (1.47x) |
Mean accept length at concurrency 1. Bold marks the higher value in each matched MTP/DFlash pair.
| Workload | MTP steps=3 | DFlash block=4 | MTP steps=7 | DFlash block=8 | MTP steps=15 | DFlash block=16 |
|---|---|---|---|---|---|---|
| gsm8k | 3.554 | 3.529 | 5.548 | 5.644 | 6.876 | 7.507 |
| math500 | 3.620 | 3.611 | 5.716 | 5.967 | 7.123 | 8.221 |
| humaneval | 3.584 | 3.657 | 5.634 | 6.177 | 7.065 | 8.904 |
| mbpp | 3.456 | 3.558 | 5.128 | 5.709 | 5.913 | 7.567 |
| mt-bench | 3.253 | 3.218 | 4.569 | 4.627 | 5.293 | 5.618 |
If you find DFlash useful, please cite the original paper:
@article{chen2026dflash,
title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
journal = {arXiv preprint arXiv:2602.06036},
year = {2026}
}
44 commits
112
stars
44
commits
5
repos using this model
4
linked in READMEs
Jun 19, 2026
updated
This DFlash draft model is a joint retrain from Z-Lab and Modal, trained with 40k sequence length and sliding-window attention for improved long-context performance. It is mirrored across the following Hugging Face repositories:
This repository contains a DFlash draft model for Qwen/Qwen3.5-27B. It is not a standalone language model. It is intended to be paired with the target model in a speculative decoding server.
DFlash uses a lightweight block diffusion draft model to propose multiple tokens in parallel. The target model verifies those proposals, improving serving throughput while preserving the target model's output distribution.
Install a recent SGLang build with DFlash support:
uv pip install --upgrade "sglang[all]"
For best performance on Blackwell GPUs, use an SGLang build that includes DFlash, FA4/TRT-LLM attention, and FlashInfer support.
For vLLM support, please refer to vllm-project/vllm#40898. We will update the PR to make it merge-ready soon.
This model should be used with an inference server that supports DFlash speculative decoding. An example SGLang deployment is:
export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1
python -m sglang.launch_server \
--model-path Qwen/Qwen3.5-27B \
--trust-remote-code \
--speculative-algorithm DFLASH \
--speculative-draft-model-path z-lab/Qwen3.5-27B-DFlash \
--speculative-dflash-block-size 8 \
--speculative-draft-attention-backend fa4 \
--attention-backend trtllm_mha \
--linear-attn-prefill-backend flashinfer \
--linear-attn-decode-backend flashinfer \
--mamba-scheduler-strategy extra_buffer \
--tp-size 1 \
--max-running-requests 32 \
--cuda-graph-max-bs-decode 32 \
--cuda-graph-backend-prefill tc_piecewise \
--enable-flashinfer-allreduce-fusion \
--mem-fraction-static 0.8 \
--host 0.0.0.0 \
--port 30000
Block size 8 is the recommended default for higher-concurrency serving. Block size 16 gives longer accept lengths and strong concurrency-1 throughput in most workloads.
We benchmarked DFlash against the autoregressive baseline and Qwen's built-in MTP draft path. DFlash reaches up to 6.20x speedup at concurrency 1 and 3.01x at concurrency 32. Across the benchmark suite, DFlash delivers higher throughput than MTP at every matched setting where both completed.
bfloat16trtllm_mha target attention, fa4 DFlash draft attention, flashinfer linear-attention prefill and decodecompletion_tokens / spec_verify_ct per generation turn, averaged across generation turnsEach cell is output tok/s (speedup). Bold marks the fastest speculative configuration in each row.
| Workload | Baseline | MTP steps=3 | DFlash block=4 | MTP steps=7 | DFlash block=8 | MTP steps=15 | DFlash block=16 |
|---|---|---|---|---|---|---|---|
| gsm8k | 92.8 (1.00x) | 250.0 (2.70x) | 262.7 (2.83x) | 306.7 (3.31x) | 393.6 (4.24x) | 269.0 (2.90x) | 460.5 (4.96x) |
| math500 | 92.9 (1.00x) | 259.6 (2.80x) | 275.5 (2.97x) | 332.6 (3.58x) | 434.9 (4.68x) | 296.9 (3.20x) | 550.5 (5.93x) |
| humaneval | 92.4 (1.00x) | 252.6 (2.73x) | 273.6 (2.96x) | 320.6 (3.47x) | 440.0 (4.76x) | 289.2 (3.13x) | 572.4 (6.20x) |
| mbpp | 92.9 (1.00x) | 244.5 (2.63x) | 269.4 (2.90x) | 298.4 (3.21x) | 413.8 (4.45x) | 245.4 (2.64x) | 495.3 (5.33x) |
| mt-bench | 93.0 (1.00x) | 228.5 (2.46x) | 239.6 (2.58x) | 254.8 (2.74x) | 323.3 (3.48x) | 210.0 (2.26x) | 350.2 (3.77x) |
| Workload | Baseline | MTP steps=3 | DFlash block=4 | MTP steps=7 | DFlash block=8 | MTP steps=15 | DFlash block=16 |
|---|---|---|---|---|---|---|---|
| gsm8k | 2094.6 (1.00x) | 4652.7 (2.22x) | 4987.3 (2.38x) | 4821.9 (2.30x) | 5643.8 (2.69x) | 3161.8 (1.51x) | 4108.4 (1.96x) |
| math500 | 2123.6 (1.00x) | 4972.4 (2.34x) | 5270.3 (2.48x) | 5345.8 (2.52x) | 6339.6 (2.99x) | 3577.1 (1.68x) | 4990.8 (2.35x) |
| humaneval | 1972.2 (1.00x) | 4253.9 (2.16x) | 4821.1 (2.44x) | 4581.8 (2.32x) | 5928.1 (3.01x) | 3178.7 (1.61x) | 4866.3 (2.47x) |
| mbpp | 2081.1 (1.00x) | 4320.8 (2.08x) | 4945.9 (2.38x) | 4149.0 (1.99x) | 5478.8 (2.63x) | 2743.3 (1.32x) | 4191.0 (2.01x) |
| mt-bench | 2020.9 (1.00x) | 4001.9 (1.98x) | 4207.2 (2.08x) | 3827.4 (1.89x) | 4323.2 (2.14x) | 2427.1 (1.20x) | 2967.1 (1.47x) |
Mean accept length at concurrency 1. Bold marks the higher value in each matched MTP/DFlash pair.
| Workload | MTP steps=3 | DFlash block=4 | MTP steps=7 | DFlash block=8 | MTP steps=15 | DFlash block=16 |
|---|---|---|---|---|---|---|
| gsm8k | 3.554 | 3.529 | 5.548 | 5.644 | 6.876 | 7.507 |
| math500 | 3.620 | 3.611 | 5.716 | 5.967 | 7.123 | 8.221 |
| humaneval | 3.584 | 3.657 | 5.634 | 6.177 | 7.065 | 8.904 |
| mbpp | 3.456 | 3.558 | 5.128 | 5.709 | 5.913 | 7.567 |
| mt-bench | 3.253 | 3.218 | 4.569 | 4.627 | 5.293 | 5.618 |
If you find DFlash useful, please cite the original paper:
@article{chen2026dflash,
title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
journal = {arXiv preprint arXiv:2602.06036},
year = {2026}
}
44 commits