Repository navigation
strix-hip GDN: recompute_wu row in VGPRs + 16-byte staging in recompute_wu/chunk_fwd_o (bit-identical, +1.2..1.4%) - #261
Merged
Conversation
…Rs (272 B scratch -> 0) gated_delta_rule_recompute_wu (GDN prefill, 3-4% of a 27B prefill on strix) indexed float acc[CHUNK] with runtime-bounded loops (i < ce). The array therefore lived in 272 bytes of scratch per thread, with only 60 VGPRs in use. The loops now run to the compile-time CHUNK and turn the runtime bound into a predicate (continue, not break, so they fully unroll). acc[] is register-resident: 87 VGPR, no scratch. Every element sees the same operations in the same order, so the output is bit-identical. Speed and identity: strix s57. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…it-identical) recompute_wu staged its key chunk, and chunk_fwd_o its query and key chunks, one bf16 per thread per iteration. Both now stage as uint4 rows when k_dim == K_DIM, qk_stride is a multiple of 8 and the head's row base is 16-byte aligned, and keep the element loop otherwise. Same bytes, same order: bit-identical (harness hashes equal main's). strix s130 (27B geometry, one 2048-token chunk, interleaved x3): - recompute_wu: main 4.28-4.39 ms, + the VGPR row (previous commit) 2.90-2.92 ms, + this 2.66-2.68 ms (-38% in total) - chunk_fwd_o: 3.23-3.25 -> 3.04-3.05 ms (-6%) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 29, 2026
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.
gfx1151 only (
kernels/strix-hip/common/gated_delta_rule_fla.cu, shared by qwen3.8-27b and qwen3.8-flash-next). Follow-up to #260.recompute_wukeeps its forward-substitution row in VGPRs (272 B/lane scratch → 0; compile-time CHUNK loops). Re-landed from the earlier branch, whose e2e A/B on the throttling Z13 read neutral.recompute_wuand of the query/key chunks inchunk_fwd_o, with an element-loop fallback for unaligned rows. This uses the sameGDN_VEC_STAGEas strix-hip GDN: vector LDS staging in the chunk_delta_h spine (bit-identical, +1.6..2.2% 27B prefill) #260.Bit-identical: the harness hashes of W/U/gc and of the output equal main's. Greedy probes are IDENTICAL on DevLab.
The register-row commit alone measured +0.4..0.6% (3/4 rounds, run 40945534113), so it ships with the staging.
🤖 Generated with Claude Code