Repository navigation
fix(cuda): cut a DFlash2 hold into frames an NVFP4 head accepts - #4682
Draft
devopsfortunato wants to merge 1 commit into
Draft
devopsfortunato wants to merge 1 commit into
devopsfortunato wants to merge 1 commit into
Conversation
…hart#4190) A hold ran as one frame asking the target head for streams * (block - 1) rows. An NVFP4 head refuses 256 rows or more (the fused tile sums in another order), so from 18 streams at block 16 every drafted round failed with WindowTooWide. holdFn now runs the hold as consecutive frames of at most floor((fused_rows - 1) / (block - 1)) streams, 17 at block 16, as the HIP drafter's frames() does. A hold of 17 streams or fewer stays one frame.
4 of 8 tasks
Owner
|
Thanks @devopsfortunato for tracing the failure to the 256-row ModelOpt boundary. The block-16 arithmetic is right: 17 streams produce 255 rows, while 18 produce 270. Three changes are needed before this is ready for device A/B:
Please also retain the current-main graph support when rebasing. I reviewed source only; I did not build or run the PR.
|
This branch has not been deployed
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
An NVFP4 target's head refuses 256 rows or more (
cuda_modelopt.zigproject, because the fused tile sums in another order).holdFnran every eligible hold as one DFlash2 frame, which asks that head forstreams * (block - 1)rows: 15 a stream at block 16. From 18 streams (270 rows) every drafted round failed withWindowTooWide.holdFnnow runs the hold as consecutive frames of at most(fused_rows - 1) / (block - 1)streams, 17 at block 16, the same cut the HIP drafter'sframes()makes. A hold of 17 streams or fewer is still one frame, exactly as before, so 16 streams is unchanged.--parallelis not refused and no row arithmetic changes: each stream's rows are computed by the same kernels, only the frame boundaries move. Chunking at the head's row bound was chosen over running the proposal head in pieces because it needs no change to the head or its sums and mirrors HIP.atc overlap --json: no conflicts against main, no overlapping pull requests or worktrees (the scan reportedotherPullRequestsLimit,pullFilesUnavailableandtimeLimitas limits)Checks on this head
python3 tools/zig/lean_check.py, on the base and on this head: 165 problems on the base, 165 on this head, 0 new (tools/zig/lean_new.py).zig build test-qwen35-draft-frames-host: 7 passed, 0 failed (includes the new test).headStreamsis planted back to an unbounded value (expected 17, found 64) and passes with the fix.zig build test-cuda-host --summary all: 470/470 steps succeeded, 8483/8525 tests passed, 42 skipped (this was started on the commit before a two-line simplification ofheadStreams/frameLen; the frames step was rerun on this head).zig fmt --check zig/src/families/qwen3_5 zig/qwen35_draft_frames_host.zigandgit diff --check: clean.zig build testandtest-golden(macOS Metal steps) were not run; CI runs the host aggregate.Receipt
--parallelwidth above 17. Streams, KV and the other projections are untouched. The same split also applies, with identical bits expected, to blocks of 8 above 36 streams and to DSpine holds above 17 streams.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: not measured. The bar from the issue is drafted output equal to--no-draftsat 17, 18 and 32 streams, greedy and seeded, with 16 unchanged. @Maxrio9 (reporter) or the maintainers: could you run the issue's repro with this branch at those widths and post the token hashes? I'll keep this a draft until then.Known and left alone: a DSpine drafter with an NVFP4 head asks the head for
2 * streams * (block - 1)rows, so it still hits the same limit at 9 or more streams; it failed the same way before this change and wants its own bound.Checklist