Skip to content

[None][fix] trtllm_modeling_v2: checkpoint suite width and tuner job priority in the tune stage - #22003

Merged
ruocheng-nv merged 2 commits into
NVIDIA:mainfrom
ruocheng-nv:user/ruochengj/mv2-harness-robustness
Nov 17, 2026
Merged

ruocheng-nv merged 2 commits into
NVIDIA:mainfrom
ruocheng-nv:user/ruochengj/mv2-harness-robustness

Conversation

@ruocheng-nv

@ruocheng-nv ruocheng-nv commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Two fixes to the trtllm_modeling_v2 tune stage. Both showed up while running a tune campaign for several days on GB300 nodes that were replaced every few hours.

1. A checkpoint's suite runs on one device

  • Problem: a checkpoint runs the target's suite through KeepGate.tests_only(), which drops the accuracy members. suite_devices was derived from the members only, so the suite job asked for one GPU. The target's multi-rank tests (a collective's op matrix at the widest member's world size) then failed at every checkpoint, and every keep since the last checkpoint was rolled back.
  • Fix: tests_only() records the members' width in a new suite_width field, and suite_devices prefers it.
  • refresh_inputs leaves suite_width out of the campaign's evidence inputs. The field only restates the members' width, so a campaign resumed across this change keeps its controls and measurements. A checkpoint suite job that is already queued at one device when the harness is upgraded still runs that way once.

2. Revise and rebase turns queue their jobs at the default priority

  • Problem: the campaign measures one candidate at a time at PERF (-1). Tuner jobs are meant to queue below it at TUNER (-2). Negative priorities never age, so a tuner job at the default priority 0 always ranks ahead of the campaign's measurement and holds back every candidate behind it. The new-candidate and split requests and the speed-of-light profiling step ask for --priority -2. The revise and rebase requests and the turn prompt shared by every tuner turn show spoolctl launch without it. In a long campaign most late turns are rebases. On an earlier revision of the harness, where no tuner job carried a priority class, the serial measurement was seen waiting for hours behind tuner jobs at the default priority; on main, the revise and rebase turns are the remaining gap.
  • Fix: the revise and rebase requests and the turn prompt's operating rules give --priority {TUNER}.

Other failures seen in the same run (a candidate measurement ending with an infrastructure rc; an A/B split across two hosts by a node replacement) are already handled on main by #21629.

Not included / possible follow-ups

  • Accept a control measured on another node when the verdict holds under a small ± margin. Today the control is re-measured on the candidate's node, which costs a full serving run after every node replacement.
  • Re-queue candidates whose keep was reverted by a checkpoint that failed for a reason outside the candidates. The stage never re-queues them. With the width fix above we have not seen a case that needs this.
  • The planner's inbox is not read during the tune stage, so operator notes sent after delivery are not seen.
  • A perf.campaign.accuracy.gate: off campaign has no members, so its suite job still asks for one device.

Test Coverage

  • tests/workflows/trtllm_modeling_v2/test_tune_stage.py::test_a_checkpoints_suite_job_holds_as_many_devices_as_the_widest_member: the checkpoint's suite job is submitted with the widest member's device count (fails before the fix: 1 vs 4).
  • tests/workflows/trtllm_modeling_v2/test_tune_stage.py::test_the_suite_width_leaves_the_campaigns_evidence_inputs_as_they_were: changing suite_width leaves the campaign's evidence inputs unchanged (fails if the field enters the key).
  • tests/workflows/trtllm_modeling_v2/test_tune_stage.py::test_every_tuner_turn_queues_its_jobs_below_the_campaigns_measurement (fails before the fix).
  • Full agent-flow suite (cd agent-flow && python -m pytest tests): 1850 passed.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

@ruocheng-nv
ruocheng-nv force-pushed the user/ruochengj/mv2-harness-robustness branch from 8b9b5a7 to 21ce6ff Compare November 10, 2026 13:51
@ruocheng-nv
ruocheng-nv marked this pull request as ready for review November 10, 2026 13:55
@ruocheng-nv
ruocheng-nv requested a review from a team as a code owner November 10, 2026 13:55
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 21ce6ff and c0a0ca3.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The changes preserve suite device requirements for tests-only checkpoint gates without changing campaign evidence inputs. They also update revise and rebase instructions to use tuner priority for GPU jobs.

Changes

Checkpoint gate width

Layer / File(s) Summary
Preserve suite width and evidence inputs
agent-flow/agent_flow/workflows/trtllm_modeling_v2/tune/keep_gate.py, agent-flow/agent_flow/workflows/trtllm_modeling_v2/tune/campaign.py, agent-flow/tests/workflows/trtllm_modeling_v2/test_tune_stage.py
KeepGate.tests_only() saves the suite device count before clearing members, and suite_devices uses the saved width when present. Campaign evidence hashing excludes suite_width. Tests check the retained device count and stable evidence inputs.

GPU job instructions

Layer / File(s) Summary
Update revise and rebase instructions
agent-flow/agent_flow/workflows/trtllm_modeling_v2/tune/requests.py, agent-flow/tests/workflows/trtllm_modeling_v2/test_tune_stage.py
Revise and rebase instructions require tuner priority for GPU jobs. Revise instructions use git -C {worktree} for the signed commit. Tests check the rendered request text and turn prompts.

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

Change: Bug fix

Possibly related PRs

Suggested labels: api-compatible

Merge Risk: Minimal · previous review 21ce6

The checkpoint-width and tuner-priority changes are ready for normal merge checks; no issue requiring a pre-merge fix was identified.

Security architecture risk: Low · up to 21ce6

The change restores checkpoint GPU capacity and directs background work to a lower scheduling priority. No new security bypass was demonstrated in the inspected paths, but concurrent-workspace behavior and deployment isolation remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated effect is wider checkpoint GPU reservation within configured development spools. Allocation still passes through existing placement and scheduler admission paths. This establishes a shared-compute scheduling effect, not expanded tenant, credential, or service authority.

Trust Boundaries and Controls

  • inferred — The priority update asks already-authorized GPU-job callers to select a lower scheduling class. It does not add a tool, credential, or authorization check, and textual instructions alone do not guarantee caller compliance. That limitation predates this PR and is not an introduced security finding.

Resilience and Maintainability Implications

  • observed — Correctness retries remain bounded, unavailable gate results are not converted to PASS, and rollback checks whether the best tree is still in use before resetting it. These controls remain on the changed checkpoint path.
Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title follows the required ticket/type format and clearly identifies both tune-stage fixes: checkpoint suite width and tuner job priority.
Description check Passed The description explains both problems and fixes, lists relevant regression tests and full-suite results, and includes the template’s required sections and checklist.
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.
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 7 functions across 4 files.

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 37e6e67 and 21ce6ff.

Files selected for processing: 4

  • agent-flow/agent_flow/workflows/trtllm_modeling_v2/tune/campaign.py
  • agent-flow/agent_flow/workflows/trtllm_modeling_v2/tune/keep_gate.py
  • agent-flow/agent_flow/workflows/trtllm_modeling_v2/tune/requests.py
  • agent-flow/tests/workflows/trtllm_modeling_v2/test_tune_stage.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.

@ruocheng-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83809 [ run ] triggered by Bot. Commit: 21ce6ff Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83809 [ run ] completed with state SUCCESS. Commit: 21ce6ff
/LLM/main/L0_MergeRequest_PR pipeline #69302 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

@ruocheng-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83856 [ run ] triggered by Bot. Commit: 21ce6ff Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83856 [ run ] completed with state SUCCESS. Commit: 21ce6ff
/LLM/main/L0_MergeRequest_PR pipeline #69348 completed with status: 'SUCCESS'

CI Report

Link to invocation

…t's keep gate

A tune checkpoint runs the target's suite through KeepGate.tests_only(),
which drops the accuracy members because accuracy runs once on the final
tree. suite_devices was derived from those members only, so the
checkpoint's suite job asked for one device. The target's multi-rank
tests (a collective's op matrix at the widest member's world size) then
failed for the job's size at every checkpoint, and every keep since the
last checkpoint was rolled back.

tests_only() now records the members' width in a suite_width field,
which suite_devices prefers, so the checkpoint's suite job holds as many
devices as the full gate's suite.

The field only restates the members' width, so refresh_inputs leaves it
out of the campaign's evidence inputs. Otherwise a campaign resumed
across this change would discard its controls and measurements and
measure them all again.

Signed-off-by: Ruocheng Jia <ruochengj@nvidia.com>
…t the tuner priority

The tune campaign measures one candidate at a time at priority PERF
(-1), and a tuner's own jobs are meant to queue below it at TUNER (-2).
Negative priorities never age, so a job at the scheduler's default
priority 0 always ranks ahead of the campaign's measurement and holds
back every candidate behind it. The new-candidate and split requests
and the speed-of-light profiling step tell the tuner to pass
--priority; the revise and rebase requests and the turn prompt's
operating rules show spoolctl launch without it, so those turns' tests
and A/B jobs queue at 0. In a long campaign most late turns are
rebases.

On an earlier revision of the harness, where no tuner job carried a
priority class, the serial measurement was seen waiting for hours
behind tuner jobs at the default priority. On main, the revise and
rebase turns are the remaining gap.

The revise and rebase requests and the turn prompt shared by every
tuner turn now give the --priority TUNER flag.

Signed-off-by: Ruocheng Jia <ruochengj@nvidia.com>
@ruocheng-nv
ruocheng-nv force-pushed the user/ruochengj/mv2-harness-robustness branch from 21ce6ff to c0a0ca3 Compare November 12, 2026 09:26
@ruocheng-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #84442 [ run ] triggered by Bot. Commit: c0a0ca3 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #84442 [ run ] completed with state SUCCESS. Commit: c0a0ca3
/LLM/main/L0_MergeRequest_PR pipeline #69838 completed with status: 'SUCCESS'

CI Report

Link to invocation

@github-actions

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.

@ruocheng-nv
ruocheng-nv merged commit ff61cfb into NVIDIA:main Nov 17, 2026
6 checks passed
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.

5 participants