Skip to content

[DSV4] Reserve the FULL logical page in the c4 indexer pool like its KV pool - #41163

Merged
hnyls2002 merged 1 commit into
sgl-project:mainfrom
pengwu22:fix/dsv4-c4-indexer-pool-logical-page
Oct 1, 2026
Merged

hnyls2002 merged 1 commit into
sgl-project:mainfrom
pengwu22:fix/dsv4-c4-indexer-pool-logical-page

Conversation

@pengwu22

@pengwu22 pengwu22 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

  • DeepSeek-V4 registers one PD transfer buffer per KV sub-pool and per indexer pool. The NIXL connector assumes they all have the same number of pages: it takes the page count of the first entry and builds descriptor lists of that length for every entry.
  • Since [DSV4] Generalize attention metadata, sparse prefill, and KV pool over compress ratios #39921 the compressed KV pools reserve one full logical page for the dummy page, while the c4 indexer pool still reserves a single physical page. Its entries are now shorter than the first one, descriptor preparation walks past the registered region, and prefill fails with NIXL_ERR_NOT_FOUND.
  • Mooncake does not prebuild full-range descriptor lists, which is why it was not affected.

Pages per registered entry, flash layout (compress ratios 4/128, page size 256):

entry before #39921 main this PR
c4 KV (first entry, sets the slot count) 33 36 36
c4 indexer 33 33 36
c128 KV 33 160 160

Modifications

  • (-) The c4 indexer pool sized itself with its own formula, one physical page above the token count.
  • (+) The indexer pool reserves the same full logical page as the KV pool it pairs with, through the same page-count helper, so no registered entry is shorter than the first. A unit test checks the c4 KV and indexer entries agree (fails on main).

Accuracy Tests

Not applicable: only reserved pages are added, live page addressing is unchanged.

Speed Tests and Profiling

Not applicable: the indexer pool grows by three 64-token pages per layer at page size 256.


CI States

Latest PR Test (Base): ✅ Run #36097602378
Latest PR Test (Extra): ✅ Run #36097602213
Latest PR Test (AMD ROCm 10): ❌ Run #36097602349

@pengwu22

Copy link
Copy Markdown
Contributor Author

/run-ci

@pengwu22

Copy link
Copy Markdown
Contributor Author

/run-extra-ci

@github-actions github-actions Bot added deepseek memory-pool run-ci CI: run the baseline test suite on this PR labels Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ /run-ci isn't a recognized CI command. Did you mean /run-full-ci?

See the command reference.

@github-actions github-actions Bot added the run-ci-extra CI: also run the extra suite (requires run-ci) label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⏳ PR Test Extra is already in_progress for this commit; left it alone.

@pengwu22
pengwu22 force-pushed the fix/dsv4-c4-indexer-pool-logical-page branch from 8b2c56e to 2c01bb0 Compare September 24, 2026 21:57
@pengwu22

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

…KV pool

sgl-project#39921 sized the compressed KV sub-pools with _num_dsv4_physical_kv_pages,
which reserves one FULL logical page (ratio physical pages) for the
allocator's dummy page. The c4 lightning-indexer pool kept the old
(size + page_size + 1) // page_size count, so the PD entries registered by
get_contiguous_buf_infos no longer share one page count: on the flash
layout (ratios 4/128, page 256) rows per entry went from 33 everywhere to
36 (c4 KV) / 33 (c4 indexer) / 160 (c128 KV).

The NIXL connector prepares one destination descriptor list per registered
entry from the slot count the decode advertises for entry 0 (the c4 KV
page count). The indexer entries are three pages shorter than that, the
descriptors walk past their registered region, and the prefill dies with
NIXL_ERR_NOT_FOUND in _prep_equal_tp_dlist. Mooncake does not prebuild
full-range lists and is unaffected.

Give DeepSeekV4IndexerPool the same global_page_size as
DeepSeekV4SingleKVPool and count its pages with the same helper, so the c4
KV and indexer entries are 36/36 again and every entry has at least the
c4 KV page count. Without a global_page_size the helper reduces to the old
count for page-aligned sizes, so the low-ratio index pools and the NPU
packed buffer keep their geometry. The NPU factory accepts the keyword.
@pengwu22
pengwu22 force-pushed the fix/dsv4-c4-indexer-pool-logical-page branch from 2c01bb0 to 1a3449f Compare September 25, 2026 05:12
@pengwu22

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@hnyls2002
hnyls2002 merged commit 1150070 into sgl-project:main Oct 1, 2026
220 of 266 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek 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.

2 participants