mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5535] [Benchmark] int8-WMMA prompt attention on RDNA3 / gfx1100 (RX 7900 XTX): recipe, validation, results — and the RDNA4 (gfx12) relevance #5507
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#5507
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/5535
Author: @xyzzing
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:results-0037-i8-wmma📝 Commits (1)
3d97786[Benchmark] int8-WMMA prompt attention on RDNA3 / gfx1100: the probe-proven recipe, the kernel results (-32.1% vs the two-image f16 class, +3.8% vs the single-image fast class, KL-gated first-token 0.0036 vs a 0.0005 FP32-swap floor), and the end-to-end no-win on the fast configuration📊 Changes
5 files changed (+249 additions, -0 deletions)
View changed files
➕
docs/rdna3-gfx1100/I8-WMMA-ATTENTION.md(+92 -0)➕
docs/rdna3-gfx1100/i8-wmma-kl-20261108.json(+99 -0)➕
docs/rdna3-gfx1100/i8-wmma-paired-20261108.txt(+30 -0)➕
docs/rdna3-gfx1100/i8-wmma-probe-20261108.txt(+11 -0)➕
docs/rdna3-gfx1100/i8-wmma-window-20261108.json(+17 -0)📄 Description
Problem and result
RDNA3 (gfx1100) has no int8 matrix-core path in the prompt attention: the HIP WMMA prompt kernel (
STRATA_HIP_WMMA=1) runs int8-KV with fp16 operand products, and the int8 WMMA instructionV_WMMA_I32_16X16X16_IU8is unused. This report documents the missing tier — an int8 Q·K and P·V prompt-attention kernel with exact i32 accumulation and an fp32 online softmax — its probe-proven gfx11 fragment recipe, its numerics validation, and an honest performance map: −32.1 % kernel time vs the two-image f16-WMMA class on a real 94 K-depth replay (paired, interleaved), +3.8 % vs the single-image fast class (that config's fp16 q·k already needs one WMMA per step), first-token KL 0.0036 vs a 0.0005 FP32-swap floor with argmax identical on every prompt. The recipe and the validation method are the portable part: RDNA4 ships the same instruction family and already defaults to the f16 WMMA prompt path, where an int8 tier would meet its audience by default — the layout re-proof on an RDNA4 card is one probe run (see the report's RDNA4 section; measured on an R9700 it would settle the port question in minutes).Related discussion
Approach
The gfx11 i8-WMMA recipe, each element probe-proven (256/256 against an exact CPU product): natural operand packing (reg t byte b = k 4t+b; the lane's row of A, column of B; lanes 16–31 repeat 0–15), the
(true, true)neg flags as the signed emulation on the u8 containers (also exact for u8(0..127)×s8, P's quantization range), the C/D fragmentD[2i + l/16][l%16], and the c-operand adding as-is under the neg flags (chained k-steps are safe; also passes through at A=B=0). Q·K carries Q as a hi/lo int8 pair (two chained i32 dots — the single hi image's qup/256 granularity flattens the softmax), K codes feed the WMMA as raw bytes (no int8→fp16 conversion), and the epilogue is(256·hi + lo) × k_scale— the codes already carry thequpfactor the softmax'sqdowncancels, so re-dividing byqupis the one place this kernel bites. P·V quantizes P to u8 (0..127) on the V-normalized range, one i32 dot per step, epilogue× (16384/127) × v_down × alpha. int8 products stay below 2³¹ everywhere, so the accumulator is exact with no fp32 magic-constant staging.Validation (Passed/Failed/Not run)
Limits
One machine (RX 7900 XTX, 24 GB), one artifact (Qwen3.8-Flash-Next IQ3_S,
--kv int8), one recorded 94 K replay shape plus four real-prompt KL serves; other RDNA3 parts and other quantizations are unmeasured. The attention-output rounding (1.9e-2 relative RMS) is disclosed and KL-gated for chat use. This PR is docs-only (evidence files underdocs/rdna3-gfx1100/); the kernel itself is implemented behind an opt-in flag with the parity/accuracy tests included, and its code PR follows only if scope is agreed here.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.