Skip to content

[MI300X]mha fwd v3 gfx942 support hdim192x128 - #1474

Merged
shay-li77 merged 1 commit into
mainfrom
lxx/dev/gfx942_support_fwd_v3_hd192
Dec 16, 2025
Merged

shay-li77 merged 1 commit into
mainfrom
lxx/dev/gfx942_support_fwd_v3_hd192

Conversation

@shay-li77

@shay-li77 shay-li77 commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

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
image
causal=True, Rounding mode= RTNA
image

MI300

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

Submission Checklist

Copilot AI review requested due to automatic review settings November 24, 2025 06:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
shay-li77 force-pushed the lxx/dev/gfx942_support_fwd_v3_hd192 branch from 5164ed5 to 6aa708c Compare November 24, 2025 06:30
@shay-li77 shay-li77 changed the title mha fwd v3 gfx942 support hdim192x128 [MI300X]mha fwd v3 gfx942 support hdim192x128 Nov 26, 2025
@shay-li77
shay-li77 force-pushed the lxx/dev/gfx942_support_fwd_v3_hd192 branch from fa47163 to 6e75a6b Compare December 10, 2025 12:46
@shay-li77
shay-li77 requested a review from a team December 10, 2025 12:46
@shay-li77
shay-li77 force-pushed the lxx/dev/gfx942_support_fwd_v3_hd192 branch 5 times, most recently from 7eb95ff to de1f45f Compare December 16, 2025 04:12
@shay-li77
shay-li77 force-pushed the lxx/dev/gfx942_support_fwd_v3_hd192 branch from de1f45f to 8da4b52 Compare December 16, 2025 04:38
@shay-li77
shay-li77 merged commit 80cc3ae into main Dec 16, 2025
22 checks passed
@shay-li77
shay-li77 deleted the lxx/dev/gfx942_support_fwd_v3_hd192 branch December 16, 2025 10:10
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants