mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #16] [MERGED] HIP prompt path: MLA products in FP16 and rocWMMA attention (Strix Halo +16% prompts) #281
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#281
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/16
Author: @boxwrench
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @mw00
Base:
main← Head:amd/hip-prompt-attention📝 Commits (1)
ffde3caHIP prompt attention: MLA products in FP16 and a rocWMMA tensor-core attention kernel📊 Changes
4 files changed (+289 additions, -1 deletions)
View changed files
📝
include/strata/kernels/glm_batch.hpp(+6 -0)📝
src/core/glm_prefill.cu(+80 -1)📝
src/kernels/cuda/glm_batch.cu(+148 -0)📝
tests/hip/glm_prefill_attention.cpp(+55 -0)📄 Description
The second AMD prompt-speed PR mentioned in #6/#7: the prompt path's MLA products in FP16 and a rocWMMA tensor-core prompt attention kernel on HIP. CUDA is unchanged (all new code is under
STRATA_USE_HIP).What changes
glm_prefill.cu): theq_absand MLA-output batched GEMMs run with FP16 operands and F32 accumulation, heads packed per head, reusing existing buffers (Q packs intoB.attn, the context intoB.q_abs).w16_elemsgrows on HIP so the FP16 copy ofwk_b/wv_bfits.glm_batch.cu,mla_attn_f16q): the tensor-core attention for HIP, 57 KB of LDS (under RDNA's 64 KiB). The rocWMMA include is wrapped inpush_macro/#undef/pop_macro, since HIP's bf16/fp8 headers clash with the force-includedhip_compatshuffle macros.STRATA_GLM_MLA_WMMA=0falls back to the F32mla_attnkernel,STRATA_GLM_MLA_F16=0to the F32 products.tests/hip/glm_prefill_attention.cpp): the rocWMMA kernel against the F32 kernel on random data (T=48, 32 heads, up to 700 cells, partial chunks).Checked
hip_glm_prefill_attention: F32 kernel max abs error 3.9e-8; rocWMMA vs F32 relative L2 9.8e-5 (worst head 2.4e-4), identical on RX 7900 XT and R9700.glm_layer_parity,glm_dsa_parity,glm_model_testpass on both cards; 7 smoke checks pass on the full model.Measured (prompt tok/s, v1.0.11 vs this branch, same prompts)
Decode is unchanged. The gain is largest where attention is a bigger share of the prompt time (the iGPU). The Strix runs are noisy (n=3; one baseline run at 184).
Not tested: CUDA (no NVIDIA toolchain here); nothing outside
STRATA_USE_HIPchanges.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.