Repository navigation
[Refactor] scheduler: Release every PD disaggregation exit through RequestRetirer - #48491
Conversation
…e_aborted; share release_prefill_sender; drop abort_queued release_memory
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
This comment has been minimized.
This comment has been minimized.
…abandon_attempt in the prefix caches; drop the scheduler delegate
This comment has been minimized.
This comment has been minimized.
…d free into release; count mm tokens before the detach and abandon only uncached attempts
…ort, unadmitted-retire and chunked-abort callers' own retire
|
/rerun-test registered/disaggregation/test_disaggregation_optimistic_prefill.py registered/unit/disaggregation/test_kv_checksum.py registered/unit/mem_cache/unified_radix_cache/test_unified_radix_cache_storage.py registered/disaggregation/test_disaggregation_chunked_prefill_abort.py registered/disaggregation/test_disaggregation_kv_checksum.py registered/disaggregation/test_disaggregation_basic.py registered/disaggregation/test_disaggregation_decode_offload.py registered/sessions/test_streaming_session.py registered/sessions/test_session_control.py registered/vlm/test_unlimited_ocr_server.py |
|
🚀 🚀 🚀 🚀 |
…tempt to the store; fold _release into release
… abandon from _detach into release; fix retirer docstrings; rename the dllm abort callback; drop the sender abort hasattr
…r/URC markers -- 3/18 census consumed, 3 gates in one CASCADE (start_writing(wait_for_forward) TypeError class, 68 distinct nodes): upstream sgl-project#48012's NEW fixture hicache_write_back_fixtures.InstantWriteBackController mirrored the pre-sgl-project#44800 no-kwarg surface while the fork's writing_check drain (entries 199/218: the batched-backup flush=False + ONE fenced start_writing) calls the real API. Def-site fixes, no fence weakened: - fixture start_writing gains the keyword (instant copies -> accepted-ignored, documented); - test_write_back_eviction_batching: record_submission wrapper FORWARDS the flag (it measures the very wait, so swallowing it would understate the fence); _FencedController gains load_fence_stream = forward (the fork's unconditional entry-168 fence reads it first; prod: both streams are the same forward stream) -- also silences the 16-test Rust TreeCore panic class whose "victims not demoted" assert was the aborted submission downstream. MARKERS (3): managers/cache_controller.py:1202 ADOPTED -- the dropped set_hicache_transfer_done_event write line is superseded by upstream c24285b(sgl-project#48008 per-band page ledger)+2cbb66f563(sgl-project#48012): record_host_transfer publishes the same signal per-page BOTH directions (load twin writes=True). unified_radix_cache.py:627 ADOPTED -- the buffer-mode threshold floor (resolve_prefetch_threshold) was DELIBERATELY deleted upstream by dfaca56(sgl-project#46934, restores sub-window SWA L3 hits); window sizing now lives per-allocation in BufferModePipeline; the per-call-site file_storage_path fold is consistent with the entry-253 funnel (cache_controller.py:948, intact). unified_radix_cache.py:3917 RE-PLANTED -- entry-293's cadence gate (park, do not re-enter allocate_storage_hit/evict_host inside the retry window) + the expired no-retry arm were dropped; wait_full folded into upstream's comp_xfers allow_partial rule (min_tokens form already equivalent). URC context guard: _deferred_ready_sync_group read get_memory() unguarded -- upstream's NEW _arm_tick CPU/spawn fixtures (their restructured timeout tests, sgl-project#44614) reach it without a published server config. Now published-check (schedule_policy.py:615 idiom): default-off CPU path, production unchanged. Deadline-anchor retargets (fork B3-9 family vs upstream's sgl-project#44614 vote-before- poll restructure; every assertion preserved): _vote_prefetch_deadlines drives the verdict before the expiry polls; failed-arm polled inside-budget so the storage failure stays the SOLE cut reason; fixture cc gains the sgl-project#44342 liveness attrs + pp_prefetch_command_thread; _arm_tick stub returns the fork's 5-tuple (health bit True); release_aborted_request -> finish(ABORT) per 8898429(sgl-project#48491). Battery actuals (CPU, CVD=9, prod venv, PYTHONPATH=wt/python): - the 5 cascade files 68F/39P -> 3F/70P (survivors = the sgl-project#48491/pp-thread/ budget-anchor fixes committed here; after them): test_storage_prefetch_ lifecycle ** 31P/31sub ** (entry-311 pin 28P/31sub, 295's >=23P/28sub EXCEEDED); decode_retraction_backup 6F + chunked_publish 2F = No-CUDA device class (env, reported). - combined gate run: trailing_endpoint + batching + parity + async_ready_sync + staged_write_back = 89P/1S/28sub 0F. Gates: ruff repo ruleset+format clean on touched files; registration trio rc=0.
PD disaggregation exits (prefill transfer success and failure, aborted prefill results, bootstrap failures, and the decode transfer, deferred-release, prealloc-failure and checksum-mismatch paths) each released their request by hand, with different subsets of the cleanup steps. They now go through
RequestRetirer, whose API is cut to two verbs, split by who reports the request:abort(req)(wasabort_queued): ends a request no launched step carries, tells the tokenizer once, and ends inrelease.release(req, *, checkpoint): gives back what an ended request holds; the caller finishes and streams it. An aborted request is first detached: its multimodal inputs, its streaming-session in-flight flag and its uOCR reuse state are dropped, its cache attempt is abandoned unless the KV is checkpointed (the cache's store then settles it, as on a normal finish), and its beam group leaves the live set. Then its KV backup, HiSparse rows, KV and mamba state go. It replacesrelease_finished,release_abortedand the separate free step.The detach (was
release_aborted_request) is now the retirer's private_detach, run only insiderelease: an aborted request cannot be released without being detached, and no caller detaches on its own. A logical abort only marks the request; the exit that releases it detaches it.release_prefill_sender(req, *, abort_sender)on the prefill mixin (replacingrelease_aborted_prefill_waiting_req): clears the pending chunk send, optionally aborts the sender (best effort, logged on failure), frees the metadata buffer and clearspending_bootstrap. The waiting-queue abort, the aborted-result path and the pending chunked abort passabort_sender=True; the bootstrap failure passesabort_sender=False, sincefailure_exception()already concluded that sender.abort, which loses itsrelease_memoryflag._release_requestis removed; its callers and_handle_kv_checksum_mismatchcallrelease(checkpoint=False). Host-staged requests hold no device KV row, so the retirer'sholds_kvgating replaces the old host-staged early return.retire_unadmitted_requestand the pending chunked abort stop detaching and retiring the beam group by hand; they mark the request, andreleasedoes both.retire_groupis a no-op on an already retired group, so the step paths that retire an aborted group first are unchanged.tree_cache.finish(SUCCESS), which is a no-op in every cache.Schedulerdelegate of the detach is removed; the prefix caches' hook behindfinish(handle, outcome)becomes_abandon_attempt(handle). The dLLM manager's hook is renamed toabort.release_kv_cache/_detachcallers intest_request_retirer.pydrops 8 entries.Behavior changes:
test_request_retirer.pytest.sender.abort()on the waiting-abort and chunked-abort paths is logged instead of raised.Test plan
test_kv_checksumcases were updated but not run locally.CI States
Latest PR Test (Base): ❌ Run #41990375583
Latest PR Test (Extra): ❌ Run #41990375552
Latest PR Test (AMD ROCm 10): ⏳ Run #41990375561
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: