Repository navigation
[Spec] DFlash2: local convolution + candidate selector - #35371
Merged
Merged
Conversation
SubSir
requested review from
BBuf,
DarkSharpness,
Fridge003,
HaiShaw,
HydraQYH,
Qiaolin-Yu,
Ying1123,
celve,
hnyls2002,
ispobock,
merrymercy and
yuan-luo
as code owners
August 18, 2026 19:28
Two additions to the DFlash draft, both switched on by the checkpoint. A DFlash checkpoint declares neither and takes the path it always took. Grouped dynamic depthwise convolution inside each block, so a proposal position can see the ones before it without another backbone pass: out[i,c] = sum_t (base[t,c] + delta[i,t,g(c)]) * x[i-t,c], taps zero across the block boundary. Each sublayer is wrapped in and out from one projection of its input. On when conv_kernel_size and conv_group_size are set. Candidate selector. Instead of an independent argmax per slot, keep the target head's top-K per slot, score adjacent transitions edge(p->c) = <A[p] * project(h), B[c]> + unary[c], and walk the best path from the verified anchor. At T>0 it walks by inverse CDF and returns q over the K candidates for the lossless verify. On when selector_rank and selector_top_k are set. The selector's decode is folded into the draft CUDA graph, greedy and sampled alike. The walk is one Triton program per request: a slot's K scores stay in registers, greedy rows take the argmax and emit a one-hot q, and the slot-to-slot dependency is a loop inside the program rather than a kernel per slot. No new server args, no new env vars, nothing outside DFlash touched. Co-authored-by: Jian Chen <[email protected]>
SubSir
force-pushed
the
subsir/dflash2-selector-conv
branch
from
August 18, 2026 19:46
7a3661b to
6228c78
Compare
Collaborator
CI StatesLatest PR Test (Base): Run #32190273768 |
peterstorm
added a commit
to peterstorm/.dotfiles
that referenced
this pull request
Aug 19, 2026
PR sgl-project/sglang#35371 (DFlash2DraftModel + CandidateSelector + DFlashGroupedConv) merged to SGLang main 2026-08-19T00:07:28Z (c14312a66420b75ca9a11bf1817c4db1fa26b097). No release or nightly carries it yet (v0.5.17 is 08-08; nightly 20260818-c0b6474b predates it), so the pin is a build from the merge commit: * new build-qwen38-dflash2-sglang-image.sh: SGLang's own Dockerfile, stage runtime, nvidia/cuda:13.0.3-cudnn-devel (matches the pinned image's stack), BRANCH_TYPE=remote prebuilt sgl-kernel wheels, post-build probe asserts DFlash2DraftModel/CandidateSelector/ DFlashGroupedConv + reports dspark importability, prints the manifest digest. New tag peterstorm/sglang:qwen38-dflash2-c14312a; the pinned fork image and DSpark profiles are untouched (rollback preserved). * launcher: DFLASH2_IMAGE/DFLASH2_IMAGE_DIGEST overrides + a boot-time capability probe: native DFlash2DraftModel registration serves the canonical tree as-is (no surgery copy); pre-merge images keep the existing isolated-copy surgery. jq is now only required on the surgery path. * runbook: engine table re-targeted, new 'SGLang at the merged commit' section (build, expectations, status), surgery section scoped to the pre-merge image, watchlist item 1 marked merged. * contract: build-script pin + probe/mount assertions. Full from-source build, not an overlay: the pinned fork's dflash files differ from the PR base (69-231 changed lines each), so the pinned image's DSpark integration is not inherited (it lives in the fork; upstream c14312a6 has its own dspark.py).
2 tasks done
5 tasks done
This was referenced Aug 20, 2026
Ligator
added a commit
to WaxacaBytes/spark-ai-hub
that referenced
this pull request
Aug 21, 2026
Three SGLang recipes serving Qwen3.8-27B with DFlash2, Inco AI's second-generation block-diffusion drafter (incoai/Qwen3.8-27B-DFlash2). DFlash2 drafts a whole block in one pass and keeps the top candidates at every position; decoding is lossless, so only speed changes. Measured on this Spark through the Hub interface (writing / code-edit): nvfp4-dflash2 30.0 / 59.1 24.6 GB fp8-dflash2 23.1 / 46.3 30.2 GB bf16-dflash2 12.0 / 27.9 55.6 GB On identical NVFP4 weights DFlash2 beats both existing speculators -- EAGLE 26.0/31.7 and DSpark 22.7/34.7 -- a 1.7x jump on code-edit. All three are now the fastest AA-52 entries in the hub. Image: lmsysorg/sglang:dev-nightly-0820, not the cookbook's pinned qwen38-27b tag. DFlash2 landed in sgl-project/sglang#35371 (2026-08-19) and the quantized target-lm_head path in #35496 (2026-08-20); RadixArk quantizes lm_head to NVFP4, so without #35496 that recipe refuses to boot with "requires a dense FP16/BF16/FP32 target lm_head". The cookbook says so in a Warning box and names this image. It is a dated, immutable nightly tag rather than rolling `dev`, so reinstalls stay reproducible. The cookbook cell pins --kv-cache-dtype fp8_e4m3 for all three quantizations, but its own note says the BF16 and FP8 checkpoints carry no fp8 KV calibration -- the KV precision row is the opt-out for exactly them. Those two take the opt-out (fidelity is why they exist next to NVFP4); NVFP4 keeps fp8 KV as specified. Upstream marks every DGX Spark DFLASH2 cell "in-progress" (never exercised on GB10), so these are the first measured GB10 numbers. MANIFEST: weights baked into the images (no HF cache volumes), every flag visible in docker-compose.yml, no wrapper scripts, shared port 9001. Each was verified offline -- launched under `--network none` with DNS dead and served a completion. Also: benchmark_editing_column.py predates the auth layer and was getting 401s from the Hub API. It now reads the admin API key from the Hub DB, or SAH_API_KEY. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UTm7d2yDK93M11Y4nH2PtS
3 tasks done
6 tasks done
4 of 5 tasks
chinazhangchao
pushed a commit
to chinazhangchao/sglang-windows
that referenced
this pull request
Sep 15, 2026
…5371) Co-authored-by: Jian Chen <[email protected]> Co-authored-by: Liangsheng Yin <[email protected]> Co-authored-by: hnyls2002 <[email protected]>
4 of 5 tasks
JustinTong0323
added a commit
that referenced
this pull request
Sep 21, 2026
…for DFlash2 Both prerequisites are in the v0.5.20 release the pages now pin: the DFlash2 drafter (#35371, merged into main 2026-08-19) and the GLM-5.3-Flash hidden-state capture (#36708, which reached main via the #36507 squash merge). Removes the nightly-image requirement on the GLM-5.3 page and the support-branch checkout instructions (xinyuan/glm-5.3-flash-support) on the Flash page; keeps the still-valid notes (CUDA/NPU-only, no DP-Attention, draft checkpoint gating/license).
cih9088
added a commit
to cih9088/SpecForge
that referenced
this pull request
Sep 28, 2026
* chore(build): patch sgl-project/sglang#25408 * chore(build): patch sgl-project/sglang#35371
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Two additions to the DFlash draft, both switched on by the checkpoint. A DFlash
checkpoint declares neither and takes the path it always took.
Grouped dynamic depthwise convolution inside each block, so a proposal
position can see the ones before it without another backbone pass.
out[i,c] = Σ_t (base[t,c] + δ[i,t,g(c)]) · x[i−t,c], taps zero across the blockboundary. Wraps each sublayer in and out from one projection of its input.
On when
conv_kernel_sizeandconv_group_sizeare set.Candidate selector. Instead of an independent argmax per slot, keep the
target head's top-K per slot, score adjacent transitions
edge(p→c) = ⟨A[p] ⊙ project(h), B[c]⟩ + unary[c], and walk the best path fromthe verified anchor. At T>0 it walks by inverse CDF and returns q over the K
candidates for the lossless verify. On when
selector_rankandselector_top_kare set.Modifications
The selector's decode is folded into the draft CUDA graph, greedy and sampled
alike. The walk is one Triton program per request: a slot's K scores stay in
registers, greedy rows take the argmax and emit a one-hot q, and the slot-to-slot
dependency is a loop inside the program rather than a kernel per slot. No new
server args, no new env vars, nothing outside DFlash touched.
Accuracy Tests
4 passedand5 passed.test_dflash_logits.pycovers the selector's sampled path end to end,the mixed greedy/sampling batch — each row identical to running it alone, with
greedy rows asserted to carry a one-hot q — and the rejection of a quantized
target LM head.
Lossless decoding is the property that matters here and it is structural: greedy
walks emit the point mass at the token they take, and sampled walks return the
realized q over the K candidates, so the verify sees the proposal distribution it
actually drew from.
Speed Tests and Profiling
Published evaluation for
z-lab/Qwen3.8-27B-DFlash2on
Qwen/Qwen3.8-27B: SGLang on one H200 with FlashAttention 3, block size 8(seven draft tokens per verification step), Qwen3.8's recommended sampling
(temperature 1.0, top-p 0.95, top-k 20) at
xhighreasoning effort, 4096 max newtokens, prompts formatted by
z-lab/dflash.Compared against the target's built-in MTP and a community DSpark drafter,
RadixArk/Qwen3.8-27B-DSpark,both also proposing seven tokens per step.
Acceptance length
Per-request mean of completion tokens over verification steps.
Throughput, GSM8K
Output tokens over end-to-end wall time, with speedup over autoregressive
decoding.
Full tables for the other four datasets, and for
z-lab/Muse-Glimmer-30B-DFlash2against Meta's published DFlash assistant, are on the model cards.
What it costs
The convolution and the selector are the whole difference between a DFlash draft
and a DFlash 2 draft, so their cost is what a step loses by having them. Measured
against Meta's published DFlash assistant on the same target,
meta-models/Muse-Glimmer-30B,block 16, GSM8K, four H200 shards.
costis(1 + accept gain) / (1 + throughput gain) - 1— the throughput gain the extra acceptance would have produced had thestep stayed the same length, against the gain it actually produced.
So 1.5–2.7%, and it falls as the batch grows: the target verify grows with the
batch while the selector's work does not keep pace. It falls as the target grows
for the same reason.
Acceptance enters this table only as a ratio between the two drafts, both
measured the same way — as total accepted tokens over total verification steps,
where the model card reports a mean over per-request ratios. The two statistics
differ on absolute values but nearly cancel in the gain: +24.3% here at
concurrency 64 against the card's +21.0% for the same pair of checkpoints.
Checklist
CI States
Latest PR Test (Base): ⏳ Run #32199057265
Latest PR Test (Extra): ⏳ Run #32199057143