Skip to content

[DSA] Clarify pooled-page naming and ownership - #42671

Merged
kpham-sgl merged 7 commits into
sgl-project:mainfrom
kpham-sgl:codex/pr-42178-ke-comments
Oct 7, 2026
Merged

kpham-sgl merged 7 commits into
sgl-project:mainfrom
kpham-sgl:codex/pr-42178-ke-comments

Conversation

@kpham-sgl

@kpham-sgl kpham-sgl commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #42178 addressing Ke's naming and readability comments.

Rename DSA page geometry throughout runtime consumers and fixtures: slots_per_page → index_page_size, real_page_size → physical_page_size, and the k-pool ratio pool_size → kpool. Also use cfg.dcp_size directly and explain why a logical page must own a whole pooled index group.

No additional Mamba startup rejection: mamba_track_grid already uses LCM with the final tree page, including DCP widening and the k-pool logical page size. Requested intervals of 64/128 can therefore produce an aligned effective interval of 256. The existing startup validator remains.

Validation: pre-commit, git diff --check, rename equivalence, 48 source-extracted configuration checks, and focused LCM checks passed. Full unit/GPU tests were not run locally.


CI States

Latest PR Test (Base): ⏳ Run #37512806213
Latest PR Test (Extra): ✅ Run #37512805411
Latest PR Test (AMD ROCm 10): ⏳ Run #37512806142

non_mechanical_provable: Check track intervals against the DSA logical page size after it is resolved, use the declared DCP field directly, and explain pooled-page ownership. Add startup coverage for invalid and valid intervals and cache-strategy exclusions.
mechanical_provable: Rename slots_per_page to index_page_size, real_page_size to physical_page_size, and the DSA k-pool ratio from pool_size to kpool. Update runtime consumers, host pools, metadata kernels, and fixtures together; preserve the unrelated compressed-KV slot counts.
non_mechanical_provable: Remove the additional pooled-DSA startup rejection and its test. mamba_track_grid already aligns decode checkpoints to the final tree page through LCM, so requiring the raw interval to divide the logical page rejects otherwise supported configurations.
@kpham-sgl kpham-sgl changed the title [DSA] Follow up on pooled-page validation and naming [DSA] Clarify pooled-page naming and ownership Oct 6, 2026
@kpham-sgl kpham-sgl added run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) labels Oct 6, 2026
@vincentzed

Copy link
Copy Markdown
Contributor

Heads-up from testing DSv4 on main (44a2558d40): #42178 broke the DSv4 non-paged indexer path, and this PR carries the break forward under the new name.

  1. index_buf_accessor.GetKAndS.triton now reads pool.slots_per_page (pool.index_page_size after this PR).
  2. DeepSeekV4IndexerPool also goes through that accessor (deepseek_v4_memory_pool.py, get_index_k_scale_buffer) and only has page_size. This PR does not touch that pool.
  3. Result on main, deepseek-ai/DeepSeek-V4-Flash-0731, first prefill of ~2.3k prompt tokens:
File "sglang/srt/layers/attention/dsv4/indexer.py", line 970, in forward_c4_indexer
    kv = self._gather_nonpaged_index_k(
File "sglang/srt/mem_cache/deepseek_v4_memory_pool.py", line 635, in get_index_k_scale_buffer
    return index_buf_accessor.GetKAndS.execute(
File "sglang/kernels/ops/attention/dsa/index_buf_accessor.py", line 257, in triton
    page_size=pool.slots_per_page,
AttributeError: 'DeepSeekV4IndexerPool' object has no attribute 'slots_per_page'
  1. Seen on the prefill role of a PD pair, with both --dsv4-attn-backend flashmla and trtllm. ~250-token prompts pass. Not yet reproduced on a non-PD server.
python3 -m sglang.launch_server --trust-remote-code \
  --model-path deepseek-ai/DeepSeek-V4-Flash-0731 --tp 2 \
  --moe-runner-backend flashinfer_mxfp4 --speculative-algorithm DSPARK \
  --swa-full-tokens-ratio 0.1 --mem-fraction-static 0.80 \
  --disaggregation-mode prefill --disaggregation-transfer-backend mooncake

Since this PR is renaming the attribute anyway: could DeepSeekV4IndexerPool get index_page_size here (its page_size), or the DSv4 call site keep pool.page_size? Happy to send that as a separate fix if you prefer.

@kpham-sgl

Copy link
Copy Markdown
Collaborator Author

/rerun-failed-ci

@kpham-sgl
kpham-sgl merged commit 9e26600 into sgl-project:main Oct 7, 2026
425 of 466 checks passed
cursor Bot pushed a commit to cipheraxat/sglang that referenced this pull request Oct 9, 2026
ormandj added a commit to ormandj/sglang that referenced this pull request Oct 10, 2026
Main renamed fast_kpool_topk_transform_fused's pool_size to kpool (sgl-project#42671). The overflow cases pass against main's exact rescan.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) deepseek hicache Hierarchical Caching for SGLang jit-kernel memory-pool run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants