Skip to content

qwen3_5 CUDA: split mixed-width DFlash/DSpine head batches - #4439

Draft
tacosta wants to merge 1 commit into
ashhart:mainfrom
tacosta:fix/3460-mixed-width-dflash-batch
Draft

tacosta wants to merge 1 commit into
ashhart:mainfrom
tacosta:fix/3460-mixed-width-dflash-batch

Conversation

@tacosta

@tacosta tacosta commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Qwen3.5 CUDA draft frames currently choose one head width for the whole batch. If any context is wide, narrow proposal rows also use the full 248,320-column head instead of the 98,592-column narrow spans. This keeps the shared draft body batched, then projects, selects top-k, packs table inputs, and scatters results by width group while preserving stream order and narrow token-ID remapping. It covers the shared DFlash2 and DSpine CUDA frame paths.

The audit also found that affine-4 projection sums (xs) must be rebuilt after mixed-width rows are compacted. DFlash2 and both DSpine planes now refresh those sums before projection; EXL3 does not consume xs.

  • Issue: Refs qwen3_5 CUDA draft frame: mixed-width batches project the full head for narrow streams #3460.
  • Head: 7917bb05d3ad362c6dcf3fe8dba2af3529a530ea, one commit on anchor a15c7b0603dbcc5143b0dea701bc492bbd1ed7bc.
  • Current upstream main: ef4d6429fc873fe34cf37379f69921a791b04ab3. This draft stays on the stable a15c7b0 anchor while Ash identifies the intended PR merge order and commits to wait for. Main moves quickly; we can resolve overlaps and conflicts and do the final rebase once that order is clear.

Detected path overlaps

A paginated filename scan checked all 385 open PRs with no fetch failures. It found 34 other PRs sharing at least one changed path. Shared paths do not by themselves mean a textual conflict.

The ATC overlap simulation is incomplete because it hit pull/file/time limits. Its current worktree comparison reports #2982 conflicting and #2008, #2020, #2926, #2945, #2955, and #2960 clean. Its comparison against the older remote PR head ce809b7 reports conflicts with #2020, #2926, and #2960; the other simulated results are unknown. ATC also found local worktree overlaps: IDs 3 (1 conflict file), 4 (2), 8 (1), and 13 (2); IDs 9, 12, 14, and 15 were clean. ATC does not map those numeric IDs to paths.

Ash, please identify the intended merge order and the main commits/PRs to wait for. We can resolve the known overlaps and refresh checks once that order is clear.

Checks on this head

  • The red control removed only the projection-sum refreshes. The DFlash2 and DSpine regression assertions failed as expected (expected 2, found 0; expected 4, found 0).
  • Green CPU qualification: zig build -j2 -Dfixed-cpu test-qwen35-draft-frame-host test-qwen35-draft-trees-host test-qwen35-dspine-host --summary all — 48/48 passed.
  • zig fmt --check build.zig zig and git diff --check pass.
  • Lean checker: 165 findings on base and 165 on head; 0 new.
  • PR preflight: 0 errors and 1 advisory (no Unreleased bullet naming this PR).
  • No CUDA device or checkpoint was used. No CUDA token-identity or performance result is claimed here.

CUDA qualification requested from Ash

Ash confirmed GB10 is a suitable target. After review has no open asks, he plans to run drafted-versus-plain token identity for single-stream and mixed-width concurrent requests, plus mixed versus all-narrow/all-wide head and served-decode timings. Those receipts remain pending.

Receipt

  • Boxes it reaches: Qwen3.5 CUDA DFlash2 and DSpine draft head paths, including mixed narrow/wide contexts with affine-4 or EXL3 heads.
  • New switch: none; drafter selection and defaults are unchanged.
  • Exactness: host regressions check width-specific projection calls, top-k widths, table input packing, and row scatter. CUDA token-for-token comparison with "draft": false remains pending.
  • Environment: Linux x86_64 CPU host, Zig 0.17.0. CUDA runtime qualification and Metal were not run; the Metal path is unchanged.
  • Performance: no local CUDA head or decode timing was run. No prompt-processing code changed.
  • Licence: n/a; no weights or drafter files are added.

Checklist

  • Title, description, issue, and base anchor match this revision.
  • Regression tests fail when the refresh fix is removed and pass with it.
  • Lean and PR preflight completed.
  • All detected changed-path overlaps are listed above.
  • CUDA exactness and performance qualification; pending Ash's GB10 run.
  • Final rebase and conflict resolution; waiting for Ash's merge-order guidance.

@tacosta

tacosta commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

@ashhart, this draft is anchored at main commit d4bf08ec4294fa244a322c62efb58e058d08a40e and is ready for review and testing. When you review the backlog, could you tell me which PRs/commits and merge order we should wait for before the final rebase? The PR lists every detected path overlap; I can resolve the known conflicts once that order is clear.

I also asked on #3460 whether GB10 is suitable for the CUDA identity and timing checks you offered to run. If you agree, could those checks use GB10? Otherwise, please name the CUDA target you prefer. The final post-rebase CPU smoke passed 47/47 tests; CUDA exactness and performance remain pending.

@tacosta
tacosta force-pushed the fix/3460-mixed-width-dflash-batch branch from ce809b7 to 7917bb0 Compare November 25, 2026 09:26
@tacosta

tacosta commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Merge-order note: a complete filename scan found 34 other open PRs sharing changed paths; the description lists every PR by path. These are path overlaps, not all confirmed conflicts. ATC's simulation is incomplete: it flags #2982 against the current worktree, and #2020, #2926, and #2960 against the old PR head. Local worktree conflict IDs are 3, 4, 8, and 13; IDs 9, 12, 14, and 15 were clean (ATC does not map those IDs to paths). Please establish the PR merge order and commits to wait for; we can resolve conflicts and rebase once that order is known.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant