Repository navigation
[TRTLLM-17083][feat] Cancel paired GEN on CTX failure or cancellation - #20491
Open
chienchunhung wants to merge 2 commits into
Open
chienchunhung wants to merge 2 commits into
chienchunhung wants to merge 2 commits into
Conversation
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Collaborator
Author
|
/bot run |
Collaborator
|
PR_Github #78549 [ run ] triggered by Bot. Commit: |
chienchunhung
requested review from
Shixiaowei02,
bo-nv,
chuangz0,
pcastonguay and
schetlur-nv
October 16, 2026 19:54
chienchunhung
marked this pull request as ready for review
October 16, 2026 22:54
Contributor
Collaborator
|
PR_Github #78549 [ run ] completed with state
|
| for choice in response.choices: | ||
| del choice.disaggregated_params | ||
| # GEN's HTTP client owns completion hooks, including when it finished | ||
| # before CTX returned. Do not synthesize another completion here. |
Collaborator
There was a problem hiding this comment.
When CTX returns cancelled before GEN completes, canceling GEN prevents its on_resp_done, and this path invokes none. The response loses requested metrics headers and configured JSONL records; finalize once.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stop the paired generation request when context fails or returns
finish_reason="cancelled"in generation-first serving, instead of leaving GEN waiting for its own timeout. Follow-up to the early-cancellation discussion in #20459; this targetsmainindependently.Scope
Verification
git diff --check: passed. Full self-review: no remaining findings at4df975b8c3.35d0b9f9a8; fix in4df975b8c3. Before-fix RED evidence requires separate execution; current-head CI will verify the fix, not both revisions. No physical-quiescence qualification claimed.Dev Engineer Review
Generation-first orchestration now closes the paired GEN stream before returning a CTX cancellation response. For non-streaming requests, it cancels and drains pending sibling tasks on failure or caller cancellation. It preserves prompt GEN-error reporting while CTX is pending, and leaves GEN-only streaming ownership with the caller.
The cancellation path removes disaggregated parameters from the CTX response. It does not claim physical transfer quiescence or KV-memory reuse. Current review-finding counts and test execution results are unavailable.
QA Engineer Review
The changed tests cover stream closure, non-streaming sibling cleanup, CTX cancellation, caller cancellation, GEN-only streaming ownership, and HTTP disconnect delivery to the worker abort path. The HTTP test covers streaming and non-streaming requests with CTX errors and cancellation; model execution is mocked.
Both test modules are covered by the
unittest/disaggregateddirectory entry intests/integration/test_lists/test-db/l0_cpu.yml. Coverage verdict: sufficient for the described request-cancellation behavior. Runtime test results are not provided.Per-File QA Perspective
tensorrt_llm/serve/openai_disagg_service.py: Verify that CTX cancellation closes GEN before any buffered chunks reach the caller, and that non-streaming failures and caller cancellation drain both HTTP tasks. Also verify GEN-only streaming and GEN-error propagation remain unchanged.tests/unittest/disaggregated/test_openai_disagg_service.py: Covers orchestration cleanup, cancellation outcomes, and stream ownership. Its containing test directory is listed in the CPU CI test list.tests/unittest/disaggregated/test_paired_request_cancellation.py: Covers real HTTP disconnect propagation into the worker abort path for streaming and non-streaming requests. Its containing test directory is listed in the CPU CI test list.tests/integration/test_lists/test-db/l0_cpu.yml: The existingunittest/disaggregatedentry includes both test modules in CPU CI selection.