Repository navigation
MI350 mla ps fp8 mode suppport nhead*qseqlen >=128 through kernel mla_a8w8_qh32_qseqlen4_gqaratio32_ps - #3380
Merged
Merged
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the gfx950 (MI350) MLA persistent-scheduling (PS) fp8/fp8 dispatch to support additional GQA shapes where nhead * qseqlen >= 128 by routing them through the existing mla_a8w8_qh32_qseqlen4_gqaratio32_ps entry, and updates Python/C++ dispatch and test-side shape gating to match.
Changes:
- Add a gfx950 fp8/fp8 PS “GQA catch-all” dispatch condition (
gqa_ratio * max_seqlen_q >= 128 || gqa_ratio > 64, excluding 48) and route to thegqa=32, qseqlen=4PS kernel entry while passing runtimegqa_ratiovias_MQA. - Align Python dispatch/metadata sizing and test reference gating with the new catch-all rules; remove older special-cased branches.
- Update MLA device-metadata native-support rules and folding logic to reflect the new native shape set.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
op_tests/test_mla_persistent.py |
Updates “natively supported” gating in the Torch reference path to mirror the new fp8/fp8 PS catch-all dispatch. |
csrc/py_itfs_cu/asm_mla.cu |
Adds fp8/fp8 PS catch-all routing to the gqa=32, qseqlen=4 PS kernel entry and adjusts validation. |
csrc/kernels/mla/metadata/v1_2_device.cuh |
Updates native-support detection and head/qlen folding rules for gfx950 fp8/fp8 PS catch-all shapes. |
aiter/ops/attention.py |
Adjusts qseqlen-fold sizing heuristics and tile sizing for gfx950 shapes to match updated native support. |
aiter/mla.py |
Replaces older fp8/fp8 PS special-cases with a unified gfx950 catch-all dispatch condition and simplifies folding logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shengnxu
previously approved these changes
May 29, 2026
shengnxu
approved these changes
Jun 2, 2026
amirumoAMD
pushed a commit
that referenced
this pull request
Jun 2, 2026
…_a8w8_qh32_qseqlen4_gqaratio32_ps (#3380) * mla_a8w8_qh32_qseqlen4_gqaratio32_ps support gqa_ratio Co-authored-by: Cursor <[email protected]> * fix the kernel error * fix the use_qseqlen_fold * fix the err * del the unuse code * add return lse kernel * only nhead=32 64 128 go through 32mx4 * fix the mi300 error --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Xin Huang <[email protected]> Co-authored-by: Xu, Shengnan <[email protected]>
4 of 6 tasks
hubertlu-tw
added a commit
to hubertlu-tw/aiter
that referenced
this pull request
Jul 9, 2026
Keep the ROCm#3380 folded kernel route but pass the qh32/qseqlen4 launcher stride expected by the kernel, and add a focused persistent MLA regression preset for the SGLang batch-stride failure.
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
This PR extends the gfx950 (MI350) MLA persistent-scheduling (PS) fp8/fp8 dispatch to support additional GQA shapes where nhead=32,4 64,2 64,3 64,4 128,1 128,2 128,3 128,4 by routing them through the existing mla_a8w8_qh32_qseqlen4_gqaratio32_ps entry, and updates Python/C++ dispatch and test-side shape gating to match.
Technical Details
Add a gfx950 fp8/fp8 PS “GQA catch-all” dispatch condition (32,4 64,2 64,3 64,4 128,1 128,2 128,3 128,4) and route to the gqa=32, qseqlen=4 PS kernel entry while passing runtime gqa_ratio via s_MQA.
Align Python dispatch/metadata sizing and test reference gating with the new catch-all rules; remove older special-cased branches.
Update MLA device-metadata native-support rules and folding logic to reflect the new native shape set.
Test Plan
python3 op_tests/test_mla_persistent.py -d fp8 -kvd fp8 -n 16,1 16,2 16,3 16,4 32,1 32,2 32,3 32,4 48,1 48,2 48,3 48,4 64,1 64,2 64,3 64,4 80,1 80,2 80,3 80,4 96,1 96,2 96,3 96,4 112,1 112,2 112,3 112,4 128,1 128,2 128,3 128,4 -c 21 64 256 512 1200 3200 5200 8192 16384 -b 1 3 5 16 32 64 128
python3 op_tests/test_mla_persistent.py -d fp8 -kvd fp8 -n 64,2 64,3 64,4 128,1 128,2 128,3 128,4 -c 21 -b 1 3 5 64 -lse
Test Result
Submission Checklist