Repository navigation
[None][fix] Progress idle disaggregated worker cancellation - #20702
Conversation
|
/bot run |
|
PR_Github #79372 [ run ] triggered by Bot. Commit: |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Idle-cancellation eligibility tensorrt_llm/_torch/disaggregation/kv_cache_transceiver.py, tensorrt_llm/_torch/disaggregation/transceiver.py |
The base transceiver adds a default-false idle-cancellation query. The V2 transceiver reports support based on bridge and request state, and preserves receive-session transfer errors during cancellation. |
Pre-scheduling cancellation and error flush tensorrt_llm/_torch/pyexecutor/py_executor.py, tensorrt_llm/_torch/disaggregation/orchestration/coordinator.py |
The executor processes eligible cancellations before preparation and scheduling. The coordinator reports whether synchronized errors were handled. Both executor loops use that result to flush buffered responses at the required point. |
Cancellation and error lifecycle validation tests/unittest/_torch/disaggregation/test_disagg_idle_cancellation.py, tests/unittest/_torch/disaggregation/test_disagg_coordinator_errors.py, tests/unittest/_torch/disaggregation/test_benchmark_disagg.py, tests/unittest/_torch/disaggregation/test_disagg_inflight_cancel_gate.py, tests/unittest/_torch/disaggregation/test_disagg_loop_transcript.py, tests/unittest/_torch/executor/test_kv_connector_executor_lifetime.py, tests/unittest/executor/test_forward_error_survival.py |
Tests cover cancellation eligibility and timing, transfer-error preservation and flushing, resource retention, and preparation behavior. Supporting fixtures set cancellation IDs, coordinator results, and request states. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant RequestQueue
participant PyExecutor
participant KvCacheTransceiver
participant DisaggTransferCoordinator
RequestQueue->>PyExecutor: provide pending cancellation IDs
PyExecutor->>KvCacheTransceiver: query idle-cancellation support
PyExecutor->>DisaggTransferCoordinator: request cancellation authorization
DisaggTransferCoordinator->>PyExecutor: return cancellation decision
PyExecutor->>DisaggTransferCoordinator: handle synchronized transfer errors
DisaggTransferCoordinator->>PyExecutor: return whether errors were handled
PyExecutor->>PyExecutor: flush buffered responses before scheduling or idle fetch
Possibly related PRs
- NVIDIA/TensorRT-LLM#20459: This change also retains failed receive sessions while writers settle and delays retirement until safe.
- NVIDIA/TensorRT-LLM#20943: This cherry-pick changes failed-receive retention and retirement behavior.
- NVIDIA/TensorRT-LLM#20491: This change cancels paired generation work when context work fails or is cancelled.
Merge Risk: 
Minimal · up to 04104
-
This change lets idle disaggregated requests be cancelled before scheduling while keeping request memory until the transceiver confirms it can be released. I found no outstanding defect in the supplied evidence. The remaining step is the ordinary check that CI passes on the current head.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The pull request description clearly explains the problem, solution, scope, limitations, test coverage, verification results, and checklist status. It uses custom headings instead of the template's exact "Description" and "Test Coverage" headings, but it provides the required information and is mostly complete.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
PR_Github #79372 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #79772 [ run ] triggered by Bot. Commit: |
|
PR_Github #79772 [ run ] completed with state
|
bo-nv
left a comment
There was a problem hiding this comment.
Beyond the comments already raised by other reviewers, I didn't find any blocking issues from the disagg side. LGTM.
561bcd9 to
5974137
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #80277 [ run ] triggered by Bot. Commit: |
|
PR_Github #80277 [ run ] completed with state
|
5974137 to
ee1f95b
Compare
|
/bot run --disable-fail-fast |
04104d3 to
e7a4e37
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #81238 [ run ] triggered by Bot. Commit: |
|
PR_Github #81238 [ run ] completed with state Resource maintenance in LLM/main/L0_Test-x86_64-Single-GPU #9610: L40S-PyTorch-2 is temporarily paused due to Kubernetes agent provisioning and node issues.
|
|
/bot run --disable-fail-fast |
|
PR_Github #81476 [ run ] triggered by Bot. Commit: |
|
PR_Github #81476 [ run ] completed with state |
allisonlim-nv
left a comment
There was a problem hiding this comment.
unblock from runtime
Signed-off-by: Chien-Chun Hung <[email protected]>
Signed-off-by: Chien-Chun Hung <[email protected]>
Signed-off-by: Chien-Chun Hung <[email protected]>
Signed-off-by: Chien-Chun Hung <[email protected]>
e7a4e37 to
0723174
Compare
|
/bot skip --commit "Full CI verified before the rebase." |
GitHub Bot Help
Provide a user friendly way for developers to interact with a Jenkins server. Run See details below for each supported subcommand. Details
Launch build/test pipelines. All previously running jobs will be killed.
kill
Kill all running builds associated with pull request. skip
Skip testing for latest commit on pull request. reuse-pipeline
Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break. |
|
/bot skip --comment "Full CI verified before the rebase." |
|
PR_Github #81737 [ skip ] triggered by Bot. Commit: |
|
PR_Github #81737 [ skip ] completed with state |
Resolve the conflict in KvCacheTransceiver with main (NVIDIA#20702), which adds supports_idle_request_cancellation next to this PR's context_transfer_is_waiting_for_peer and context_transfer_peer_ready_time; both sets of methods are kept. Signed-off-by: Bo Deng <[email protected]>
…generation server Without in-flight cancellation, the generation-side KV-transfer timeout only flags the request in check_transfer_timeouts. The cancel and the error response happen in the response pass, which runs only after a forward step. A generation server with nothing else scheduled therefore kept a request whose KV never arrived until the client gave up, even after logging "Observed timeout on generation request". DisaggTransferCoordinator.poll_gen_transfers, which runs at every loop head, now cancels and fails the receives that check_transfer_timeouts flagged whenever in-flight cancellation is inactive. This covers any transceiver without that capability, including KvCacheTransceiverV2 and TRTLLM_DISAGG_ENABLE_INFLIGHT_CANCEL=1 on an unsupporting transceiver. A cancel that finishes at once fails the request through fail_timed_out, inline or buffered for handle_timeouts_synced under multi-rank ADP. A cancel the transceiver refuses is asked only once: the Python transceiver has then marked the session cancelled and the next reap_gen_receives fails the request through the transfer-error path, while the C++ transceiver cannot cancel a receive already in flight and would only repeat its "Cannot cancel request" warning at the idle loop rate. Requests the user cancelled are left to the cancel path. No collective is added. The in-flight cancellation path is unchanged. fail_timed_out now moves a request still in DISAGG_GENERATION_TRANS_IN_PROGRESS to DISAGG_TRANS_ERROR before failing it. cancel_request does not change the state, so PyExecutor._handle_errors parked the failure for a transfer that no longer existed, and _sweep_transfer_held_failures then dropped it because the request had already left active_requests: no error response was sent and the KV was never freed. This also fixes the same loss on the existing response-pass timeout path. Main's idle request cancellation (NVIDIA#20702) retires requests the client cancelled while no batch runs, where the transceiver reports supports_idle_request_cancellation. It does not act on transfer timeouts, which this change covers; client cancels stay on that path. As on the response-pass timeout path, cancel_request decides whether a receive can stop, and refuses one that is still writing. Signed-off-by: Simeng Liu <[email protected]>
…generation server Without in-flight cancellation, the generation-side KV-transfer timeout only flags the request in check_transfer_timeouts. The cancel and the error response happen in the response pass, which runs only after a forward step. A generation server with nothing else scheduled therefore kept a request whose KV never arrived until the client gave up, even after logging "Observed timeout on generation request". DisaggTransferCoordinator.poll_gen_transfers, which runs at every loop head, now cancels and fails the receives that check_transfer_timeouts flagged whenever in-flight cancellation is inactive. This covers any transceiver without that capability, including KvCacheTransceiverV2 and TRTLLM_DISAGG_ENABLE_INFLIGHT_CANCEL=1 on an unsupporting transceiver. A cancel that finishes at once fails the request through fail_timed_out, inline or buffered for handle_timeouts_synced under multi-rank ADP. A cancel the transceiver refuses is asked only once: the Python transceiver has then marked the session cancelled and the next reap_gen_receives fails the request through the transfer-error path, while the C++ transceiver cannot cancel a receive already in flight and would only repeat its "Cannot cancel request" warning at the idle loop rate. Requests the user cancelled are left to the cancel path. No collective is added. The in-flight cancellation path is unchanged. fail_timed_out now moves a request still in DISAGG_GENERATION_TRANS_IN_PROGRESS to DISAGG_TRANS_ERROR before failing it. cancel_request does not change the state, so PyExecutor._handle_errors parked the failure for a transfer that no longer existed, and _sweep_transfer_held_failures then dropped it because the request had already left active_requests: no error response was sent and the KV was never freed. This also fixes the same loss on the existing response-pass timeout path. Main's idle request cancellation (NVIDIA#20702) retires requests the client cancelled while no batch runs, where the transceiver reports supports_idle_request_cancellation. It does not act on transfer timeouts, which this change covers; client cancels stay on that path. As on the response-pass timeout path, cancel_request decides whether a receive can stop, and refuses one that is still writing. Signed-off-by: Simeng Liu <[email protected]>
…generation server Without in-flight cancellation, the generation-side KV-transfer timeout only flags the request in check_transfer_timeouts. The cancel and the error response happen in the response pass, which runs only after a forward step. A generation server with nothing else scheduled therefore kept a request whose KV never arrived until the client gave up, even after logging "Observed timeout on generation request". DisaggTransferCoordinator.poll_gen_transfers, which runs at every loop head, now cancels and fails the receives that check_transfer_timeouts flagged whenever in-flight cancellation is inactive. This covers any transceiver without that capability, including KvCacheTransceiverV2 and TRTLLM_DISAGG_ENABLE_INFLIGHT_CANCEL=1 on an unsupporting transceiver. A cancel that finishes at once fails the request through fail_timed_out, inline or buffered for handle_timeouts_synced under multi-rank ADP. A cancel the transceiver refuses is asked only once: the Python transceiver has then marked the session cancelled and the next reap_gen_receives fails the request through the transfer-error path, while the C++ transceiver cannot cancel a receive already in flight and would only repeat its "Cannot cancel request" warning at the idle loop rate. Requests the user cancelled are left to the cancel path. No collective is added. The in-flight cancellation path is unchanged. fail_timed_out now moves a request still in DISAGG_GENERATION_TRANS_IN_PROGRESS to DISAGG_TRANS_ERROR before failing it. cancel_request does not change the state, so PyExecutor._handle_errors parked the failure for a transfer that no longer existed, and _sweep_transfer_held_failures then dropped it because the request had already left active_requests: no error response was sent and the KV was never freed. This also fixes the same loss on the existing response-pass timeout path. Main's idle request cancellation (NVIDIA#20702) retires requests the client cancelled while no batch runs, where the transceiver reports supports_idle_request_cancellation. It does not act on transfer timeouts, which this change covers; client cancels stay on that path. As on the response-pass timeout path, cancel_request decides whether a receive can stop, and refuses one that is still writing. Signed-off-by: Simeng Liu <[email protected]>
Summary
Cancelled disaggregated requests can remain pending while a worker waits for peer readiness or KV reception because ordinary cancellation runs after a model batch. Progress eligible cancellations without another batch, while retaining memory until the transceiver confirms safe retirement.
Scope
Verification
e7a4e3792ain CI #66928.e7a4e3792a. The retry report records 1,571 passed, 0 failed, and 671 skipped; previously successful stages, including CPU, were skipped.b6d1a0616fas0723174104. All four patches are preserved; the only range-diff adjustment follows main's test-file relocation. Complete self-review, pre-commit, Python syntax, and diff checks passed. Runtime tests were not rerun at the rebased head (local pytest collection is blocked by missing PyTorch); full CI is skipped at the author's request.Notes
Complements #20491's service-level cancellation; this is not complete in-flight cancellation or coordinated retry support.