Repository navigation
[Feat] kimi-k3.1: Let shared-expert TP span interleave prefill CP - #48713
Merged
Merged
Conversation
Fridge003
requested review from
ch-wan,
hubertlu-tw,
merrymercy and
yizhang2077
as code owners
November 5, 2026 20:28
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
This was referenced Nov 5, 2026
41 of 42 tasks
Fridge003
commented
Nov 6, 2026
| f"of attention TP size ({attn_tp_size})." | ||
| f"of attention replica size ({replica_size}, attention TP x CP)." | ||
| ) | ||
| if attn_tp_size % size != 0 and not ( |
Collaborator
Author
There was a problem hiding this comment.
Remove line235-240. Shared expert TP is not related to cp strategy
Collaborator
Author
There was a problem hiding this comment.
Removed in adbc89d. Only the divisor check against attention TP x CP is left.
| else: | ||
| allocation.assert_not_called() | ||
|
|
||
| def test_pcp8_weight_shards_and_padded_local_rows(self): |
Collaborator
Author
There was a problem hiding this comment.
Remove this unit test
Port of radixark/sglang-k31#147, split out of #48504. With interleave prefill CP the FFN sees equal padded token-row shards, so the shared experts can gather rows over CP as well as attention TP and reduce-scatter back. --shared-experts-tp-size may now divide attention TP x CP (it still never crosses attention DP replicas or PP stages); a width beyond attention TP requires --enable-prefill-cp --cp-strategy interleave. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shared-expert TP is independent of the CP strategy, so a width beyond attention TP no longer requires --cp-strategy interleave; the divisor check against attention TP x CP stays. The PCP8 MLP-shard unit test is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
force-pushed
the
k31-pcp/shared-experts-tp
branch
from
November 6, 2026 08:50
2c7f916 to
adbc89d
Compare
Collaborator
Author
|
/rerun-test test/registered/unit/distributed/test_parallel_state.py |
Contributor
|
🚀 |
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.
Original authors: @Fridge003
Port of #48414
Shared-expert TP across interleave prefill CP (radixark/sglang-k31#147), split from #48504. Independent of the prefill-CP stack.
Split of #48504. Stack: #48709 (core) → #48710 (MegaMoE / BCG / DFlash) → #48711 (fused kernels) → #48712 (PP × PCP BCG). Independent: #48713 (shared-expert TP across PCP), #48714 (trtllm DSA), #48715 (Linker PCP L3).
Modifications
--shared-experts-tp-sizemay divide attention TP × CP; a subgroup still never crosses attention DP replicas or PP stages. A width beyond attention TP requires--enable-prefill-cp --cp-strategy interleave, where the FFN sees equal padded token-row shards: the shared experts gather rows over CP as well as attention TP and reduce-scatter back.initialize_model_parallel: rank layout[PP, attention DP, CP, attention TP], contiguous shared-expert groups.Tests
test_parallel_state.py: shared-expert groups span PCP without crossing DP or PP.test_kimi_mlp_parallel_groups.py: PCP8 weight shards and padded local rows against a dense reference.🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #42190530791
Latest PR Test (Extra): ❌ Run #42190530760
Latest PR Test (AMD ROCm 10): ❌ Run #42190530697
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: