Skip to content

[#10710][fix] clarify and align trtllm-bench runtime logging - #15254

Merged
marinayanov merged 6 commits into
NVIDIA:mainfrom
nv-auto-deploy:myanov/fix-bench-single-flag-report
Jun 23, 2026
Merged

[#10710][fix] clarify and align trtllm-bench runtime logging#15254
marinayanov merged 6 commits into
NVIDIA:mainfrom
nv-auto-deploy:myanov/fix-bench-single-flag-report

Conversation

@marinayanov

@marinayanov marinayanov commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Follow-up to #14812. That PR made explicit CLI flags win over YAML config; this
PR fixes the logging and reporting of max_batch_size / max_num_tokens in
trtllm-bench so what's printed matches what the engine actually runs with.

Problem

After #14812, the values reported by trtllm-bench could diverge from the
values the engine actually used:

  1. Single CLI flag silently ignored. get_settings() only honored
    --max_batch_size / --max_num_tokens when both were passed. Providing
    just one fell back to the heuristic for both, discarding the user's value
    with no clear log.

  2. Report showed pre-merge values. settings_config was populated before
    the extra_llm_api_options YAML merge in get_llm_args(), but the final
    report reads from settings_config. So when YAML supplied a value the user
    didn't set on the CLI, the report (e.g. Max Runtime Tokens) showed the
    stale pre-merge number while the engine ran the merged one.

  3. Ambiguous logging. The settings log didn't make clear which values were
    user-provided vs. heuristic, and why the final report might differ.

Changes

  • utils/general.py: honor a single CLI flag — use the user value for the
    one provided and the heuristic for the other. Unified all four cases into a
    consistent Initial settings: max_batch_size=... (user-provided|heuristic), max_num_tokens=... (user-provided|heuristic). line so each value's source is
    explicit and the "initial/pre-merge" nature is clear.
  • throughput.py / low_latency.py: sync settings_config.max_batch_size
    and max_num_tokens to the post-merge kwargs (after get_llm_args(),
    before get_llm()), so the final report reflects the values actually passed
    to the engine.

Test Coverage

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.

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

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced runtime configuration synchronization to ensure batch size and token limit overrides are properly applied across benchmarks.
    • Improved granular logging for batch size and token limit configuration scenarios during benchmark execution.

Ensure explicit benchmark runtime flags (max_batch_size / max_num_tokens)
are honored independently of one another and reflected in the runtime
settings after the config merge, for both throughput and low-latency
paths. Also clarify get_settings logging to distinguish user-provided
from heuristic values.

Signed-off-by: marinayanov <256585945+marinayanov@users.noreply.github.com>
@marinayanov
marinayanov requested a review from a team as a code owner June 11, 2026 07:54
@marinayanov
marinayanov requested a review from FrankD412 June 11, 2026 07:54
@marinayanov
marinayanov enabled auto-merge (squash) June 11, 2026 07:57
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR refactors benchmark runtime configuration to explicitly propagate user-provided batch size and token limits. The get_settings utility now handles parameter overrides granularly with case-specific logging, and both benchmark modes synchronize those values into the runtime config before constructing the LLM instance.

Changes

Benchmark Settings Override Flow

Layer / File(s) Summary
Settings computation and user override handling
tensorrt_llm/bench/benchmark/utils/general.py
User-provided max_batch_size and max_num_tokens are extracted separately from params. When both are provided, they are used directly with combined logging. When only one is provided, it replaces its heuristic-computed counterpart while the other is retained, with distinct per-case log messages. The chunked-prefill warning logic is reordered to apply after override computation.
Benchmark runtime configuration synchronization
tensorrt_llm/bench/benchmark/low_latency.py, tensorrt_llm/bench/benchmark/throughput.py
Both low-latency and throughput benchmarks now explicitly synchronize runtime_config.settings_config.max_batch_size and runtime_config.settings_config.max_num_tokens with the computed kwargs values immediately after runtime config construction, ensuring the final configuration reflects all user overrides before LLM initialization.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The PR description thoroughly explains the problem, solution, and changes made across three files. It identifies the root cause from #14812, explains the specific logging/reporting issues, and outlines how they are fixed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 clearly identifies the main purpose: improving runtime logging clarity and alignment in the trtllm-bench benchmarking tool, which directly corresponds to the PR objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tensorrt_llm/bench/benchmark/utils/general.py`:
- Around line 117-118: The CLI override checks currently use truthiness (e.g.,
"if user_max_batch_size and user_max_num_tokens:") so explicit zeros are treated
as missing; update those conditionals to use explicit presence checks like "is
not None" (for example change the check for user_max_batch_size and
user_max_num_tokens to "if user_max_batch_size is not None and
user_max_num_tokens is not None:") and do the same for the other user_* CLI
variables in this module (replace truthy checks with "is not None" or validate
as positive with a clear error) so zero values are honored or rejected
explicitly.
- Around line 117-121: The branch that sets max_batch_size, max_num_tokens from
user_max_batch_size/user_max_num_tokens skips the chunked-prefill minimum-token
floor currently enforced in the later else block; update the user-provided
branch to apply the same floor logic to max_num_tokens (i.e., run the same
min/max adjustment used in the else block that enforces the chunked-prefill
floor when chunked prefill is disabled) so max_num_tokens is raised to the
required minimum before returning/using it; ensure you reference and adjust the
same variables max_num_tokens (from user_max_num_tokens) and max_batch_size
(from user_max_batch_size) and reuse the existing floor-check logic rather than
duplicating inconsistent code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 79801fd6-1fce-49c1-a0ad-56d5a4605376

📥 Commits

Reviewing files that changed from the base of the PR and between 6b7d8cf and 7628e5a.

📒 Files selected for processing (3)
  • tensorrt_llm/bench/benchmark/low_latency.py
  • tensorrt_llm/bench/benchmark/throughput.py
  • tensorrt_llm/bench/benchmark/utils/general.py

Comment thread tensorrt_llm/bench/benchmark/utils/general.py Outdated
Comment thread tensorrt_llm/bench/benchmark/utils/general.py Outdated
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53524 [ run ] triggered by Bot. Commit: 7628e5a Link to invocation

@marinayanov

Copy link
Copy Markdown
Collaborator Author

/bot help

@github-actions

Copy link
Copy Markdown

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental) --high-priority]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Supports wildcard * for pattern matching (e.g., "*PerfSanity*" matches all stages containing PerfSanity). Examples: "A10-PyTorch-1, xxx", "PerfSanity". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Supports wildcard * for pattern matching. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx", --extra-stage "Post-Merge".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

--high-priority (OPTIONAL) : Run the pipeline with high priority. This option is restricted to authorized users only and will route the job to a high-priority queue.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

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.

@marinayanov

Copy link
Copy Markdown
Collaborator Author

/bot kill

@marinayanov marinayanov changed the title [#10710][fix] clarify and align trtllm-bench runtime logging [#10710][fix] clarify and align trtllm-bench runtime logging Jun 11, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53528 [ kill ] triggered by Bot. Commit: 0b537c5 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53524 [ run ] completed with state ABORTED. Commit: 7628e5a

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53528 [ kill ] completed with state SUCCESS. Commit: 0b537c5
Successfully killed previous jobs for commit 0b537c5

Link to invocation

Use `is not None` for max_batch_size / max_num_tokens presence checks so an
explicit 0 is not treated as "not provided". Enforce the chunked-prefill
max_num_tokens floor on every path (including when both limits are
user-provided) and only warn when the value is actually below the floor.

Signed-off-by: marinayanov <256585945+marinayanov@users.noreply.github.com>
@marinayanov

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53667 [ run ] triggered by Bot. Commit: 48f256c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53667 [ run ] completed with state SUCCESS. Commit: 48f256c
/LLM/main/L0_MergeRequest_PR pipeline #42807 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

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53945 [ run ] triggered by Bot. Commit: ce01473 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@Superjomn Superjomn 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

@galagam galagam 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.

Overall looks good, see comments

Comment thread tensorrt_llm/bench/benchmark/low_latency.py Outdated
Comment thread tensorrt_llm/bench/benchmark/throughput.py Outdated
…h_size and max_num_tokens, ensuring defaults are preserved

Signed-off-by: marinayanov <256585945+marinayanov@users.noreply.github.com>
@marinayanov

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55236 [ run ] triggered by Bot. Commit: 15c87e0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55236 [ run ] completed with state SUCCESS. Commit: 15c87e0
/LLM/main/L0_MergeRequest_PR pipeline #44194 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

Link to invocation

@marinayanov

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55243 [ run ] triggered by Bot. Commit: 72b7ebf Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55243 [ run ] completed with state FAILURE. Commit: 72b7ebf
/LLM/main/L0_MergeRequest_PR pipeline #44201 completed with status: 'ABORTED'

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

@marinayanov

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55249 [ run ] triggered by Bot. Commit: 72b7ebf Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55249 [ run ] completed with state SUCCESS. Commit: 72b7ebf
/LLM/main/L0_MergeRequest_PR pipeline #44207 completed with status: 'SUCCESS'

CI Report

Link to invocation

@marinayanov
marinayanov merged commit 8412a17 into NVIDIA:main Jun 23, 2026
7 checks passed
xinhe-nv pushed a commit to tensorrt-cicd/TensorRT-LLM that referenced this pull request Jun 24, 2026
…VIDIA#15254)

Signed-off-by: marinayanov <256585945+marinayanov@users.noreply.github.com>
Signed-off-by: GitLab CI Bot <gitlab-ci@nvidia.com>
BrianLi23 pushed a commit to BrianLi23/TensorRT-LLM that referenced this pull request Jul 9, 2026
…VIDIA#15254)

Signed-off-by: marinayanov <256585945+marinayanov@users.noreply.github.com>
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.

4 participants