CoolFace
Modelpublic

z-lab/Qwen3.5-27B-DFlash

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
113likes4.3kdownloads
Model Card

Qwen3.5-27B-DFlash

Paper | Github | Blog

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.

<div align="center"> <img src="assets/dflash_system.png" alt="DFlash Architecture" width="85%"> </div>

Quick Start

Installation

SGLang

Install a recent SGLang build with DFlash support:

bash
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.

vLLM

For vLLM support, please refer to vllm-project/vllm#40898. We will update the PR to make it merge-ready soon.

Launch Server

This model should be used with an inference server that supports DFlash speculative decoding. An example SGLang deployment is:

bash
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.

Benchmark Results

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.

Setup

  • Runtime: SGLang on 1x NVIDIA B200 GPU, tensor parallel size 1, bfloat16
  • Backends: trtllm_mha target attention, fa4 DFlash draft attention, flashinfer linear-attention prefill and decode
  • Workloads: GSM8K, MATH500, HumanEval, MBPP, and MT-Bench with the Qwen chat template
  • Decoding: greedy, thinking enabled, max output length 4096 tokens
  • Measurement: 5 independent runs per configuration at concurrency 1 and 32 with continuous batching
  • Throughput: generated output tokens / wall-clock benchmark time, including prefill and scheduling
  • Accept length: completion_tokens / spec_verify_ct per generation turn, averaged across generation turns

Throughput and Speedup

Each cell is output tok/s (speedup). Bold marks the fastest speculative configuration in each row.

Concurrency 1
WorkloadBaselineMTP steps=3DFlash block=4MTP steps=7DFlash block=8MTP steps=15DFlash block=16
gsm8k92.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)
math50092.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)
humaneval92.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)
mbpp92.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-bench93.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)
Concurrency 32
WorkloadBaselineMTP steps=3DFlash block=4MTP steps=7DFlash block=8MTP steps=15DFlash block=16
gsm8k2094.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)
math5002123.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)
humaneval1972.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)
mbpp2081.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-bench2020.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)

Accept Length

Mean accept length at concurrency 1. Bold marks the higher value in each matched MTP/DFlash pair.

WorkloadMTP steps=3DFlash block=4MTP steps=7DFlash block=8MTP steps=15DFlash block=16
gsm8k3.5543.5295.5485.6446.8767.507
math5003.6203.6115.7165.9677.1238.221
humaneval3.5843.6575.6346.1777.0658.904
mbpp3.4563.5585.1285.7095.9137.567
mt-bench3.2533.2184.5694.6275.2935.618

Citation

If you find DFlash useful, please cite the original paper:

bibtex
@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}
}