Skip to content

[None][chore] Add per-rank routing/scheduling observability to the iteration log - #16323

Open
lancelly wants to merge 2 commits into
NVIDIA:mainfrom
lancelly:feat/conv-routing-observability
Open

[None][chore] Add per-rank routing/scheduling observability to the iteration log#16323
lancelly wants to merge 2 commits into
NVIDIA:mainfrom
lancelly:feat/conv-routing-observability

Conversation

@lancelly

@lancelly lancelly commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Enhanced iteration profiling with counts for fetched, active, dummy, and unscheduled requests.
    • Added visibility into request scheduling details in executor debug logs.

Description

Diagnosing attention-DP load imbalance today requires reconstructing state from per-request perf metrics. This PR adds per-rank routing and scheduling fields to the existing print_iter_log iteration line. It is log-only and touches a single file (py_executor.py).

Per-rank fields on the iteration line:

..., states = {...}, num_active = 14, num_fetched = 3, num_dummy = 1, num_unscheduled = 5
  • num_activelen(active_requests) at the iteration boundary (top of the loop, after the previous iteration's completions were removed and before the next fetch).
  • num_fetched — new requests the ADP router assigned to this rank during this iteration (delta of the cumulative fetch counter, tracked in the logging closure).
  • num_dummy — attention-DP pad dummies in this iteration's scheduled batch (0/1 per rank, padded in when the rank would otherwise run an empty batch). num_scheduled_requests already counts the pad, so subtract num_dummy to recover the real scheduled count.
  • num_unscheduled — active requests not placed in this iteration's batch (len(active_requests) − scheduled batch_size). Sampled at schedule time, so the pad cancels in both terms and it never mixes epochs the way active − num_scheduled would (the num_scheduled_requests printed on this line is the previous iteration's).

num_dummy and num_unscheduled are captured where num_scheduled_requests is already set (both executor-loop variants), and therefore lag one iteration behind num_active / num_fetched, consistent with num_scheduled_requests.

@lancelly
lancelly force-pushed the feat/conv-routing-observability branch 2 times, most recently from 8ee4509 to d911ae2 Compare July 13, 2026 15:23
@lancelly
lancelly force-pushed the feat/conv-routing-observability branch 3 times, most recently from 58ebf5a to 78fc93f Compare July 23, 2026 07:37
@lancelly lancelly changed the title [None][feat] Add observability for conversation routing and per-rank scheduler queues [None][feat] Add per-rank routing/scheduling observability to the iteration log Jul 23, 2026
…ration log

Diagnosing attention-DP load imbalance today requires reconstructing
state from per-request metrics. Add per-rank routing and scheduling
fields to the existing print_iter_log iteration line:

  num_active = 14, num_fetched = 3, num_dummy = 1, num_unscheduled = 5

- num_fetched: new requests the ADP router assigned to this rank
  during this iteration (delta of the cumulative fetch counter).
- num_dummy: attention-DP pad dummies in this iteration's scheduled
  batch (0/1 per rank, padded in when the rank would otherwise run an
  empty batch). num_scheduled_requests counts the pad, so subtract
  num_dummy to recover the real scheduled count.
- num_unscheduled: active requests not placed in this iteration's
  batch (len(active_requests) - scheduled batch_size). Sampled at
  schedule time, so the pad cancels in both terms and it never mixes
  epochs the way active - num_scheduled would (the num_scheduled
  printed on this line is the previous iteration's).

num_dummy and num_unscheduled are captured at schedule time and so lag
one iteration behind num_active/num_fetched, consistent with
num_scheduled_requests.

No collectives and no new sync points; all fields are log-only. These
signals surfaced a 1.8-3.4x per-rank queue-depth skew on an agentic
multi-turn workload, motivating the least_queued placement option in
NVIDIA#16294.

Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
@lancelly
lancelly force-pushed the feat/conv-routing-observability branch from 78fc93f to fc514df Compare July 23, 2026 07:41
@lancelly
lancelly marked this pull request as ready for review July 23, 2026 07:42
@lancelly
lancelly requested review from a team as code owners July 23, 2026 07:42
@lancelly lancelly changed the title [None][feat] Add per-rank routing/scheduling observability to the iteration log [None][chore] Add per-rank routing/scheduling observability to the iteration log Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

PyExecutor now tracks dummy, unscheduled, active, and fetched requests per iteration, and includes these counters in profiler debug output.

Changes

Executor iteration metrics

Layer / File(s) Summary
Scheduling counter tracking
tensorrt_llm/_torch/pyexecutor/py_executor.py
Initializes dummy and unscheduled request counters, then updates them in pipeline-parallel and batch scheduling paths.
Profiler request metrics
tensorrt_llm/_torch/pyexecutor/py_executor.py
Computes per-iteration fetched-request deltas and logs expanded scheduling and request-state counters.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: trtllm-agent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, but it omits the required Test Coverage and PR Checklist sections from the template. Add a Test Coverage section with relevant tests and complete the PR Checklist items, or note why any are not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title is concise and accurately summarizes the main change: added per-rank routing/scheduling observability.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61238 [ run ] triggered by Bot. Commit: fc514df Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61238 [ run ] completed with state FAILURE. Commit: fc514df
/LLM/main/L0_MergeRequest_PR pipeline #49477 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

@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61296 [ run ] triggered by Bot. Commit: fc514df Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61296 [ run ] completed with state FAILURE. Commit: fc514df
/LLM/main/L0_MergeRequest_PR pipeline #49529 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

@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61503 [ run ] triggered by Bot. Commit: fc514df Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61503 [ run ] completed with state SUCCESS. Commit: fc514df
/LLM/main/L0_MergeRequest_PR pipeline #49722 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

@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61547 [ run ] triggered by Bot. Commit: fc514df Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61547 [ run ] completed with state SUCCESS. Commit: fc514df
/LLM/main/L0_MergeRequest_PR pipeline #49759 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

@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61690 [ run ] triggered by Bot. Commit: fc514df Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61690 [ run ] completed with state SUCCESS. Commit: fc514df
/LLM/main/L0_MergeRequest_PR pipeline #49896 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

@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62057 [ run ] triggered by Bot. Commit: fc514df Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62057 [ run ] completed with state SUCCESS. Commit: fc514df
/LLM/main/L0_MergeRequest_PR pipeline #50242 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

@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62079 [ run ] triggered by Bot. Commit: 4fb601b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62079 [ run ] completed with state SUCCESS. Commit: 4fb601b
/LLM/main/L0_MergeRequest_PR pipeline #50267 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants