Repository navigation
[PD] Preserve abort ACKs until in-flight KV transfers drain - #40645
Conversation
|
/tag-and-rerun-ci |
| if ( | ||
| room_active | ||
| or self._staging_outstanding.get(room_to_be_aborted, 0) > 0 | ||
| ): |
There was a problem hiding this comment.
nit: with this new condition, the elif at L2438 is only reached when the room is inactive and outstanding <= 0, so its == 0 re-check can never usefully be false. The one state where it differs is a hypothetically negative counter, where the elif silently drops the abort (no ack, no registration → decode waits out the release timeout), while a plain else would correctly ack — a negative counter still means nothing is in flight.
- elif self._staging_outstanding.get(room_to_be_aborted, 0) == 0:
- # Concluded/unknown AND quiescent: ack now. A cleared
- # room is not automatically quiescent -- clear() can
- # drop a room whose chunk is still transferring.
+ else:
+ # Concluded/unknown AND quiescent (the branch above
+ # already took every case with writes outstanding):
+ # ack now so decode releases without the timeout.Purely cosmetic/robustness — fine to take as a follow-up; the current code is behaviorally identical in every reachable state.
|
/rerun-group disaggregation |
|
Results for 🚀 🚀 🚀 🚀 🚀 🚀 🚀 ⛔ |
Pick up sgl-project#40645, sgl-project#40711, the shared prefill->decode status plumbing (sgl-project#36612) and runtime role switching (sgl-project#28403). Conflict resolution: - common: keep upstream's update_status structure and still reset the deferred-ACK state when a room lifecycle starts. CommonKVSender.clear() follows sgl-project#40645: ACK now when nothing is in flight, else keep the target. - mooncake: the PR's unconditional register-then-try-ACK already covers sgl-project#40645 and sgl-project#40711. - nixl: keep upstream's settle-then-conclude exception path and still poison the ACK target, since that chunk stays counted. - mori: re-apply the drain-aware ACK path on upstream's conclude_transfer / conclude_failure API and list-returning _submit_kv_transfer; register the drain threads with teardown() and stop them with a sentinel. - tests: update stubs for the new NIXL exception path and for the deferred-ACK fields CommonKVManager now always owns. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port existing community lifecycle code onto b85c644. Fixed upstream source: 0dc6de2. Keep generation-tagged ABORT/ACK state across sender cleanup, count dequeued and in-flight transfers, drain running transfer futures, poison uncertain native failures, and retain decode KV plus metadata until ACK or the community device-destination timeout. Resolve held releases before decode scheduling gates and account for them in scheduler idle checks. Complete the existing cached-prefix event handoff through the worker. Use shared terminal-status helpers and socket locks for failure fanout and to prevent Success after cancellation. Migrated upstream implementations and provenance: - 97dedd1 (sgl-project#35049): device deferred release, ACK tracking, future draining and worker drain integration. - adca19c (sgl-project#35360): common ACK helpers, unique prefill rank and dequeue-before-status accounting. - 8ef6d31 (sgl-project#40645): preserve pending drain ACK targets across sender cleanup. - cd11037 (sgl-project#41023): default-on setting and explicit backend capability gate. - 14ab74e (sgl-project#41402): ACK endpoint fanout. - 2a1c477 (sgl-project#41404): defer all eligible failure paths and force-arm partial metadata publication. - 8293f9a (sgl-project#37077): shared ABORT/ACK types, generation filtering and common target/poison state. - 4195980 (sgl-project#43719): suppress drained ACK after uncertain native KV/state/aux failure. - f9df334 (sgl-project#44386): pending decode releases keep the scheduler non-idle. - c683190 (sgl-project#41395): cached-prefix ready-event forwarding and worker-side synchronization. - 2a46cf2 (sgl-project#36612): terminal/cleared room handling, first failure cause and shared failure/status fanout. - abddb1c (sgl-project#32541): state-send return propagation and per-cached-socket send locking. - 05c7ebf (sgl-project#30545): staging_counted and outstanding accounting across worker requeue/completion. - 8ad7641 (sgl-project#36160): common wait_event job field used by the early-send handoff. - 5b5d721 (sgl-project#40703): worker cleanup precedes outstanding-entry removal. - 348689d (sgl-project#38959): sender poll wrapper holds Success while counted transfers remain. - 1a0250c (sgl-project#41607): check Failed after state transfer before continuing to aux. - 8bf780d (sgl-project#41128): retain deferred release start_time/deadline tuple shape without its new metrics API. - 4dc9cda (sgl-project#37454): decode-side backend capability check before deferring a failed request. Baseline compatibility adaptations: - Insert selected snippets into existing server_args/configuration and worker/listener layout; retain local request timing and transfer batching. - Omit absent deferred-allocation/bootstrap ownership, role-switch teardown, host-receive and PP-consensus branches; import no placeholder subsystems. - Keep baseline 30-second socket timeout, optional sender-table guards and three-frame Mooncake status wire format; serialize existing manager sends with the imported endpoint locks. - Use release_kv_cache(req, tree_cache, is_insert=False), the old failed request release API, and the existing scheduler invariant-check entrypoint. - Omit unavailable new deferred-release metrics without importing the full metrics refactor; retain existing local metrics and diagnostics. No WELM/NPU layerwise additions are included. Device timeout behavior and backend capability defaults match the pinned community source. Validation: 48 external CPU protocol/worker/decode cases; source AST comparison for unadapted helpers; Python syntax, isort and configured Ruff checks; git diff --check. CPU fixtures remain outside this repository. No NPU/RDMA hardware execution was available for this commit.
Motivation
The prefill scheduler can clear a failed sender while its KV transfer is still writing. Clearing the pending abort-ACK destination loses the drain notification, leaving decode to release device KV on timeout. An abort arriving after room cleanup can also miss registration while writes remain outstanding.
Modifications
Preserve the ACK destination until outstanding writes drain, acknowledge immediately when already drained, and register late Mooncake aborts for rooms with outstanding transfers. Add a regression test covering cleanup before and after drain and exactly-once acknowledgment.
Validation
83406b6f45.test/registered/kernel/quantization/test_mxfp8_kv_reserved_slot.pypath; only that hook was skipped for the commit.CI States
Latest PR Test (Base): 🚫 Run #35667160829
Latest PR Test (Extra): ❌ Run #35667160700
Latest PR Test (AMD ROCm 10): ⏳ Run #35667160749