Repository navigation
Conversation
Add CP/TP sharing, PCP8/EP8 MegaMoE, DFlash and PP breakable prefill graph support, row/DSA preparation fusion, CP-spanning shared experts, and PCP-aware Mooncake L3 deduplication and RDMA reads. Adapt the extraction to main's current KDA waits, KV interfaces, indexer API and MegaMoE fast paths. Retain the final donor's reverts. Source: #48414 at 0ec7cb2 Origins: radixark/sglang-k31#22, #34, #37, #51, #76, #80, #110, #147 Co-authored-by: Yuhao Yang <[email protected]> Co-authored-by: Baizhou Zhang <[email protected]>
41 of 42 tasks
This was referenced Nov 5, 2026
Fridge003
added a commit
that referenced
this pull request
Nov 5, 2026
Fridge003
added a commit
that referenced
this pull request
Nov 6, 2026
Port of radixark/sglang-k31#22, split out of #48504. Enable `--enable-prefill-cp --cp-strategy interleave --attn-cp-size N` for Kimi-K3.1 on the prefill CP layer-boundary framework: - Share the CP and TP groups for KimiK31ForConditionalGeneration. - Partition KDA heads over linear_attn_parallel_group() (the TP group under CP-TP group sharing) and reorder KDA rows between interleave and sequence order around the recurrence. - Keep the latent MoE off the residual stream under attention CP and reduce-scatter its sum onto this rank's CP rows (output_on_cp_shards). - Shard the embeddings in the model and gather the rows, plus DFlash aux hidden states, before the logits. - Allow a Kimi-K3.1 PD prefill node with DFLASH; reject decode nodes and Kimi-K3 prefill CP. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
added a commit
that referenced
this pull request
Nov 6, 2026
…prefill CP Port of radixark/sglang-k31#34, split out of #48504 and rebased onto #46890. - MegaMoE: mask the CP padding rows of a static graph bucket before dispatch and after combine; allocate the EP symmetric workspace at load so it counts against the KV budget; bound the Kimi MegaMoE eager decode / verify rows and the prefill rows (chunk, max prefill tokens and prefill graph buckets) in the token-budget check. - Breakable prefill graphs: admit Kimi-K3.1 to the interleave BCG adapter (EP only as MegaMoE over the CP group); run the DSA indexer split op on this rank's live rows and keep the unused top-k rows at -1, also during capture (on_capture). - trtllm DSA: pad 65-127 query heads to 128 for trtllm-gen (attention TP 1 under CP-TP group sharing leaves every head on one rank). - DFlash: allow integrated as well as PD prefill; let a PD pair register a replicated MLA draft KV across different physical TP sizes. - Size the linear-attention verify scratch for CUDA graph batch padding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
added a commit
that referenced
this pull request
Nov 6, 2026
…CP row copies Port of radixark/sglang-k31#51, split out of #48504. - mega_moe_pre_dispatch: take an optional device count of live rows and zero the input / route the padding rows to -1 inside the kernel, so a replayed graph bucket needs no separate masking pass. - attention.indexer_q_quant_head_gate: one Triton kernel for Kimi's no-RoPE indexer Q quantization and BF16 head-gate scaling in the prefill split op. - memory.interleave_rows: coalesced copies between interleave CP rank order and sequence order (KDA reorder, aligned CP gathers). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
added a commit
that referenced
this pull request
Nov 6, 2026
…ll CP Port of radixark/sglang-k31#80, split out of #48504. - Let interleave CP BCG run on pipeline stages for Kimi-K3.1: a later stage takes the previous stage's CP-local hidden states, so only positions are sharded; middle stages send the rows an eager stage would send. - Size the PP proxy per capture bucket to its CP-local rows and zero the rows past the received shard so a replay never reads a previous replay's rows. Zigzag BCG keeps pp_size == 1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
added a commit
that referenced
this pull request
Nov 6, 2026
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]>
Fridge003
added a commit
that referenced
this pull request
Nov 6, 2026
Port of radixark/sglang-k31#31, split out of #48504. - Allow --dsa-prefill-backend / --dsa-decode-backend trtllm for Kimi-K3.1 (the default stays flashmla_kv; ROCm keeps triton). Both phases read one KV pool and PD peers exchange it, so they must match; an unset phase follows the set one. trtllm is rejected with --dcp-size > 1 for now. - Mooncake: reject a non-DCP MLA P/D pair whose per-page KV item lengths differ (flashmla_kv 656 B vs trtllm 576 B per token) instead of silently copying mismatched rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
added a commit
that referenced
this pull request
Nov 7, 2026
…prefill CP Port of radixark/sglang-k31#34, split out of #48504 and rebased onto #46890. - MegaMoE: mask the CP padding rows of a static graph bucket before dispatch and after combine; allocate the EP symmetric workspace at load so it counts against the KV budget; bound the Kimi MegaMoE eager decode / verify rows and the prefill rows (chunk, max prefill tokens and prefill graph buckets) in the token-budget check. - Breakable prefill graphs: admit Kimi-K3.1 to the interleave BCG adapter (EP only as MegaMoE over the CP group); run the DSA indexer split op on this rank's live rows and keep the unused top-k rows at -1, also during capture (on_capture). - trtllm DSA: pad 65-127 query heads to 128 for trtllm-gen (attention TP 1 under CP-TP group sharing leaves every head on one rank). - DFlash: allow integrated as well as PD prefill; let a PD pair register a replicated MLA draft KV across different physical TP sizes. - Size the linear-attention verify scratch for CUDA graph batch padding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
added a commit
that referenced
this pull request
Nov 7, 2026
…CP row copies Port of radixark/sglang-k31#51, split out of #48504. - mega_moe_pre_dispatch: take an optional device count of live rows and zero the input / route the padding rows to -1 inside the kernel, so a replayed graph bucket needs no separate masking pass. - attention.indexer_q_quant_head_gate: one Triton kernel for Kimi's no-RoPE indexer Q quantization and BF16 head-gate scaling in the prefill split op. - memory.interleave_rows: coalesced copies between interleave CP rank order and sequence order (KDA reorder, aligned CP gathers). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003
added a commit
that referenced
this pull request
Nov 7, 2026
…ll CP Port of radixark/sglang-k31#80, split out of #48504. - Let interleave CP BCG run on pipeline stages for Kimi-K3.1: a later stage takes the previous stage's CP-local hidden states, so only positions are sharded; middle stages send the rows an eager stage would send. - Size the PP proxy per capture bucket to its CP-local rows and zero the rows past the received shard so a replay never reads a previous replay's rows. Zigzag BCG keeps pp_size == 1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Part of #48414
CI States
Latest PR Test (Base): ❌ Run #41954074888
Latest PR Test (Extra): ❌ Run #41954074850
Latest PR Test (AMD ROCm 10): ❌ Run #41954074463
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: