Skip to content
payar84Public
forked from z-lab/dflash

About

DFlash: Block Diffusion for Flash Speculative Decoding

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

106 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFlash: Block Diffusion for Flash Speculative Decoding

Paper | Blog | Models

DFlash is a lightweight block diffusion model designed for speculative decoding. It enables efficient and high-quality parallel drafting.

DFlash Architecture

DFlash_demo.mp4

Supported Models

Model DFlash Draft
Kimi-K2.5 (Preview) z-lab/Kimi-K2.5-DFlash
Qwen3.5-4B z-lab/Qwen3.5-4B-DFlash
Qwen3.5-9B z-lab/Qwen3.5-9B-DFlash
Qwen3.5-27B z-lab/Qwen3.5-27B-DFlash
Qwen3.5-35B-A3B z-lab/Qwen3.5-35B-A3B-DFlash
Qwen3-Coder-Next z-lab/Qwen3-Coder-Next-DFlash
Qwen3-Coder-30B-A3B z-lab/Qwen3-Coder-30B-A3B-DFlash
gpt-oss-20b z-lab/gpt-oss-20b-DFlash
gpt-oss-120b z-lab/gpt-oss-120b-DFlash
Qwen3-4B z-lab/Qwen3-4B-DFlash-b16
Qwen3-8B z-lab/Qwen3-8B-DFlash-b16
Llama-3.1-8B-Instruct z-lab/LLaMA3.1-8B-Instruct-DFlash-UltraChat
Qwen3.5-122B-A10B Coming soon
Qwen3.5-397B-A17B Coming soon
GLM-5.1 Coming soon

Feel free to open a GitHub issue to request support for additional models. We will also open-source the training recipe soon, so you can train your own DFlash draft model to accelerate any LLM.

📦 Installation

Use a separate virtual environment for each to avoid conflict.

Backend Install command
Transformers uv pip install -e .
SGLang uv pip install -e ".[sglang]"
vLLM See below

vLLM: DFlash support requires the nightly build:

uv pip install -e ".[vllm]"
uv pip install -U vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly

Note: I've been testing primarily with the vLLM backend on a single A100 80GB. SGLang setup worked fine too but requires the SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 env var or you'll hit context length errors on longer prompts.

🚀 Quick Start

vLLM

vllm serve Qwen/Qwen3.5-27B \
  --speculative-config '{"method": "dflash", "model": "z-lab/Qwen3.5-27B-DFlash", "num_speculative_tokens": 15}' \
  --gpu-memory-utilization 0.9 \
  --max-model-len 8192

Personal note: I've found num_speculative_tokens between 10 and 15 to be the sweet spot on my setup (2x A100 40GB). Going above 15 didn't improve throughput meaningfully and sometimes hurt acceptance rate.

SGLang

SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 python -m sglang.launch_server \
  --model-path Qwen/Qwen3.5-27B \
  --speculative-algorithm dflash \
  --speculative-draft-model-path z-lab/Qwen3.5-27B-DFlash \
  --speculative-num-steps 5 \
  --speculative-eagle-topk 4 \
  --speculative-num-draft-tokens 15

📄 Citation

If you find DFlash useful, please cite:

@article{dflash2025,
  title={DFlash: Block Diffusion for Flash Speculative Decoding},
  year={2025}
}

About

DFlash: Block Diffusion for Flash Speculative Decoding

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages