mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #856] [CLOSED] hip: RDNA3 (gfx1100) WMMA kernel for the QSA block-score select/scorer (opt-in STRATA_SELECT_WMMA, gfx12/gfx11) #2875
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#2875
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/856
Author: @xyzzing
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:feature/select-wmma-rdna3-0139📝 Commits (3)
49969d1hip: RDNA3 (gfx1100) WMMA kernel for the int8-KV QSA prompt attention (opt-in STRATA_HIP_WMMA, gfx12/gfx11)9687100QSA select: the gfx11 (RDNA3) WMMA block-scorer arm on the 0.1.39 line (#368 content)972a637qsa_select_wmma_parity: the warp-kernel contraction pin demoted to a diagnostic📊 Changes
8 files changed (+789 additions, -79 deletions)
View changed files
📝
CMakeLists.txt(+11 -0)📝
include/strata/kernels/qsa_select.hpp(+9 -0)📝
src/kernels/cuda/qsa_prompt_attn.cu(+129 -9)📝
src/kernels/cuda/qsa_select.cu(+162 -2)📝
src/kernels/qsa_prompt_attn_parity.cpp(+6 -3)📝
src/kernels/qsa_select_bench.cpp(+118 -60)➕
src/kernels/qsa_select_wmma_parity.cpp(+348 -0)📝
src/prefill/prefill.cpp(+6 -5)📄 Description
Companion to #786: the same RDNA3 WMMA treatment for the QSA select/scorer path, which the profiler puts at ~12-14% of 128K prefill on gfx1100.
What
qsa_block_scores_wmma: a gfx11 (RDNA3) WMMA block-scorer arm. Dispatch inqsa_block_scores_tc(qsa_select.cu) tries the gfx12 WMMA kernel first, then this arm underSTRATA_SELECT_WMMA(opt-in; default unchanged). The tail block keeps the warp kernel's arithmetic (sharedblock_scores_tail_kernel, bitwise) and the+1e9dead-tail rule is exact.src/kernels/qsa_select_wmma_parity.cpp(new): ragged query/block tiles, whole tiles, an x8-magnitude FP16-headroom case, degenerate n_kv=0, one-hot lane/store-adversarial case.Arithmetic contract and parity (pre-derived before the kernel, rollout records §18): WMMA arm = FP16 inputs / FP32 accumulation; bound per entry B = 2^-9.5·S + 8·2^-24·|score| against a float64 oracle (S = the |k·q| magnitude sum, computed in f64 in the harness). Measured on the 10.2 nightly SDK: worst bound utilisation 11.0% across all cases, 0 differing selection IDs (top-k over warp vs WMMA scores, near-tie-gap guard), tail block bitwise the warp arm's, write-set canaries intact, negative control (+2.5·B perturbation) fails as required. The warp arm's host-model contraction pin (7.1.1-era: fma-left) no longer fits the nightly clang's
v_fmacinterleaving; the harness now enumerates six contraction shapes and reports the best fit as a diagnostic, with the oracle bound + selection agreement + tail check as the hard gates.Measured, paired A/B (RX 7900 XTX, 0.1.39 + #786 arm-on in BOTH arms, arms differ only in
STRATA_SELECT_WMMA; 5 pairs × 1k/32k/128k, odd pairs a-first):Mechanism: the
qsa selectphase drops 10249 ms → 1952 ms (5.25×; 11.8% → 2.4% of 128K prefill). Consistent with the earlier 0.1.33 measurement (+9.8% @128K, scorer microbench 11.6×). Decode: no regression in any tier (medians; the one 51.9 tok/s outlier in b-128k-p2 does not move the median).Opt-in only.
STRATA_SELECT_WMMA=1enables the arm; the default path and the gfx12 arm are untouched.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.