Repository navigation
feat(kimi-k3): PP8 P/D prefill 3/4 — KV and KDA state from a PP prefill to a DCP × TP decode - #3069
wanzhenchn wants to merge 15 commits into
Conversation
…code The K3 builder places MLA rows and KDA slots by module layer and publishes each slot region's TP segments, and the producer writes the consumer rank's share, ReplaySSM records included. A decode TP that is not a multiple of the prefill TP, a consumer outside the producer's head group and a chunked receive by a DCP decode of a stateful model are refused. PP stages 1..7 drop a request's producer entry once its write completes. Co-authored-by: Cursor <cursoragent@cursor.com>
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
gsm8k/lm_eval for the PP8xTP1 -> TP8xDCP8 cell?
ci green.
Co-authored-by: Cursor <cursoragent@cursor.com>
…ttributes #2809's test_pd_checks_physical_layout_before_writing builds the Mooncake connector as a SimpleNamespace, so it needs the three slot-region attributes this PR reads, set to None as in the other connector fakes. Co-authored-by: Cursor <cursoragent@cursor.com>
valar-cop
left a comment
There was a problem hiding this comment.
the sparse-mla pp refusal looks right now, one thing left..
ci Run non-GPU unit tests (Pre Checkin) failed — not sure yet (low): The captured log is empty (0 bytes), so the failed step and the failing test cannot be identified. The same job passed 8/8 recent runs on main and 5/7 on other recent runs, so neither the PR nor CI can be blamed from this evidence.
next: Re-run the job and share the failing step's log; if it reproduces on the head, check whether it also fails at the merge base. https://github.com/ROCm/ATOM/actions/runs/42758671954/job/129638942868
|
@valar-cop pls review |
|
@Jasen2201 already looked at 4e06431, nothing new since my last review. say |
|
@valar-cop re-review |
# Conflicts: # atom/kv_transfer/disaggregation/mooncake/mooncake_connector.py # tests/test_gdn_state_relocation.py
…butes Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # atom/model_ops/attentions/kimi_mla_gdn_attn.py
Stack
Part 3 of 4 of the Kimi-K3 PP8 prefill for P/D serving, split from #2709 to fit ATOM's limit of 1,000 changed lines and 15 files. Merge in this order:
main.The diff shown is against #3068. Once #3068 merges, this PR is rebased onto
main.Motivation
For AgentX 1M P/D at C32–C88, the fastest prefill measured was PP8×TP1 feeding a TP8×DCP8 decode: at C32, 10,409 vs 9,196 tok/s/GPU for a TP8EP8 prefill (+13%). That topology was refused at startup.
Changes
tp_rank % remote_tp_sizeis right only for replicated KV.main's MoRIIO connector also moves K3's state, but it reads none of this placement, so it keeps refusing PP.has_mla_indexer, e.g.glm5_next_text) has indexer regions that no stage places, so it keeps refusing PP too, now by name.Tests
ruffandblackare clean.test_gdn_state_relocation.py: the builder fixture now describes which layers a PP stage holds, and the TP size the builder reads.test_pipeline_parallelism_is_refusedbecomestest_moriio_keeps_refusing_pp, since only MoRIIO still refuses PP.test_deepseek_v4_transfer_regions.py,test_pd_chunked_transfer.pyandtest_v41_index_layout.py: their connector fakes set the three new slot-region attributes toNone.entrypoints/test_pd_prompt_token_ids.py: one admission test's decode config setsdecode_context_parallel_size=1.mainmerged in) it failed three cases oftest_v41_index_layout.py, which came in withmain(feat(indexer): migrate V4 and V4.1 FP4 scoring to the OPUS config API #2809) and whose connector fake lacked those attributes. 3f2e304 adds them.test_gdn_state_relocation.pyneeds aiter, so CPU runs skip it. On 56bcaa3, the offload, state, PP, DCP and P/D tests pass locally on CPU: 3,576 passed, 352 skipped. On a GPU (rocm/atom-dev:nightly_202611021458),test_kda_layout_id.py,test_gdn_state_relocation.py,test_pd_pp.py,test_lmcache_offload_connector.py,test_pd_mla_staging.pyandtest_pd_mla_landing.pygive 676 passed and none skipped on ad9d6d2, beforemainwas merged in.Related