Skip to content

[Feat] linker: Support Kimi-K3.1 DSA, MLA draft and DCP pools in the direct linker - #49355

Merged
kpham-sgl merged 8 commits into
sgl-project:mainfrom
alphabetc1:feat/linker-kimi-k31-pools
Nov 10, 2026
Merged

kpham-sgl merged 8 commits into
sgl-project:mainfrom
alphabetc1:feat/linker-kimi-k31-pools

Conversation

@alphabetc1

@alphabetc1 alphabetc1 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Original authors: @Fridge003, @yhyang201, @kpham-sgl

Port of #48414

Kimi-K3.1 pairs DSA attention (MLA KV plus an indexer) with KDA linear attention. On main the direct external linker's FULL + MAMBA pool group accepts only a plain MLA pool, rejects DCP and has no MLA draft sidecar, so --enable-unified-cache-external-linker refuses Kimi-K3.1. This PR ports the linker pool support from the Kimi-K3.1 Day-0 branch (#48414).

  • DSA: the indexer moves as its own pool, one row per KV page; shared-topk layers keep zero-row placeholders and are skipped.
  • An MLA draft KV pool (the DFLASH draft) is a DRAFT sidecar.
  • Pools that are byte-identical across attention TP (MLA KV, indexer, MLA draft) are keyed without the TP rank and written by TP rank 0 only; the TP-sharded KDA state keeps per-rank keys.
  • DCP: KV, indexer and a DCP-collapsed draft map this rank's share of a page; their keys add the DCP rank, and the first DCP block writes them.

Against the raw port: comments are shortened, and the draft is treated as DCP-sharded only when --dcp-size > 1.

Left for later ports: the per-request load timing log (the branch has no switch for it yet). The DFLASH draft KV ring and the cutedsl_mla draft backend come with the DFlash drafter port (#49110); until then a Kimi-K3.1 DFLASH draft on main runs on the triton draft backend, with its KV in the DRAFT sidecar.

Modifications

  • mem_cache/hybrid_cache/linker_pool_assembler.py: DSA indexer pool, MLA draft sidecar, tp_replicated / dcp_sharded pool flags, DCP index mapping.
  • mem_cache/storage/mooncake_store/mooncake_direct_linker.py, mooncake_store.py: per-pool key suffixes and offload owners.

Tests

GSM8K
No linker 98.03% (1293/1319)
Linker 98.18% (1295/1319), 0 failed loads
  • Not run end to end: DCP.

Touches the same spot of mooncake_direct_linker.py as #49043 (both add module-level definitions); whichever merges second needs a trivial rebase.


CI States

Latest PR Test (Base): ⏳ Run #42918041414
Latest PR Test (Extra): ⏳ Run #42918041164
Latest PR Test (AMD ROCm 10): ⏳ Run #42918041121

Tip

Base CI only covers the core cases, and its workload may not exercise your change. Use /rerun-test to run the tests your change touches, or copy this prompt for an agent:

Find the registered tests this PR affects and run them with /rerun-test, following https://github.com/sgl-project/sglang/blob/main/.agents/skills/rerun-test/SKILL.md

Co-authored-by: Baizhou Zhang [email protected]
Co-authored-by: Yuhao Yang [email protected]
Co-authored-by: Khoa Pham [email protected]

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@alphabetc1 alphabetc1 added run-ci CI: run the baseline test suite on this PR run-ci-nv-extra CI: NVIDIA/shared Extra suite (requires run-ci) labels Nov 10, 2026
@github-actions github-actions Bot added hicache Hierarchical Caching for SGLang mooncake labels Nov 10, 2026
@kpham-sgl

Copy link
Copy Markdown
Collaborator

Latest PR Test (Base): ✅ Run #42861260361
Latest PR Test (Extra): ❌ Run #42861258573

@kpham-sgl
kpham-sgl merged commit 7dc1e38 into sgl-project:main Nov 10, 2026
106 of 156 checks passed
kpham-sgl added a commit that referenced this pull request Nov 11, 2026
lihenga pushed a commit to lihenga/sglang-sugon that referenced this pull request Nov 18, 2026
…direct linker (sgl-project#49355)

Co-authored-by: Baizhou Zhang <[email protected]>
Co-authored-by: Yuhao Yang <[email protected]>
Co-authored-by: Khoa Pham <[email protected]>
Co-authored-by: kpham-sgl <[email protected]>
(cherry picked from commit 7dc1e38)
lihenga pushed a commit to lihenga/sglang-sugon that referenced this pull request Dec 3, 2026
…direct linker (sgl-project#49355)

Co-authored-by: Baizhou Zhang <[email protected]>
Co-authored-by: Yuhao Yang <[email protected]>
Co-authored-by: Khoa Pham <[email protected]>
Co-authored-by: kpham-sgl <[email protected]>
(cherry picked from commit 7dc1e38)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hicache Hierarchical Caching for SGLang mooncake run-ci CI: run the baseline test suite on this PR run-ci-nv-extra CI: NVIDIA/shared Extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants