Skip to content

[Fix] Share DSA k-pool radix pages at pooled-key group granularity - #41645

Closed
kpham-sgl wants to merge 1 commit into
mainfrom
kpham/fix-dsa-kpool-niah
Closed

kpham-sgl wants to merge 1 commit into
mainfrom
kpham/fix-dsa-kpool-niah

Conversation

@kpham-sgl

@kpham-sgl kpham-sgl commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #41494.

The k-pool indexer stores the pooled index keys of pages 4g..4g+3 in page 4g, but the radix tree shared and deduplicated single 64-token pages. After prefill, cache_unfinished_req repointed a request onto another request's group page, so its decode read that prompt's pooled keys for up to 255 tokens past the divergence point, which in RULER is the needle.

  • Tree page = page_size * index_kpool for k-pool models.
  • Prefill mamba checkpoints use the absolute grid when the tree page is wider than the allocator page.
  • Streaming sessions free KV on the allocator page.
  • HiCache DSA indexer host pool transfers one tree page as several device pages.

GLM-5.3-Flash FP8, TP4 H200, RULER-style niah_single_2 16K (n=20): main 12/20, fix 20/20 (Python and Rust tree core, also with HiCache L2). GSM8K 0.935.


CI States

Latest PR Test (Base): ❌ Run #36535978763
Latest PR Test (Extra): ❌ Run #36535978256
Latest PR Test (AMD ROCm 10): ❌ Run #36535978906

The k-pool indexer stores the pooled index keys of index_kpool consecutive
64-token pages in the first page of the group, but the radix tree shared and
deduplicated single pages. A request whose prompt diverged from a cached one
mid-group was repointed to the other request's group page after its prefill
and read that request's pooled keys for up to 255 tokens past the divergence,
dropping needles from top-k selection (#41494).

Widen the tree page to page_size * index_kpool, place prefill mamba
checkpoints on the absolute grid when the tree page is wider than the
allocator page, free streaming-session KV on the allocator page, and let the
HiCache DSA indexer host pool move one tree page as several device pages.
@kpham-sgl

Copy link
Copy Markdown
Collaborator Author

Closing in favor of a redesign of the DSA k-pool index pool: pooled keys addressed by token slot (index slot = loc // 4) with a 256-slot logical page, matching DeepSeek-V4 C4. That fixes #41494 without splitting the radix tree page from the allocator page, and shrinks the index pool to 1/4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hicache Hierarchical Caching for SGLang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] GLM-5.3-Flash DSA k-pool indexer corrupts long-context (16K) NIAH needle digits — vLLM/transformers read the same inputs correctly

1 participant