Skip to content

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
AzeezIsh merged 2 commits into
mainfrom
perf/hip-gdn-wu-regs-v2
Oct 29, 2026
Merged

AzeezIsh merged 2 commits into
mainfrom
perf/hip-gdn-wu-regs-v2

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

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.

Bit-identical: the harness hashes of W/U/gc and of the output equal main's. Greedy probes are IDENTICAL on DevLab.

main branch
recompute_wu, strix harness (27B geometry, one 2048-token chunk, s129/s130 ×3) 4.28–4.39 ms 2.66–2.68 ms (−38%)
chunk_fwd_o, same 3.23–3.25 ms 3.04–3.05 ms (−6%)
e2e 27B 7.4k, DevLab desktop 4/4 (run 40949885677) 378–384 tok/s 386–387 (+1.4%)
e2e 27B 12.5k, same 34.51–35.02 s 34.22–34.32 s (+1.2%)
e2e 1.9k 408–425 417–425 (neutral)

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

AzeezIsh and others added 2 commits October 29, 2026 16:02
…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]>
@AzeezIsh
AzeezIsh merged commit ec054ef into main Oct 29, 2026
24 of 25 checks passed
@AzeezIsh
AzeezIsh deleted the perf/hip-gdn-wu-regs-v2 branch October 30, 2026 05:31
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