Repository navigation
Conversation
…ackend Follow the MLA DCP split of ownership with DSA-specific entry points: - prepare_decode_context_parallel_metadata_dsa (planner) builds this rank's prefix rows and a buffer laid out request after request, the order the ragged top-k indices address; - all_gather_kv_cache_for_extend_dsa (comm) all-gathers the cached prefix rows and encodes the extend tokens as the pool writes them (fp8_ds_mla quantization, or the raw cast-on-write layout); - bcg_dcp_extend_kv_gather_dsa (forward_mla) and the MHA one-shot path call it; the flashmla_kv and trtllm prefill paths only read attn_dcp_metadata.dcp_kv_buffer. Target verify still attends over the local shard. Kimi-K3 picks the DSA planner when index-K is sharded, so K3.1 no longer allocates the unused MLA gather buffer.
41 of 42 tasks
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.
Moves the Kimi-K3.1 DCP prefill KV all-gather out of the DSA attention backend, following the ownership the MLA DCP path already has on main, with DSA-specific entry points. Landing it here first lets the DCP runtime port (#48721) take it as a plain port.
Modifications
layers/dcp/planner.py)prepare_decode_context_parallel_metadataprepare_decode_context_parallel_metadata_dsa->DecodeContextParallelMetadataDsalayers/dcp/comm.py)all_gather_kv_cache_for_mla_extendall_gather_kv_cache_for_extend_dsaforward_mla.py)bcg_dcp_extend_kv_gatherbcg_dcp_extend_kv_gather_dsa; also called on the MHA one-shot pathattn_dcp_metadata.dcp_kv_bufferattn_dcp_metadata.dcp_kv_buffer0..seq_len-1, padded to a page: the order the ragged top-k indices already address, so no index remapping.dcp_gather_kv_cacheandDSAMetadata.dcp_local_kv_rowsare removed; the flashmla_kv and trtllm prefill paths read the buffer. Target verify still attends over the local shard.Tests
Not run yet; static checks only (
pre-commit, ruff F, py_compile). Owed: Kimi-K3.1 TP8/DCP8 prefill with a cached prefix against DCP1 (GSM8K via sgl-eval and a logprob comparison), on both the flashmla_kv and trtllm DSA prefill backends.CI States
Latest PR Test (Base): ❌ Run #42339754403
Latest PR Test (Extra): ❌ Run #42339754393
Latest PR Test (AMD ROCm 10): ❌ Run #42339754358
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: