[MLA] Support 96-head 128-dim reduction - #4625
Open
LiuYinfeng01 wants to merge 2 commits into
Open
Conversation
Enable Kimi K3 PP8 to build its MLA reducer from source and add correctness coverage for the production head shape.
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Keep the existing persistent-grid test layout unchanged and compatible with the repository Black check.
valarLip
approved these changes
Aug 8, 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.
Summary
96 heads × 128 value dimensionspecialization toMLA_REDUCE_ROUTERop_tests/test_mla_reduce.pyMotivation
Kimi K3 uses 96 MLA query heads with a 128-dimensional value/output head. In a PP8 deployment every pipeline rank still executes attention with all 96 heads, so the phase-2 MLA reducer is called with:
The reducer already had a
96 × 512specialization, butMLA_REDUCE_ROUTERdid not contain96 × 128. As a result, a clean JIT build could compilemodule_mla_reducefrom the sources listed inaiter/jit/optCompilerConfig.json, but the resulting module rejected the Kimi shape at dispatch time:This is an AITER reducer dispatch gap, not a Triton head-count limitation and not a precompiled-binary issue.
module_mla_reduceis already correctly sourced frommla_reduce_pybind.cuandreduce.cuinoptCompilerConfig.json; no JIT configuration change is needed once the missing template specialization is present.Validation
Hardware: MI355X (
gfx950)Clean-cache command:
Observed clean build:
All cases passed against the Torch reference with
rtol=2e-2,atol=2e-2, and finite output/LSE checks. The new96 × 128,q_len=1coverage passed:These cover the simple reducer, massive reducer, ragged/mixed split counts, LDS-spill bucket, and persistent-grid path.