Repository navigation
[Feature][KV Pool] Enable Mooncake layerwise pooling for DeepSeek V4.1 - #22988
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for DeepSeek V4.1 Prefill using the Mooncake backend with layerwise transfer. It updates the AscendStoreConnector and pool worker to support composite KV loads and saves when using the block_key layerwise data plane, and refines prefetching and fencing logic for shared-source segments. It also adds corresponding unit tests and updates the user guide documentation. The reviewer noted that because this PR introduces user-facing changes, a release notes fragment must be added under the release_notes/fragments directory in accordance with the repository style guide.
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. 🤖 How to trigger CI
Note Until the CI gate has run on a commit, the required Tip 💡 Consider Linking a Related Issue or RFCYour PR title contains the [Feature] tag, indicating a bug fix or new feature. Linking a related issue or RFC in the PR description is strongly encouraged — it gives reviewers helpful context and speeds up the review. You can use any of these keywords:
🙏 Thanks for helping us keep the project well-organized! |
Coverage
More info see: Summary |
|
Last updated: 2026-11-26 02:24 UTC+8 for commit
|
|
/run [Bot]: run command accepted. E2E has been queued on the latest commit |
Head branch was pushed to by a user without write access
|
/run [Bot]: run command accepted. E2E has been queued on the latest commit |
189d5d3 to
29b814c
Compare
|
/run |
Head branch was pushed to by a user without write access
|
/run |
ce30c8f to
ca3f071
Compare
|
/run |
ca3f071 to
6a1c864
Compare
|
/run [Bot]: run command could not start E2E on commit Nothing has been queued for this PR. Details are in the handler run log. Please retry |
|
/run |
Enable shared-source callbacks, asynchronous read-ahead, resident prefill prefixes, and batched Mooncake range/session preparation. Preserve main load/save gates and boundary publication metadata. Rebase onto current main and retain its scoped PP collective test fixture instead of duplicating the previous fixture fix. Keep linear history compatible with the CI source-snapshot rebase. Validation: forced local rebase onto main passes; Ruff lint/format, Python compilation and git diff --check pass for all 13 changed files. CPU/mock PP lookup probe passes 2 tests and 16 subtests using host-supplied resolved single-group metadata. Layerwise range/key suites pass 35 tests and 34 subtests with host-only upstream compatibility shims. Full vLLM and NPU validation remains for CI. Signed-off-by: fangrongcan <17343701736@163.com> Signed-off-by: fangrongcan <60131170+Eric-dot@users.noreply.github.com>
6a1c864 to
df841b6
Compare
|
/run [Bot]: run command accepted. E2E has been queued on the latest commit |
What this PR does / why we need it?
DeepSeek V4.1 Prefill can use Mooncake layerwise KV pooling with the same composite callbacks, execution-layer slots, and
kv_source_layer_idsprefetch schedule introduced for Memcache in #21949. Layers without poolable cache groups advance the schedule without I/O. Mooncake continues to use its existing batched range GET/PUT, object layout, and commit/revoke handling.Lookahead stays asynchronous without a DS4.1 attention-start gate. A device event orders upcoming reads against earlier compute, and save-only shared-source steps skip this fence. Eligible Mooncake layerwise Prefill workers prefetch up to two shared KV source layers ahead by default. On an empty execution layer, the receive thread waits on the device event while the model can keep running.
This overlaps #22256. This branch also checks and skips the no-load device fence.
The follow-up performance commits keep eligible full-attention prefixes resident across uninterrupted DSv4.1 Prefill chunks. The worker skips repeat Mooncake reads when the running-request metadata confirms that the saved prefix is already computed. Requests can reuse resident full-attention blocks with local automatic prefix caching (APC) on or off. An explicit external load still fetches the missing range, and resumed requests wait until a later uninterrupted chunk to qualify. The commits also batch session-tracker updates, vectorize range address calculation, and reuse range argument arrays when all rows remain active. On independent Store TE workers that contribute memory,
preferred_segmentuses the segment returned by the Store when available.Does this PR introduce any user-facing change?
Yes. For DeepSeek V4.1 Prefill on Model Runner V2 in eager mode, set
"backend": "mooncake"and"use_layerwise": trueonAscendStoreConnector. In a P/D composite deployment, the separateMooncakeConnectorV2extra config controls P/D Push.How was this patch tested?
get_pp_indicesandhas_connector_metadata. The broader mock run reported the same 50 failure IDs as the unmodified baseline3f33f0d263, with 928 passing tests on the patch and 925 on the baseline. Three other modules could not be collected with the local mocks.git diff --checkpassed. The fullbash format.sh cirun passed the formatter and ActionLint hooks, with Windows launcher and ShellCheck availability failures in other hooks.Follow-up performance validation (
14ad098251)0865c8b866. Ruff lint, Ruff format, andgit diff --checkpassed for the latest change.Read preparation follow-up (
e31e6d122)git diff --checkpassed. The full format script still reported Windows launcher and ShellCheck availability failures.Default read-ahead validation (
f288f62c1)git diff --checkpassed. NPU validation on this commit remains pending.Previously reported DSv4.1 performance results
Case 1 uses the HBM prefix cache. Case 2 uses Mooncake layerwise pooling. Positive relative degradation denotes higher latency or lower throughput.
Case 2 passed all three thresholds.
Checklist
Boundary / edge-case coverage
Regression test
Error / failure path coverage
Meaningful & reliable tests
NPU performance validation for the previously reported comparison
NPU performance validation for the read preparation follow-up
vLLM main: vllm-project/vllm@c410543