Loading…
Loading…
This model is still under training, and inference engine support may not be fully available yet due to architectural changes, including causal SWA layers.
DFlash is a novel speculative decoding method that utilizes a lightweight block diffusion model for drafting. It enables efficient, high-quality parallel drafting that pushes the limits of inference speed.
This model is the drafter component. It must be used in conjunction with the target model Qwen/Qwen3.6-27B.
vLLM (We temporarily modify the installation through this PR to support interleaved SWA and ensure correct handling of target hidden states for optimal performance):
uv pip install vllm
uv pip install -U --torch-backend=auto "vllm @ git+https://github.com/vllm-project/vllm.git@refs/pull/40898/head"
SGLang:
uv pip install "git+https://github.com/sgl-project/sglang.git@refs/pull/23000/head#subdirectory=python"
vLLM:
vllm serve Qwen/Qwen3.6-27B \
--speculative-config '{"method": "dflash", "model": "z-lab/Qwen3.6-27B-DFlash", "num_speculative_tokens": 15}' \
--attention-backend flash_attn \
--max-num-batched-tokens 32768
SGLang:
# Optional: enable schedule overlapping (experimental, may not be stable)
# export SGLANG_ENABLE_SPEC_V2=1
# export SGLANG_ENABLE_DFLASH_SPEC_V2=1
# export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1
python -m sglang.launch_server \
--model-path Qwen/Qwen3.6-27B \
--speculative-algorithm DFLASH \
--speculative-draft-model-path z-lab/Qwen3.6-27B-DFlash \
--speculative-num-draft-tokens 16 \
--tp-size 1 \
--attention-backend fa3 \
--mem-fraction-static 0.75 \
--mamba-scheduler-strategy extra_buffer \
--trust-remote-code
from openai import OpenAI
client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")
response = client.chat.completions.create(
model="Qwen/Qwen3.6-27B",
messages=[{"role": "user", "content": "Write a quicksort in Python."}],
max_tokens=4096,
temperature=0.0
)
print(response.choices[0].message.content)
N/A
Special thanks to David Wang for his outstanding engineering support on this project. We are also grateful to Modal, InnoMatrix, and Yotta Labs for providing the compute resources used to train this draft model.
If you find DFlash useful, please cite our work. To share feedback on DFlash or request new model support, please fill out this form: DFlash Feedback.
@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}
}
build/test_dflash Qwen3.6-27B-Q4_K_M.gguf z-lab/Qwen3.6-27B-DFlash --fast-rollback --ddtree --ddtree-budget=22 --max-ctx=1024 (rebuild for sm_120: cmake -DCMAKE_CUDA_ARCHITECTURES=120 -DGGML_CUDA_GRAPHS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.9/bin/nvcc -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/gcc-12)View run on LocalMaxxing
vllm serve /home/spark/models/Qwen3.6-27B-FP8 \
--host 0.0.0.0 \
--port 8085 \
--served-model-name Qwen3.6-27B \
--max-model-len 68536\
--max-num-seqs 4 \
--max-num-batched-tokens 32000 \
--gpu-memory-utilization 0.45 \
--enable-prefix-caching \
--enable-chunked-prefill \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder \
--reasoning-parser qwen3 \
--trust-remote-code \
--dtype auto \
--attention-backend FLASH_ATTN \
--speculative-config '{"method":"dflash","model":"/home/spark/models/Qwen3.6-27B-DFlash","num_speculative_tokens":15}' \
--default-chat-template-kwargs '{"enable_thinking": false}' \
--override-generation-config '{"temperature": 0.6, "top_p": 0.95, "top_k": 20}'View run on LocalMaxxing ONEAPI_DEVICE_SELECTOR=level_zero:0,1,2 GGML_SYCL_DISABLE_GRAPH=0 GGML_SYCL_DISABLE_DNN=1 GGML_SYCL_DISABLE_OPT=0 GGML_SYCL_PRIORITIZE_DMMV=0 GGML_SYCL_ASYNC_PEER_COPY=0 GGML_SYCL_ASYNC_CPY_TENSOR=1 GGML_SYCL_COMM_ALLREDUCE=1 GGML_SYCL_COMM_SINGLE_KERNEL=1 /home/steve/src/llama.cpp-q4-b70/build-sycl-2026-bmg-g31/bin/llama-bench -m /home/steve/models/qwen3.6-27b-q4_0-gguf/Qwen3.6-27B-Q4_0.gguf --prio 0 -dev SYCL0/SYCL1/SYCL2 -ngl 99 -p 0 -n 512 -sm tensor -ts 1/1/1 -b 512 -ub 32 -ctk f16 -ctv f16 -t 8 --poll 50 -fa 1 -r 3 -o jsonlView run on LocalMaxxing
ONEAPI_DEVICE_SELECTOR=level_zero:0,3 GGML_SYCL_DISABLE_GRAPH=0 GGML_SYCL_DISABLE_DNN=1 GGML_SYCL_DISABLE_OPT=0 GGML_SYCL_PRIORITIZE_DMMV=0 GGML_SYCL_ASYNC_PEER_COPY=0 GGML_SYCL_ASYNC_CPY_TENSOR=1 /home/steve/src/llama.cpp-q4-b70/build-sycl-2026-bmg-g31/bin/llama-bench -m /home/steve/models/qwen3.6-27b-q4_0-gguf/Qwen3.6-27B-Q4_0.gguf --prio 0 -dev SYCL0/SYCL1 -ngl 99 -p 0 -n 512 -sm tensor -ts 1/1 -b 512 -ub 64 -ctk f16 -ctv f16 -t 8 --poll 50 -fa 1 -r 3 -o jsonlView run on LocalMaxxing
ONEAPI_DEVICE_SELECTOR=level_zero:0,1,2,3 GGML_SYCL_DISABLE_GRAPH=0 GGML_SYCL_DISABLE_DNN=1 GGML_SYCL_DISABLE_OPT=0 GGML_SYCL_PRIORITIZE_DMMV=0 GGML_SYCL_ASYNC_PEER_COPY=0 GGML_SYCL_ASYNC_CPY_TENSOR=1 GGML_SYCL_COMM_ALLREDUCE=1 GGML_SYCL_COMM_SINGLE_KERNEL=1 /home/steve/src/llama.cpp-q4-b70/build-sycl-2026-bmg-g31/bin/llama-bench -m /home/steve/models/qwen3.6-27b-q4_0-gguf/Qwen3.6-27B-Q4_0.gguf --prio 0 -dev SYCL0/SYCL1/SYCL2/SYCL3 -ngl 99 -p 0 -n 512 -sm tensor -ts 1/1/1/1 -b 512 -ub 32 -ctk f16 -ctv f16 -t 8 --poll 50 -fa 1 -r 1 -o jsonlView run on LocalMaxxing
Median of 10 community runs on 5 setups, from LocalMaxxing.
Run it yourself: setup guide