Repository navigation
Revert "[RL] KV offload on vLLM 0.33: drop the Mooncake no-forward save workaround" (#6389) - #6428
Conversation
|
@claude review |
There was a problem hiding this comment.
Verdict: Request changes -- #6389 was written for vLLM 0.33.0 and landed before the PRs that move to 0.33 (#5498 and #5967, both still drafts). This PR undoes only the queue rename, so two other parts of #6389 that are wrong on the pinned nightly stay on main.
What this PR does. It renames kv_holding_waiting back to skipped_waiting in the KV offload scheduler, the session KV holder, and their CPU tests. That fixes the CPU test failure and the holder's AttributeError.
Example. Under the priority policy with TP=2, request r waits on a KV load in skipped_waiting, and request r-a sits in waiting with the same priority and arrival time.
- Before #6389: the
_select_waiting_queue_for_schedulingoverride picked between the two queue heads by shared ID, so both ranks pickedr. - On main and with this PR: vLLM's own comparison picks the head (the new comment at
kv_offload_scheduler.py:125says vLLM schedules whichever head comes first), and it doesn't use shared IDs. Rank 0 and rank 1 can pick different requests.
Must fix
-
Gate: revert #6389 instead of partly undoing it. This PR undoes only the rename. Two other deletions from #6389 also depend on 0.33:
kv_offload_scheduler.py:125-- the_select_waiting_queue_for_schedulingoverride is still gone (details inline). That leaves the TP-divergence problem this PR's own description raises.worker.py-- theTorchTitanGPUModelRunner.kv_connector_no_forwardoverride is still gone, along with its TODO and its unit test intest_mooncake_coordination.py. #6389's own description says the pinned nightly passeswait_for_save=False(vllm-project/vllm#69805), and nothing in the repo references 69805 any more. So on main, Mooncake never submits finish-time saves scheduled on a step without a forward, and nothing reports it.
The smallest correct change is
git revertof #6389 (about +80/-25 lines, all restored code). #6389 then relands on top of #5967. If you keep this PR, it also has to restore those two overrides, the deleted Mooncake test, and the cross-queue assertion intest_priority_ties_use_shared_request_ids. -
tests/rl/unit_tests/cpu/test_session_kv_holder.py:423-- the docstring now makes a claim that is wrong on the nightly (details inline). -
Description: "What changed" should say that #6389 landed before #5498/#5967, and which of its 0.33-only changes stay on main. As written, it reads as if a rename fully fixes main.
Questions
- #6389's test edits also added 0.33-only scheduler state (
_kv_fetch_stages,deferred_loads,deferred_waiting,_interval_load_blocks_completed, ...). Does the nightly read any of these? If not, they are dead setup that a revert would also remove.
Details
- From #6389's description: "Depends on #5498 and #5967 ... land this after them. Until then this PR's CI runs on the pinned nightly, where these changes fail." Both are still open drafts, and
scripts/install_rl_env.sh:75still pinsvllm==1.0.0.dev20261107. grep kv_connector_no_forward|_select_waiting_queue_for_scheduling|69805over the repo finds onlytests/rl/unit_tests/gpu/test_kv_offload.py:228,242. The override and its TODO are gone fromworker.py.- Searches:
kv_holding_waiting OR skipped_waiting,kv_offload_scheduler,vLLM 0.33. Related open PRs: #5498 and #5967 (the 0.33 move), #5956 (vLLM 0.34 / runner V2). None of them fixes main in the meantime. skipped_waitingalso holds requests blocked on a grammar or streamed input, which don't hold KV blocks. The holder treats them like any other non-load waiter. That matches how things worked before #6389, so it is not a regression.
Not verified: the pinned wheel's scheduler.py source wasn't available here. The claims about queue selection and wait_for_save come from #6389's description and the code it deleted.
Before merge: fill in the human-written summary.
| # Waiting requests blocked on remote KV loads (or a grammar or streamed | ||
| # input); vLLM schedules whichever queue's head comes first. | ||
| self.skipped_waiting = _SharedIDRequestQueue() |
There was a problem hiding this comment.
This comment says vLLM schedules whichever queue's head comes first, but #6389 deleted the _select_waiting_queue_for_scheduling override that broke ties between those two heads by shared ID. That deletion only made sense on 0.33, which drains kv_holding_waiting first. On the pinned nightly, vLLM's own head comparison decides when a waiting head and a skipped_waiting head have equal priority and arrival time, and that comparison is not by shared ID. So TP ranks can still pick different requests, which is the divergence this PR's description warns about. Using _SharedIDRequestQueue only fixes the order inside each queue.
Fix: restore the override as it was before #6389, using min((self.waiting, self.skipped_waiting), key=...) on (priority, arrival_time, shared_request_id). Also restore the cross-queue assertion in test_priority_ties_use_shared_request_ids. Simpler still, revert #6389 outright (see the review body).
| def test_a_waiting_turn_gets_room_when_held_sessions_fill_the_pool(manager, queue): | ||
| """Nothing runs, free >= floor, and the waiting turn needs more blocks than are free. | ||
| vLLM serves `kv_holding_waiting` first.""" | ||
| vLLM serves `skipped_waiting` first.""" |
There was a problem hiding this comment.
The rename turned #6389's 0.33-specific claim ("drains kv_holding_waiting first") into "vLLM serves skipped_waiting first", which is not true on the pinned nightly. It also contradicts the new comment in kv_offload_scheduler.py:125-126, which says the earlier head wins. Before #6389 this docstring read "vLLM serves skipped_waiting first and leaves a refused request there". Restore that wording if it matches the nightly; otherwise describe the head-comparison behavior.
…ve workaround (#6389)" This reverts commit 8ab41b4. #6389 moves the KV offload code to vLLM 0.33 and says it depends on #5498 and #5967 (the vLLM 0.33 upgrade, still open); it landed first, so main runs it on the pinned vllm==1.0.0.dev20261107, where all three of its changes are wrong: - the nightly has no Scheduler.kv_holding_waiting (blocked requests wait in skipped_waiting), so test_kv_offload_coordination fails in RL CPU Unit Tests, VLLMSessionKVHolder reads a missing (FCFS) or never-filled (priority) queue, and KVOffloadScheduler's shared-ID queue replaces a dead attribute; - the nightly still chooses between the waiting and skipped_waiting heads (_select_waiting_queue_for_scheduling), whose shared-ID tie-break override was deleted, so TP ranks can pick different requests; - the nightly's kv_connector_no_forward still passes wait_for_save=False (vllm-project/vllm#69805), whose override was deleted, so Mooncake skips finish-time saves scheduled on a step without a forward. #6389 can reland on top of the vLLM 0.33 upgrade.
8d85958 to
6d0fdf5
Compare
|
@claude review again |
There was a problem hiding this comment.
Verdict: Approve -- this PR is now an exact git revert of #6389. That puts main back on the code that works with the pinned vLLM nightly. #6389 can reland once the vLLM 0.33 upgrade (#5498/#5967) lands.
What this PR does. It restores the code from before #6389 that the pinned vllm==1.0.0.dev20261107 needs:
- the
skipped_waitingqueue name inKVOffloadScheduler,VLLMSessionKVHolderand their tests - the
_select_waiting_queue_for_schedulingoverride, which breaks ties between the two queue heads by shared ID - the Mooncake
kv_connector_no_forwardoverride, plus its TODO (vllm-project/vllm#69805) and its CPU test
It also drops the 0.33-only scheduler state that #6389 had added to the tests.
Example. Under the priority policy with TP=2, request r sits in skipped_waiting waiting on a KV load, and r-a sits in waiting with the same priority and arrival time.
- On main: vLLM compares the two heads using per-process request IDs, so rank 0 and rank 1 can pick different requests.
- With this PR: the override compares
(priority, arrival_time, shared_request_id), so both ranks pick the same request.
Earlier must-fix items
- Revert #6389 instead of only undoing the rename: resolved.
gh pr diff 6428is the line-for-line inverse ofgh pr diff 6389, across the same 7 files and hunks. test_session_kv_holder.py:423docstring: resolved. It has the wording from before #6389 again.- The description should say what was left on main: resolved. The table now covers all three changes from #6389.
The earlier question about the 0.33-only test state (_kv_fetch_stages, deferred_loads, ...) is moot: the revert removes it.
Details
- At HEAD, grepping for
kv_holding_waiting|deferred_waiting|_kv_fetch_stagesfinds nothing, so no 0.33 names are left.kv_connector_no_forward,_select_waiting_queue_for_schedulingand the vllm-project/vllm#69805 TODO are all back. scripts/install_rl_env.sh:75still pinsvllm==1.0.0.dev20261107.- Overlap searches:
kv offload vLLM 0.33, plus the files this PR changes. #6287 (draft, MTP spec decode) also editssession_kv_holder.pyandworker.py. It will need a trivial rebase, which doesn't block this PR. - When #6389 relands, it should land in the same PR as the vLLM 0.33 upgrade, or after it.
Not verified: I didn't have the pinned wheel's scheduler source, so I didn't check its queue-selection and wait_for_save behavior myself. The reasoning rests on the description's source check and on this code working on that pin before #6389.
This touches RL generator code, so a maintainer still needs to review it.
Before merge: fill in the human-written summary.
Summary (human-written)
Why
RL CPU Unit Tests fail on main since #6389:
#6389 moves the KV offload code to vLLM 0.33.0 and says it depends on #5498 and #5967 (the vLLM 0.33 upgrade, both still open): "land this after them. Until then this PR's CI runs on the pinned nightly, where these changes fail." It landed first, so main runs it on the pinned
vllm==1.0.0.dev20261107(scripts/install_rl_env.sh), where each of its three changes is wrong. Checked against that wheel's source:skipped_waiting->kv_holding_waitinginKVOffloadScheduler,VLLMSessionKVHolderand testskv_holding_waiting(blocked requests wait inskipped_waiting): the CPU test fails; the holder reads a queue that is missing under FCFS and never filled under priority; the shared-ID queue replaces a dead attribute_select_waiting_queue_for_schedulingoverride (shared-ID tie-break between thewaitingandskipped_waitingheads)worker.py'skv_connector_no_forwardoverride and its testwait_for_save=False(vllm-project/vllm#69805): Mooncake skips finish-time saves scheduled on a step without a forward, silentlyWhat changed
git revertof #6389 (8ab41b4), clean: no later commit touches its files. #6389 can reland on top of the vLLM 0.33 upgrade.Alternatives considered
Testing
pytest tests/rl/unit_tests/cpu: 776 passed, 7 skipped (main: 2 failed); includes the restoredtest_mooncake_coordination.pytest.