[MI300X]mha fwd v3 gfx942 support hdim192x128 - #1474
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for head dimension 192x128 configuration in the MHA (Multi-Head Attention) forward v3 kernels for gfx942 architecture (MI300/MI308 GPUs).
- Extended kernel dispatcher to handle hdim_q=192 with hdim_v=128
- Added template specializations for all kernel variants (causal/non-causal, group/non-group modes, different rounding modes)
- Updated smoke tests to cover the new dimension configuration
Reviewed changes
Copilot reviewed 3 out of 27 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| op_tests/cpp/mha/smoke_test_fwd_v3.sh | Added head_dim iteration loop and d_v parameter to test 192x128 configuration |
| hsa/gfx942/fmha_v3_fwd/codegen.py | Added kernel template specializations and dispatcher logic for hdim 192x128 |
| aiter/ops/mha.py | Removed gfx950-specific restriction, allowing hdim_q=192 for gfx942 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shay-li77
force-pushed
the
lxx/dev/gfx942_support_fwd_v3_hd192
branch
from
November 24, 2025 06:30
5164ed5 to
6aa708c
Compare
shay-li77
force-pushed
the
lxx/dev/gfx942_support_fwd_v3_hd192
branch
from
December 10, 2025 12:46
fa47163 to
6e75a6b
Compare
shay-li77
force-pushed
the
lxx/dev/gfx942_support_fwd_v3_hd192
branch
5 times, most recently
from
December 16, 2025 04:12
7eb95ff to
de1f45f
Compare
shay-li77
force-pushed
the
lxx/dev/gfx942_support_fwd_v3_hd192
branch
from
December 16, 2025 04:38
de1f45f to
8da4b52
Compare
valarLip
approved these changes
Dec 16, 2025
zhuyuhua-v
pushed a commit
that referenced
this pull request
Dec 17, 2025
ZhangLirong-amd
pushed a commit
that referenced
this pull request
Dec 29, 2025
valarLip
pushed a commit
that referenced
this pull request
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
mha fwd v3 support hdim192x128 for MI300/MI308
Technical Details
Added test coverage for head_dim=192 in smoke tests
Extended kernel dispatcher logic to handle the 192x128 dimension configuration
Updated dimension validation checks to allow hdim_q=192 while maintaining hdim_v=128
Test Plan
MI300/MI308:
python3 test_mha.py
python3 test_mha_varlen.py
bash smoke_test_fwd_v3.sh -a gfx942
Test Result
function test:
test pass
perf test:
ps: CK目前不支持通过API配置rounding mode,需要修改config文件,默认为RTZ。
MI308
causal=True, Rounding mode= RTZ


causal=True, Rounding mode= RTNA
MI300
causal=True, Rounding mode= RTZ


causal=True, Rounding mode= RTNA
Submission Checklist