Repository navigation
Conversation
The prefiller holds a finished request's KV blocks until the decoder pulls them or VLLM_MOONCAKE_ABORT_REQUEST_TIMEOUT (480 s) runs out. A crashed decoder pins those blocks for the whole timeout, while a shorter timeout frees the KV of requests that are only queued on a busy decoder. Add an opt-in kv_lease_duration, following NixlConnector's lease (vllm-project#41383). The prefiller grants a short lease when prefill ends. The decoder renews it over the existing ZMQ side channel from the moment a request arrives until its pull settles, and the prefiller frees blocks whose lease runs out. The prefiller also answers a pull for KV it has already freed at once, instead of waiting for a prefill that already ran. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: CJJ1008 <843515223@qq.com>
|
Documentation preview: https://vllm--64193.org.readthedocs.build/en/64193/ |
wangxiyuan
left a comment
There was a problem hiding this comment.
The change LGTM. just a nit. Feel free to update if need follow-up change.
| # The requests may still be queued. Query now so this renewal, | ||
| # and the pull later, can reach P's workers. | ||
| await self._query_bootstrap(heartbeat.remote_bootstrap_addr) | ||
| if remote_engine_id not in self._remote_agents: |
There was a problem hiding this comment.
it's good to add a log here before return for better debug.
There was a problem hiding this comment.
Added a warning before the return in fbf1e7f. Thanks for the review!
|
✅ @CJJ1008, CI is now available for this PR.
|
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: CJJ1008 <843515223@qq.com>
|
/ci run |
|
✅ Triggered Buildkite CI #97935 for commit ℹ️ This PR is 24 commits behind upstream |
|
Follow-up idea (not blocking): turn P/D lease misconfiguration into an explicit error instead of a docs-level constraint. |
|
Thanks, good point! I'll handle it in a follow-up PR after this one lands. Rough idea for now (haven't validated it yet):
If you have any other ideas, feel free to let me know. I'd be glad to keep contributing here. |
Overview
Today the Mooncake prefiller holds a finished request's KV until the decoder pulls it, or until
VLLM_MOONCAKE_ABORT_REQUEST_TIMEOUT(480 s) runs out. This PR adds an opt-inkv_lease_durationthat replaces that fixed timeout with a lease the decoder renews, following NixlConnector's lease (#41383, design). It addresses the "480s expire fallback" in item 6 of RFC #60523.Claims
kv_lease_duration, behavior is unchanged.Validation
Unit tests:
pytest tests/v1/kv_connector/unit/test_mooncake_connector.py→ 144 passed (A800,huggingface_hub==1.31.0as in CI). The new tests use the real scheduler, real ZMQ sockets and a stubbed bootstrap service. They cover:lease / 6with it;pre-commitpasses.End to end: 2× A800 with 200G HDR IB, Mooncake TE 0.3.13.post1, DeepSeek-MoE-16B, TP=1 per side. Both sides run main
10e8e921b, with onlymooncake_connector.pyswapped (baseline vs this PR).In case A, requests still queued on P when D died are prefilled afterwards. The baseline holds them for another 480 s, and P is still at 37% KV when the run ends at t=660 s. The lease holds each for one 30 s lease.
Reproduction
max_tokens=1000andignore_eos.max_tokens=1, sent to P withoutkv_transfer_params.SIGKILLto D's process group 20 s after the load starts.Overhead:
lease / 6.Details
Flow
on_new_request, while it may still be queued.lease / 6,build_connector_metagroups the tracked transfer ids by P engine.start_load_kvsends them to each P worker that D would pull from.expire_time = now + leasewhen prefill ends. On each renewal it setsexpire_time = max(expire_time, now + 2/3 · lease).finished_recvingorrequest_finished.Design notes
linger=0socket drops unsent messages.receive_kv. A P engine that D has not contacted yet gets a bootstrap query first.VLLM_MOONCAKE_ABORT_REQUEST_TIMEOUTstill bounds the wait for an unfinished prefill and how long freed transfer ids are remembered.Not a duplicate. I searched for Mooncake lease, heartbeat,
ABORT_REQUEST_TIMEOUTandexpire_time. #63420 and #59522 are leases in the Mooncake Store connector. #63804 is an external connector, and #57529 is a standalone failure ledger. Open PRs on this file (#62657, #62658, #62255, #61974) do not change P's expiry.AI assistance: written with Claude Code. I reviewed every changed line, ran all tests and experiments above, and can answer for the design.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
🤖 Generated with Claude Code