Repository navigation
Conversation
524edde to
6bbb1c5
Compare
|
Rebased onto current main (0.1.35, d9ab843) — the PR is now exactly the gfx1100 arm: #337's content is upstream, so the branch is one clean commit on main (+629/−67 across the 6 files): the FP16 WMMA kernel as the second branch of the existing AMD dispatch (gfx12 first, gfx1100 under the same STRATA_SELECT_WMMA=1 opt-in, else the warp kernel), the parity suite, and the bench with #337's capacity arg + FP64 gate extended per-arm (each arm gated by its own declared contract — 4x-warp for the FP32-level arms, the 2^-9.5·S conversion bound for this one; the same bound its parity suite enforces with adversarial fixtures and a failing negative control). Fresh numbers, measured on this branch's exact source on an RX 7900 XTX / gfx1100 / ROCm 7.1.1, paired per the frozen contract (5 interleaved pairs × 2 slots, one-shot runs, the tuned AMD config):
Byte-identity note: this branch's five source files are byte-identical to the tree that produced those parity/bench/e2e numbers (validated before the rebase packaging). |
…h (opt-in STRATA_SELECT_WMMA=1) Rebased onto 0.1.35 main (d9ab843). The gfx1100 FP16 WMMA arm (rocWMMA 16x16x16, FP32 accumulation, wave32) plugs into qsa_block_scores_tc's AMD dispatch as the second branch: gfx12 (RDNA4, Niko1221#337) first, then gfx1100 under the same STRATA_SELECT_WMMA=1 opt-in, else false -> the warp kernel. STRATA_SELECT_OLD=1 still wins. The arm that ran is printed once, so a silent fallback cannot pass as the fast path. The kernel is renamed block_scores_wmma_gfx11_kernel (Niko1221#337's gfx12 kernel keeps its name). The bench carries Niko1221#337's capacity arg + FP64 gate with each arm gated by its OWN declared contract (4x-warp for the FP32-level arms; the 2^-9.5*S fp16 conversion bound for this arm - the same bound its parity suite enforces with adversarial fixtures and a failing negative control). Validated on this exact source (gfx1100, ROCm 7.1.1): qsa_select_wmma_parity 5/5 incl. adversarial fixtures; kernel bench 11.64x at 128K (wmma at worst 0.09 of its bound); paired e2e on 0.1.33: +9.82% at 128K and +4.24% at 64K (gate 1/3 pass) with decode -3.77% (gate 2, cap 3%) -> the opt-in default is correct; the measured table is in the PR thread.
6bbb1c5 to
ae3e1b7
Compare
|
Thank you for the careful parity work and the numbers. We can't maintain a second architecture-specific scorer arm without an AMD card to test it on, and even as an opt-in it costs decode (-3.8% in your runs). Please keep it in your fork for long-prompt work; closing here. |
Niko1221#368 content) Carried from the pr-qsa-select-wmma-rdna3 branch (0.1.38 rebase 7e8adda) onto the current line (0.1.39 + the RDNA3 WMMA prompt-attention arm). The gfx11 kernel keeps its rename (block_scores_wmma_gfx11_kernel; the gfx12 kernel keeps the plain name), the arch dispatch inside qsa_block_scores_tc routes gfx12 -> gfx1100-under-opt-in -> false (warp fallback), and the arm prints once so no fallback can masquerade. Parity + bench re-registered in CMake.
|
Rebased onto current main (0.1.39, 6f32ec0) — two commits,
The rebase surface is unchanged (6 files). gfx1100 currently runs the warp kernel on 0.1.39 (the only WMMA select in main is gfx12-gated), so this arm is the whole gap. |
QSA select: RDNA3 (gfx1100) WMMA block-scores arm on #337's arch dispatch (opt-in STRATA_SELECT_WMMA=1)
Rebase of #312 as requested ("rebase this onto #337's HIP scorer entry point (it dispatches by arch) and keep it
opt-in under STRATA_SELECT_WMMA=1"). Stacked on #337: it merges that branch first, then adds the gfx1100 arm.
What the dispatch looks like now
qsa_block_scores_tcon HIP dispatches by architecture, one arm per card family:block_scores_wmma_kernel(bf16 three-way split), unchanged.block_scores_wmma_gfx11_kernel: rocWMMA 16x16x16 FP16 operands, FP32accumulation, wave32; keys and queries converted to FP16 per call into an internal scratch (the conversion is
part of the arm's cost). Opt-in:
STRATA_SELECT_WMMA=1— its scores are FP16-input with another summationorder, so they can change selection.
STRATA_SELECT_OLD=1still forces the warp kernel above all of this.return false, the warp kernel (unchanged default behavior; no card sees a new arm by default).The arm that ran is printed once (
strata select: prompt scorer arm = ...), so an opt-in that quietly fell backcannot masquerade as the fast path.
Evidence (all measured on the card the PR targets)
qsa_select_wmma_parity, registered with ctest): the warp armis bitwise == its host model; the tail block is bitwise == the warp arm (shared tail kernel — no new tail
arithmetic); every score inside the pre-derived bound
B(qi,b) = 2^-9.5 * S(qi,b) + 8 * 2^-24 * |score|vs aFP64 oracle (worst utilisation 0-11%); selection ids agree wherever the gap > 2B; the +2.5B negative control
correctly FAILS the suite (the harness can detect a defect of the size the bound claims to cover).
same kernel measured paired end-to-end at +8.7% at 128K (1K +0.2% ... 64K +3.8%; 123 paired cells,
STRATA_SELECT_WMMA=1vs default; decode within the protected cap) - that full table is in QSA select: ROCWMMA block-scores arm (opt-in STRATA_SELECT_WMMA=1, gfx1100) #312's descriptionand carries over: the kernel is byte-identical through the 0.1.29/0.1.30/0.1.31 rebases, only the base moved.
qsa_select_bench) gains an FP64 accuracy gate sampled against all present arms and returns non-zeroon a failed gate or a register-top-k mismatch (addressing the Copilot review items on hip: gfx12 (RDNA4) QSA select - WMMA block scorer, prompt-aware top-k dispatch #337's bench for our arm).
Files
CMakeLists.txt(parity + bench registration, rocWMMA detection),include/strata/kernels/qsa_select.hpp,src/kernels/cuda/qsa_select.cu,src/kernels/qsa_select_bench.cpp(merged with #337's capacity-arg + FP64-gateform),
src/kernels/qsa_select_wmma_parity.cpp,src/prefill/prefill.cpp(call site unchanged from #337's —the dispatch is internal to
qsa_block_scores_tc).We have no RDNA4 card, so the gfx12 arm is #337's and theirs to carry; on our RX 7900 XTX every number above is
personally reproduced. Default behavior on every architecture is unchanged unless
STRATA_SELECT_WMMA=1.Validated on this branch's own 0.1.31 build (gfx1100): parity 5/5, bench 128K 11.64x kernel with the wmma arm at worst 0.09 of its pre-declared bound, register top-k ids identical 256/256. The bench's FP64 gate applies each arm's own declared contract (4x-warp for the FP32-level arms; the 2^-9.5*S fp16-conversion bound for this arm - the same bound the parity suite enforces).