mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #38] [MERGED] HIP: wave32 WMMA prompt attention on RDNA4 (R9700 prompts +8-10%) #293
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#293
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/mw00/project-maya/pull/38
Author: @boxwrench
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mw00
Base:
main← Head:amd/hip-wmma-attention-v2📝 Commits (2)
f0163b3HIP: map the device-query names #44 uses (v1.0.21 does not build on HIP without them)b7b8d75HIP GLM prefill attention: wave32 WMMA path with INT8 latent loads📊 Changes
5 files changed (+326 additions, -25 deletions)
View changed files
📝
include/strata/hip_compat/cuda_runtime.h(+3 -0)📝
include/strata/kernels/glm_batch.hpp(+9 -0)📝
src/core/glm_prefill.cu(+26 -5)📝
src/kernels/cuda/glm_batch.cu(+170 -0)📝
tests/hip/glm_prefill_attention.cpp(+118 -20)📄 Description
A second HIP prompt-attention kernel for RDNA4, next to #16's. On a single Radeon AI PRO R9700 it reads prompts ~8-10% faster. CUDA is unchanged (HIP-only code).
What changes
wmma2prompt attention (src/kernels/cuda/glm_batch.cu): a wave32 WMMA kernel with FP16 high/residual products and FP32 accumulation and softmax. It sits alongside #16's rocWMMAmla_attn_f16q; #16's FP16 MLA products are kept.wmma2on gfx12 (R9700 / RX 9070), #16'sf16qon gfx11 (RX 7900 XT, Strix Halo), wheref16qmeasured as fast or faster.STRATA_GLM_PREFILL_ATTN=wmma2|f16q|f32forces one;STRATA_GLM_MLA_WMMA=0still means the F32 kernel.tests/hip/glm_prefill_attention.cppcheckswmma2against the F32 kernel on random data (partial chunks, several head groups).Checked
hip_glm_prefill_attentionon RX 7900 XT and R9700:wmma2vs F32 rel L2 3.4e-7 / 1.6e-7 (worst head 1.5e-6 / 5.0e-7);f16qunchanged (9.8e-5); F32 max abs error 3.9e-8.glm_layer_parity --selftestpasses on both cards with each ofwmma2,f16q,f32and the default;glm_model_test --selftestpasses on both.Measured, single R9700, v1.0.16, prompt tok/s (2 requests each)
f16q(#16)wmma2(this PR's default on gfx12)On Strix Halo (gfx1151) #16's kernel stays the default: there it measured 251 tok/s against 237-247 for this kernel at 4-7K prompts.
Not tested: CUDA (no NVIDIA toolchain here; all new code is under
STRATA_USE_HIP).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.