Repository navigation
Conversation
… (opt-in STRATA_HIP_WMMA, gfx12/gfx11) The S6 matrix-core prompt attention was RDNA4-only; gfx1100 kept the ordered FP32 fallback - measured at 25.6-26.9% of prefill GPU time at 32K/128K on a 7900 XTX. RDNA3 runs the same v_wmma_f32_16x16x16_f16 instruction through the unsuffixed builtin, whose wave32 fragment layout differs from the gfx12 builtin's on all three operands (AMD Matrix Instruction Calculator, rdna3 tables, hardware-confirmed by a standalone probe): A[l&15][i], B[j][l&15], D[(l>>4)+2j][l&15]. The packing sites re-index accordingly; softmax, staging, scales and the online-softmax protocol are unchanged; the K side keeps one cell per lane so the per-cell scale folds as before. Parity (upstream's hip_prompt_attn_wmma, first time it runs off gfx12): 3/3 PASS, vs FP64 3.3-4.5e-06 (old kernel 1.8-2.1e-06, same class); kernel 4.17-4.91x per chunk. Paired e2e on the 7900 XTX (production-mirrored config, 5 pairs x 1k/32k/128k, arms alternate): prefill +22.8% median @128k (5/5) and +17.9% @32k (5/5), decode flat (protection cap holds). Opt-in unchanged: STRATA_HIP_WMMA=1.
|
Tested on RX 7900 XTX (gfx1100), Ryzen 7950X3D, 64GB RAM, Orca Qwen3.8-Flash-Next IQ3_XXS, INT8 KV and 131072 context. With STRATA_HIP_WMMA=1, median total time for 127999 prompt tokens + 256 generated tokens dropped from 95.359s to 79.138s: 17.0% less time. Three alternating on/off pairs all improved, with zero prompt reuse. Fresh prompt | Prefill | Generation | Total time, including 256 generated tokens All used zero prefix reuse, with the model already loaded. Thanks! |
Additional validation on RX 7900 XTX / gfx1100Tested PR commit Fixed configuration: Strata 0.1.39, ROCm Loaded ROCm libraries verified through End-to-end performanceFixed fresh prompt: 24,616 server-counted tokens + 512 generated, temperature 0,
Confirmation: +29.5% PP, −16.3% wall time, −0.24% TG. Confirmation wall range was 18.15–18.38 s. AttributionSeparate single-request diagnostics using
The 3230 ms attention reduction closely matches the 3167 ms total reduction. The engine explicitly logged Correctness and limits
Expert-cache hit / draft acceptance were 0.763 / 70.87% for the control and 0.771 / 73.67% for the candidate. Different greedy continuations can affect speculative decode work. The prompt-processing gain reproduces, decode remains effectively unchanged at 24K, and stage attribution supports the intended mechanism. |
|
Thank you both — two independent RX 7900 XTX validations on the same GPU class is exactly the evidence this needed. For the record, our own rig's numbers agree with both: 128K prefill +22.8% median 5/5 (1514 → 1863 tok/s) end-to-end and the same attribution shape (qsa attention 27.5% → 9.9% of the GPU timeline at 128K, One follow-up note from our side: with the attention term now at ~10%, we measured what is left in it — an INT8-Q feasibility fixture (rocWMMA int8→i32, integer-exact, fork 65a3c8f) showed the remaining headroom is gated by the int8 quantization class (softmax weight delta 9.5e-2 vs a 2e-2 bound under the 12x-outlier activation class), not by MMA throughput. So this PR's arm is close to the practical floor for the score path's precision class; the next lever on this card is elsewhere (MoE cluster).
|
Flags table gains the two dormant arms (STRATA_GDN_WY - kernel-level wins, engagement REJECT at parity, PR Niko1221#888; STRATA_PF_FUSED - REJECT at parity, PR Niko1221#999) and updates the live ones: STRATA_HIP_WMMA is now open upstream as Niko1221#786 with two independent 7900 XTX validations (+17.0% / +29.5% prefill); the select-WMMA arm's current line measurement is +11.2% e2e @128k with the re-file plan alongside upstream Niko1221#1007. Rejected list gains the INT8-Q verdict (integer-exact MMA, precision-gate REJECT on the quantization class). The limits section replaces the 'ladder stops at 128K' line with the YaRN ladder outcome (recall correct to 523K tokens, prefill 1536 tok/s @512k, decode gate REJECT on MTP acceptance collapse - a drafter problem, not an engine knob). Open-PR list and the CI/provenance status refreshed.
|
Thank you. 0.1.40 has an RDNA3/RDNA3.5 WMMA prompt attention on the exact gfx11 list (gfx1100/1101/1102/1150/1151) behind STRATA_HIP_WMMA=1, so this PR is superseded; your kernel and layout work was the starting point and we checked it passes on gfx1151. Closing. |
RDNA3 (gfx1100) WMMA kernel for the int8-KV QSA prompt attention — opt-in
STRATA_HIP_WMMA=1, gfx12 + gfx11This extends the S6 matrix-core prompt attention (currently gfx12-only) to RDNA3. gfx1100 keeps the ordered FP32 fallback as the default; the arm engages only under the existing
STRATA_HIP_WMMA=1opt-in, and the default path is byte-identical to current behavior. (In particular, unlike #313, nothing in the default HIP path changes — the scalar fallback stays exactly as upstream ships it.)Measured on an RX 7900 XTX (gfx1100, 24 GB), engine 0.1.39, ROCm 10.2 nightly SDK (hipBLASLt 100500 table, gfx1100), production-mirrored config (spec 3, GR_V3, --spec-min-p 0.70, --kv int8, --kv-resident 32768). Since there is no AMD card in the upstream test ring, these numbers carry the PR.
The layout that makes it work
RDNA3 runs the same
v_wmma_f32_16x16x16_f16instruction as gfx12, but through the unsuffixed builtin — and its wave32 fragment layout differs from the gfx12-suffixed builtin's on all three operands (AMD Matrix Instruction Calculator,rdna3tables, wave32, no modifiers; hardware-confirmed by a standalone probe before touching the kernel):l, slotiholdsA[l & 15][i]B[i][l & 15]D[(l >> 4) + 2*i][l & 15]Packing the gfx12 way into the RDNA3 builtin passes compilation and fails parity at ~30× the output scale. The kernel's packing sites re-index accordingly; the online-softmax protocol, LDS staging, per-cell K/V scales and masking are unchanged (the B side still holds one cell per lane, so the per-cell scale folds exactly as on gfx12).
Parity
Upstream's own
hip_prompt_attn_wmma(first time it runs off gfx12) — 3/3 PASS:Objdump gate: exactly 32
v_wmma_f32_16x16x16_f16in the compiled kernel (the loop body — no fallback can masquerade).End-to-end (paired A/B, arms alternate, same binary, env-gated)
The FP32 fallback was measured at 25.6% (128K) / 26.9% (32K) of prefill GPU time on this card — the single largest prefill phase.
Decode is flat at 32K (−0.03%) and 128K (medians equal) — the decode protection cap holds. Attribution agrees with the mechanism: the arm drops the qsa-attn share from 26–27% to 8.4–10.6% of prefill GPU time.
Notes
e[0] == '1'), and noSTRATA_WMMA_GFX11-style compile define leaks into other device passes — the arch gate is the same runtimegcnArchNameprefix check upstream already uses, extended togfx11.qsa_prompt_attn.cu,qsa_prompt_attn_parity.cpp) is deliberately minimal.