Repository navigation
fix(mla): bypass fp8 qseqlen2 kernel precision issue on gfx950 - #3013
Closed
fangche123 wants to merge 2 commits into
Closed
fangche123 wants to merge 2 commits into
fangche123 wants to merge 2 commits into
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 adjusts the MLA ASM decode kernel dispatch on gfx950 to avoid a known FP8 precision issue for max_seqlen_q == 2 by selecting the qseqlen=4 specialization instead of the qseqlen=2 specialization. It is a targeted architecture-specific workaround in the low-level MLA decode path.
Changes:
- Update FP8 decode kernel selection for
gqa_ratio == 16so gfx950 no longer dispatches theqseqlen=2kernel. - Fall back to the existing
qseqlen=4dispatch path on gfx950 formax_seqlen_q == 2. - Leave behavior unchanged for other architectures, including gfx942.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
The mla_a8w8_qh16_qseqlen2_gqaratio16_ps kernel has a precision bug on gfx950 where decode error grows with batch size (max abs delta reaches 0.22 at bs=128).
Workaround: on gfx950, route fp8 decode_qlen=2 to the qseqlen4 kernel (padding 2→4) which has correct precision and equivalent performance. Other architectures (gfx942) are unaffected.
Technical Details
Test Plan
Test Result
Submission Checklist