Skip to content

[None][fix] Stop scheduling cancelled disaggregated requests - #21508

Merged
chienchunhung merged 3 commits into
NVIDIA:mainfrom
chienchunhung:dev/pact-scheduled-request-cancellation
Nov 9, 2026
Merged

chienchunhung merged 3 commits into
NVIDIA:mainfrom
chienchunhung:dev/pact-scheduled-request-cancellation

Conversation

@chienchunhung

@chienchunhung chienchunhung commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stop eligible cancelled CTX and GEN requests from entering another model batch. Keep prior model and transfer resources protected until normal cleanup can safely retire them.

Scope

  • Scheduling gate excludes cancelled work from scheduler candidates, not ownership. A retained LoRA adapter—on the active list or pending response termination—temporarily defers LoRA admission; non-PEFT work remains eligible.
  • Cancellation boundaries retain previous-batch requests, including context chunks with no sampler output, and reuse normal post-batch cleanup and terminal responses.
  • Overlap bookkeeping clears harvested markers only for requests absent from the current forward. Deferred GEN requests resume from their host tokens with correct positions and cached lengths; current-forward and unharvested ADP markers remain intact.
  • Preserve existing Python-transceiver capability gates, PP1/text-only restrictions, and earlier terminal outcomes.

No new profile activation, GPU preemption, retry coordination, connector behavior, or deadline change. This PR does not independently return logical cancellation before unresolved transfer retirement.

Verification

  • Current head 6fff2fdf751e09dbd59f861995654d193e145a9e: 85 cancellation regressions + 6 real-scheduler PEFT regressions passed on each of x86 and ARM CPU in CI #68465. These are executed results; later runs reuse previous CPU-stage success.
  • Coverage delta: cancellation module 59 → 85 cases (+26), plus 6 PEFT cases. Coverage includes retained-adapter admission, LoRA pause/resume through native sampler and decoder input packing, empty batches, and delayed ADP harvesting.
  • Complete source self-review, required hooks, syntax checks, and git diff --check passed at this head. Full CI rerun requested, but CI dispatch was blocked by HTTP 503; no new Jenkins pipeline launched. The required multi-GPU approval label is present; full-CI completion remains pending.
  • CPU module coverage does not establish GPU lifecycle qualification.

Dev Engineer Review

  • The executor now excludes eligible cancelled CTX and GEN requests from future batches while retaining them in active_requests until normal cancellation cleanup. It defers LoRA admission while a cancelled request may still hold an adapter, but allows non-PEFT requests to proceed.
  • Cancellation remains gated by transceiver support and existing connector, pipeline-parallel, encoder-decoder, and multimodal restrictions. Requests in the previous batch remain at the post-sampler boundary.
  • _process_previous_batch now clears stale py_batch_idx values for requests not in the current batch. This supports resumed work using harvested host tokens rather than unrelated device output.

QA Engineer Review

  • Two unit-test files changed. No test-list files changed, and these unit tests do not require entries in the integration CI or manual-QA lists.
  • Tests cover scheduler exclusion, context and generation cancellation boundaries, resource retention and cleanup, cancellation failure and retry, LoRA admission, overlap markers, and unsupported paths.
  • Coverage verdict: needs follow-up. The tests exercise the changed paths, but they do not establish GPU lifecycle qualification.

Per-File QA Perspective

  • tensorrt_llm/_torch/pyexecutor/py_executor.py — Verify that eligible cancelled requests do not enter another batch, retain resources until normal cleanup, and resume correctly after harvest. Also verify that unsupported paths and non-PEFT scheduling remain unchanged.
  • tests/unittest/_torch/disaggregation/test_disagg_idle_cancellation.py — Adds CPU-only tests for cancellation, resource retirement, retry behavior, overlap handling, and unsupported paths. This unit-test file is not listed in the integration CI or manual-QA lists.
  • tests/unittest/_torch/pyexecutor/kv_cache/test_kv_cache_v2_scheduler.py — Adds scheduler tests for retained LoRA adapters and admission after cleanup. This unit-test file is not listed in the integration CI or manual-QA lists.

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82172 [ run ] triggered by Bot. Commit: a8a86ed Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82172 [ run ] completed with state FAILURE. Commit: a8a86ed
/LLM/main/L0_MergeRequest_PR pipeline #67802 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@chienchunhung
chienchunhung marked this pull request as ready for review November 3, 2026 07:50
@chienchunhung
chienchunhung requested review from a team as code owners November 3, 2026 07:50
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The executor identifies eligible cancelled disaggregated model requests, excludes them from scheduling, and processes their cancellation outside the previous batch. It updates overlap markers when processing the previous batch. Tests cover eligibility, batch-boundary handling, completion overlap, retries, and preparation.

Changes

Disaggregated request cancellation

Layer / File(s) Summary
Cancellation eligibility and scheduler filtering
tensorrt_llm/_torch/pyexecutor/py_executor.py, tests/unittest/_torch/disaggregation/test_disagg_idle_cancellation.py, tests/unittest/_torch/pyexecutor/kv_cache/test_kv_cache_v2_scheduler.py
The executor identifies eligible cancelled model requests and filters them from scheduler input. If a filtered request or pending response termination retains a LoRA task, the executor also withholds remaining LoRA requests from that scheduling pass. Tests cover eligibility limits, scheduler exclusion, and retained adapter behavior.
Batch-boundary cancellation handling
tensorrt_llm/_torch/pyexecutor/py_executor.py, tests/unittest/_torch/disaggregation/test_disagg_idle_cancellation.py
The overlap loop passes the newly scheduled batch to previous-batch processing, which clears py_batch_idx for requests no longer present. The cancellation path attempts cancellation for eligible model requests outside the previous batch and leaves requests active when cancellation fails. Tests cover batch boundaries, post-sampler retirement, generation resumption, overlap markers, retries, and preparation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Merge Risk: Minimal · up to 6fff2

No actionable merge-blocking issue was identified. The reviewed overlap-marker transition is consistent with request scheduling.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the main scheduling fix.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description explains the issue, solution, scope, and test coverage. The template's checklist and bot-help sections are missing, but the main information is complete.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 10 functions across 2 files. (1 skipped: 1 too large.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b9722ba and 6fff2fd.

Files selected for processing: 2

  • tensorrt_llm/_torch/pyexecutor/py_executor.py
  • tests/unittest/_torch/disaggregation/test_disagg_idle_cancellation.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@chienchunhung
chienchunhung force-pushed the dev/pact-scheduled-request-cancellation branch from a8a86ed to 4e6b592 Compare November 3, 2026 08:19

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82248 [ run ] triggered by Bot. Commit: 4e6b592 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82248 [ run ] completed with state FAILURE. Commit: 4e6b592
/LLM/main/L0_MergeRequest_PR pipeline #67876 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82323 [ run ] triggered by Bot. Commit: 4e6b592 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82323 [ run ] completed with state FAILURE. Commit: 4e6b592
/LLM/main/L0_MergeRequest_PR pipeline #67945 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@chienchunhung
chienchunhung requested a review from a team as a code owner November 4, 2026 18:37

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82549 [ run ] triggered by Bot. Commit: b9722ba Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82549 [ run ] completed with state FAILURE. Commit: b9722ba
/LLM/main/L0_MergeRequest_PR pipeline #68143 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@allisonlim-nv allisonlim-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with same concern as @Shixiaowei02

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82903 [ run ] triggered by Bot. Commit: 6fff2fd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82903 [ run ] completed with state SUCCESS. Commit: 6fff2fd
/LLM/main/L0_MergeRequest_PR pipeline #68465 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83141 [ run ] triggered by Bot. Commit: 6fff2fd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83141 [ run ] completed with state FAILURE. Commit: 6fff2fd
/LLM/main/L0_MergeRequest_PR pipeline #68692 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@SimengLiu-nv SimengLiu-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements.

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@chienchunhung
chienchunhung enabled auto-merge (squash) November 6, 2026 23:46
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83181 [ run ] triggered by Bot. Commit: 6fff2fd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83181 [ run ] completed with state SUCCESS. Commit: 6fff2fd
/LLM/main/L0_MergeRequest_PR pipeline #68730 completed with status: 'UNSTABLE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

2 similar comments
@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83240 [ run ] triggered by Bot. Commit: 6fff2fd Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83496 [ run ] triggered by Bot. Commit: 6fff2fd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83496 [ run ] completed with state SUCCESS. Commit: 6fff2fd
/LLM/main/L0_MergeRequest_PR pipeline #69017 completed with status: 'SUCCESS'

CI Report

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants