Repository navigation
[ASM] [HIP] gfx1250 mha bwd d192 d128 kernel integration - #6996
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
9c913eb to
15b1666
Compare
* register gfx1250 hd192_128 bwd objects, including deterministic * add perf co * remove unused perf co
* register gfx1250 hd192_128 bwd objects, including deterministic * add perf co * remove unused perf co
Motivation
gfx1250 has an assembly FMHA backward path for
hdim_q == hdim_v == 128, added in#6454, but nothing registered for the
192/128 head-dim pair. This adds the bf16
hd192_128backward objects for gfx1250 —batch and group mode, causal and non-causal, non-deterministic and deterministic —
so the asm path covers a second head dim on that arch.
Technical Details
Fourteen files: twelve kernel objects, two manifests, one README line. No host-side
C++ change is required.
Objects go flat under
hsa/gfx1250/fmha_v3_bwd/, following the existing naming(
bwd_<hdim>_<dtype>[_causal_br]_a32_pssk[_group][_det].co,_groupbefore_det).Nothing enumerates them —
setup.pycopies the wholehsatree andhsa/codegen.pyglobs the manifests.
Registration adds 8 rows to
fmha_bwd_dqdkdv.csv({default, det, group, group_det} × {non-mask, causal_br}, withhdim_q=192 hdim_v=128 pssk=1 pddv=0 ts_qo=32 ts=128) and 4 rows tofmha_bwd_dq_convert.csv. Thedetcolumn isalready upstream from #6454; these rows only populate it for a second head dim, so
no schema change. Each hd192_128 dqdkdv pair sits directly after the hd128 pair in
the same
(det, mode)block, preserving the existing block order.The dq_convert rows carry
hdim_v=192deliberately: that matches the gfx950convention, where the dq_convert object is shared between hd192_192 and hd192_128,
and the dq_convert lookup keys on
hdim_q/mode/det/bf16_cvtwithout consultinghdim_v.Test Plan
Tested on a07-3 (gfx1250), docker image
rocm/fw-bringup:gfx1250-atom-dev-20260707(ROCm 7.14.0),amdgpu-dkms 1:7.1.0.31300009-2410483.24.04.Test all features supported and evaluate perf of each kernel.
Test Result
Results
gfx1250 function test pass.
Performance: hd192/128 backward (gfx1250)
Shape:
b=4, h=64, h_k=4, s=s_k=8192, d=192, d_v=128, bf16,atomic_fp32, batch mode.-init=3)-init=1, default)Command:
./bwd.exe -prec=bf16 -b=4 -h=64 -h_k=4 -s=8192 -s_k=8192 -d=192 -d_v=128 -bwd_v3=1 -kname=1 -v3_atomic_fp32=1 -mode=0 -v=0 -warmup=20 -repeat=10 -mask={0|b} -deterministic={0|1} -init={3|1}Submission Checklist