mixed-mla: replace AITER reference with pure pytorch baseline#113
Open
theodorechapman wants to merge 2 commits intogpu-mode:mainfrom
Open
mixed-mla: replace AITER reference with pure pytorch baseline#113theodorechapman wants to merge 2 commits intogpu-mode:mainfrom
theodorechapman wants to merge 2 commits intogpu-mode:mainfrom
Conversation
pure PyTorch baseline
danielhua23
reviewed
Mar 8, 2026
| The reference kernel quantizes Q to fp8 on-the-fly and uses fp8 KV (a8w8 kernel), | ||
| which is ~2-3x faster than bf16 on MI355X with negligible accuracy loss. | ||
|
|
||
| Decode only — persistent mode with get_mla_metadata_v1. |
Contributor
There was a problem hiding this comment.
keep these introduction
Author
There was a problem hiding this comment.
Had this fixed locally haha, just pushed
Contributor
|
initial ok for me, but we need check if the two impls are exactly the same, since this is weekedn, we will answer you in two days |
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.
This replaces the
mixed-mlareference implementation with a pure PyTorch baseline so the task no longer depends on AITER compilation, which has been slowing down submission time for the AMD competitiongenerate_input(...)ref_kernel(...)check_implementationkv_datageneration forbf16,fp8, andmxfp4This submission is not bitwise identical to the old mla_decode_fwd path.
However, When tested on a MI355X, the code passed comprehensive tests against the current AITER reference with max error in the
3.8e-06to1.5e-05range. Got the same when I submitted it through popcorn as a custom kernel.Only caveat is that this implementation is much slower then the AITER reference. AITER reference sits around 200µs whereas this Pytorch implementation sits around 4000