Skip to content

qwen3_5 CUDA prompts: the a and b projections share one launch from 2,048 rows (#2911) - #2925

Merged
ashhart merged 2 commits into
mainfrom
lead/q35-cuda-ab-one-launch
Nov 14, 2026
Merged

ashhart merged 2 commits into
mainfrom
lead/q35-cuda-ab-one-launch

Conversation

@ashhart

@ashhart ashhart commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Fixes #2911.

From 2,048 prompt rows, Qwen3.8-27B's DeltaNet layers launched their four input projections one by one on the 2x2 prefill tile. The 48-column a and b launches each filled only a fraction of a GB10's block slots.

  • qwen38PairShape admits only prompt passes with PDL, no int8, 2,048 rows or more, and the 27B's affine-4 group (k 5,120, widths 10,240 / 6,144 / 48 / 48). It has its own host test, including every wrong width, input count and row edge.
  • When it holds, qkv and z keep their 2x2 launches, and a and b go through one existing 2x4 promptMany launch with their own output pointers. That path is already contract-tested to give each projection its own bytes. No kernel changes.
  • Both replacement contracts (tests/cuda/contract_qmm_prefill_many.zig, contract_qmm_prefill_tile22.zig) gain the two 48-column outputs at k 5,120 and 2,048 / 4,096 rows.

Tests: the recording driver runs the real adapter at 2,048 and 4,096 rows (qkv and z once each, then one a/b launch) and checks every binding, argument, grid and thread count. Disabling the pair branch, or removing the int8 gate, turns a runtime comparison red. Full CUDA host 6195/6234 (39 skipped), and the arm64 Linux CUDA tests compile.

Not yet checked on a device: the two contracts on a GB10, cold 2K and 32K greedy and seeded replies byte-equal, and a GB10 2K/8K/32K A/B (expected +0.3-0.5% at 2K). It lands at +0.2% or better at 2K with nothing slower.

@ashhart
ashhart force-pushed the lead/q35-cuda-ab-one-launch branch from bd541d8 to 69d63e8 Compare November 14, 2026 14:20
@ashhart
ashhart merged commit 1e805a6 into main Nov 14, 2026
2 of 10 checks passed
@ashhart
ashhart deleted the lead/q35-cuda-ab-one-launch branch November 14, 2026 14:20
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.

qwen3_5 CUDA prompts: the 48-column a and b projections launch alone from 2,048 rows

1 participant