Repository navigation
dflash2 cuda: opt-in spanned lm_head for NVFP4/FP8 targets and drafter graphs - #4516
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/dflash-span-graph
branch
from
November 23, 2026 11:31
e3867d6 to
fe75ad1
Compare
This was referenced Nov 23, 2026
TF_DFLASH_QL_SPAN=1 drafts a ModelOpt head over the two vocabulary spans, as the .a4 and .x3 heads already do. It is off by default. The views read the stored 64-row tiles and keep the whole head's K slices. Unpinned, the 320-row tail would sum in eight slices instead of one. BF16, MXFP8, FP8G and FP8 with an input scale stay on the whole head. The target still verifies against the whole head.
TF_DFLASH_GRAPH=1 replays the drafter's launches from CUDA graphs, with the same kernels and arguments in the same order. It is off by default. A hold graph is keyed by stream count, spanned head and projection role. An absorb graph is keyed by accepted rows and gather kind. Its gather, rope and ring nodes take this round's position and ring addresses before each launch. Prompt chunks and absorbs over 16 rows stay eager. Startup timing stays eager, so window planning sees the same step cost. Resizing the scratch drops every graph. A driver refusal falls back to the eager launches.
ashhart
force-pushed
the
lead/dflash-span-graph
branch
from
November 24, 2026 01:24
fe75ad1 to
c7f135d
Compare
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.
What this changes
Two opt-in drafter levers for Qwen3.8-27B with DFlash2 on CUDA:
TF_DFLASH_QL_SPAN=1: the drafter's lm_head for NVFP4 and FP8 targets reads only the vocabulary span it uses, as the affine formats already do, cutting the drafter's weight reads per round.TF_DFLASH_GRAPH=1: the drafter's hold and absorb steps (over a hundred small launches per round) are captured in CUDA graphs, bucketed by accepted count, with the same kernels and arguments in order.The target's verification is untouched, so accepted tokens equal the switch-off run.
Checks
Still to run
One GB10 and an sm_120 GPU: drafter outputs and served tokens compared with each switch off and on, then one-stream A-B-B-A.