[Bugfix][Mooncake] Offload producer partial tails on request finish - #52832
Merged
Merged
Conversation
A producer request that ends on a partial Mamba align block previously dropped that final tail. The boundary was only handed to a connector when a later allocation triggered CoW, which never happens on a prefill-only producer. Finalize the unchanged table source when the request completes exactly at the registered boundary with no tokens in flight. Fan the finish-time handoff through KVConnectorBase and MultiConnector. Mooncake retains the source until the next connector step assigns a store job, then holds a per-job pin until every worker reports completion. Tests: 62 passed across the prefix-cache, Mooncake Store, and focused MultiConnector suites. Pre-commit passed on every changed file. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Dao Le <daole@inferact.ai> Signed-off-by: Dao Le <Dao007forever@gmail.com>
Dao007forever
marked this pull request as ready for review
August 18, 2026 22:20
Dao007forever
requested review from
ApostaC,
WoosukKwon,
ivanium,
orozery and
robertgshaw2-redhat
as code owners
August 18, 2026 22:20
Dao007forever
requested review from
NickLucche,
alexm-redhat,
heheda12345,
njhill,
xuechendi and
ywang96
as code owners
August 18, 2026 22:20
Member
|
/ci run |
|
✅ Triggered Buildkite CI #84497 for commit |
ZJY0516
approved these changes
Aug 21, 2026
Member
|
/ci run |
|
✅ Triggered Buildkite CI #84953 for commit |
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Resolve the vllm-project#51358 overlap by porting finish-time Mamba tail handoffs to exact boundary-state store jobs. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Dao Le <Dao007forever@gmail.com>
Collaborator
|
/ci run |
|
✅ Triggered Buildkite CI #86522 for commit |
Member
|
/ci run |
|
✅ Triggered Buildkite CI #86674 for commit |
mylibrar
pushed a commit
to tanyuqian/vllm
that referenced
this pull request
Sep 3, 2026
…llm-project#52832) Signed-off-by: Dao Le <Dao007forever@gmail.com> Co-authored-by: Roger Wang <hey@rogerw.io> Co-authored-by: OpenAI Codex <noreply@openai.com>
sheralskumar
pushed a commit
to sheralskumar/vllm
that referenced
this pull request
Sep 8, 2026
…llm-project#52832) Signed-off-by: Dao Le <Dao007forever@gmail.com> Co-authored-by: Roger Wang <hey@rogerw.io> Co-authored-by: OpenAI Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Offload a producer's final partial Mamba
aligntail when the request finishes before another allocation can trigger copy-on-write.The core now finalizes the unchanged table source only when the request ends exactly at the registered boundary with no tokens in flight. The handoff is routed through
KVConnectorBase_V1andMultiConnector; Mooncake immediately pins the exact boundary-state block, queues metadata with its store-job ID, and releases the pin after every worker reports completion. The finished request itself does not remain retained.Root cause
Partial-tail offloads were emitted only when a later allocation triggered CoW and moved the registered boundary state into a durable private block. A prefill-only producer that finished at that boundary never allocated again, so its final partial Mamba state was dropped and could not be persisted for later prefix hits.
Impact
Later requests can reuse a producer's final partial hybrid prefix from Mooncake Store even when the producer ends immediately after prefill. Safety checks consume the marker without emitting a handoff if tokens remain in flight or computation advanced past the registered boundary.
Duplicate-work check
This is not duplicate work:
No open PR was found for the head branch or for searches covering producer partial-tail finish-time offload.
Validation
Focused prefix-cache, Mooncake Store scheduler, and MultiConnector suites:
.venv/bin/python -m pytest \ tests/v1/core/prefix_cache/test_partial_prefix_cache_hits.py \ tests/v1/kv_connector/unit/test_mooncake_store_scheduler.py \ tests/v1/kv_connector/unit/test_multi_connector.py \ -q -k "not multi_example_connector_consistency"Result: 103 passed, 1 skipped, 1 deselected. On macOS, only the repository global cleanup hook was disabled because the installed PyTorch build raises an unrelated MPS allocator assertion during teardown; all selected test bodies passed.
The four finish-time handoff tests also passed independently. Pre-commit passed on every changed file, including ruff, formatting, mypy, SPDX, and repository policy hooks.
The deselected MultiConnector test requires a runnable accelerator and model engine, which were unavailable in this environment.
Model evaluation
Not run. This conflict resolution was validated at the focused unit-test level; serving/model evaluation still requires a Mooncake deployment.
AI assistance
AI assistance was used to resolve conflicts, adapt the change to the current per-store-job pinning design, run validation, and prepare this PR. The human submitter must review every changed line and be able to understand and defend the change end-to-end.