mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2221] [CLOSED] sm_75: Q2_0 matvec with one warp per four rows (bitwise) #3930
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3930
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2221
Author: @rafatxf
Created: 10/13/2026
Status: ❌ Closed
Base:
main← Head:pr/sm75-q2-warp-rows📝 Commits (1)
03f4631sm_75: Q2_0 matvec with one warp per four rows (bitwise)📊 Changes
1 file changed (+85 additions, -0 deletions)
View changed files
📝
src/kernels/cuda/native_mmvq.cu(+85 -0)📄 Description
On Turing the Q2_0 matvec of the decode windows is far from the card's bandwidth: the QSA layers'
attn_q(2560 → 12288, Q2_0 in the canonical pack) takes 80 µs at three columns, ~110 GB/s on an RTX 2080 Ti. The exact layout gives each row four warps and half a 64-value block per thread, then a cross-warp reduction; at the engine's 2,560 inputs a row has 40 blocks, so 48 of the 128 threads have no chunk and the reduction is most of the kernel.q2_0_warp_rows_kernelgives a warp four rows. Lanelruns the chunks of the exact kernel's threadsl,32 + l,64 + land96 + l, in their loop order, adds the four sums the way warp 0 adds the other warps' partials, then the samewarp_sum. Every output is bit for bitnative_q2_0_mmvq_kernel's (one column) andlaunch_multi's exact layout (two to four columns); the upstream (non-exact) layout keeps its kernel.Default on sm_75 only (the only card I can measure);
STRATA_Q2_WARP=0keeps the old kernels,=1takes this one on any CUDA card.Setup
RTX 2080 Ti 22 GB (sm_75), i7-6700, CUDA 13.0, SM 1650 MHz, 240 W. Flash-Next, canonical Q2_0 pack,
--max-context 524288,--serve.Kernel (2560 × 12288, cold weights: six copies in rotation, 300 calls)
The outputs are compared with
memcmpagainst the engine's own launch for every column count: identical. One and two rows per warp, and eight warps per block, were measured too; four rows and four warps was best.Engine
Together with the QSA attention change of #2220 (both bitwise, measured as one step), 512 new tokens, two runs each: Spanish chat 86.0 → 87.8 t/s, code 103.1 → 106.1, English at 32K 75.3 → 78.4. The same kernel also serves the shared expert's Q2_0 gate/up on its side stream.
Part of the Turing set tracked in #2197.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.