[DCP][Kimi-k3] Decode on the gathered head width - #2060
Merged
Conversation
Contributor
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
Signed-off-by: whx-sjtu <xiaowang990929@gmail.com>
Signed-off-by: whx-sjtu <xiaowang990929@gmail.com>
whx-sjtu
force-pushed
the
hexwang/mla_nhead96
branch
from
August 31, 2026 07:34
cf6580d to
5a8c47f
Compare
whx-sjtu
marked this pull request as ready for review
August 31, 2026 07:37
whx-sjtu
requested review from
ZhangLirong-amd and
valarLip
and removed request for
valarLip
August 31, 2026 10:42
valarLip
approved these changes
Aug 31, 2026
zejunchen-zejun
approved these changes
Aug 31, 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
After ROCm/aiter#4964, we can run q_head 96 mla cprr directly without padding to 128.
Two changes, the first two on the Kimi-K3
tp8 + dcp8decode path.Drop the MLA decode head padding (
attention_mla.py).mla_dcp_kernel_num_headsrounded the gathered width (num_heads * dcp) up to one of(16, 32, 64, 128), on the premise that aiter's fold onto the 16-head kernel desynchronises the DCP round-robin causal mask. That premise no longer holds — aiter now rebuildsqo_indptrand the kv indptrs as part of the fold, so every multiple of 16 is correct. A persistent decode now dispatches on the gathered width as-is, which is what lets K3tp8+dcp8(12 × 8 = 96) reach the 96-head kernel instead of padding to 128: 183.6us vs 190.8us at fp8 / ctx 32k / bs 64 / qlen 4.Fuse add + RMSNorm in the K3 DSpark draft. Thread
residualthrough the draft layers so the norms take their fused add form, in both the native and vLLM model files.