Skip to content

Comments

[None][fix] Only Use Throughput Metrics to Check Regression#10404

Merged
chenfeiz0326 merged 3 commits intoNVIDIA:mainfrom
chenfeiz0326:chenfeiz/update-perf-regression-check
Jan 6, 2026
Merged

[None][fix] Only Use Throughput Metrics to Check Regression#10404
chenfeiz0326 merged 3 commits intoNVIDIA:mainfrom
chenfeiz0326:chenfeiz/update-perf-regression-check

Conversation

@chenfeiz0326
Copy link
Collaborator

@chenfeiz0326 chenfeiz0326 commented Jan 5, 2026

Summary by CodeRabbit

  • Tests
    • Enhanced performance regression detection with comprehensive metric evaluation and reporting
    • Streamlined regression data handling in test infrastructure, reducing parameter complexity
    • Improved error handling with distinct approaches for pre-merge and post-merge regressions, including detailed per-metric analysis

✏️ Tip: You can customize this high-level summary in your review settings.

Description

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)

  • 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.

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)]

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. Examples: "A10-PyTorch-1, xxx". 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. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

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

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

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.

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
@chenfeiz0326 chenfeiz0326 requested a review from litaotju January 5, 2026 07:22
@chenfeiz0326 chenfeiz0326 self-assigned this Jan 5, 2026
@chenfeiz0326
Copy link
Collaborator Author

/bot run --disable-fail-fast

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

Refactored performance regression detection logic by consolidating regression data handling directly within test data entries instead of using a separate list. Updated function signatures to remove explicit regressive data parameters, with filtering now performed internally. Added metrics-based difference calculation and improved threshold retrieval.

Changes

Cohort / File(s) Summary
Core Regression Logic Refactoring
tests/integration/defs/perf/open_search_db_utils.py
Added REGRESSION_METRICS constant for regression-determining metrics. Introduced _calculate_diff() for percentage difference computation with distinct behavior for maximize vs. minimize metrics. Refactored _get_threshold_for_metric() to centralize threshold retrieval with post-merge awareness. Modified prepare_regressive_test_cases() to attach s_regression_info and b_is_regression directly to entries rather than building separate list. Updated post_new_perf_data() signature (removed regressive_data_list parameter); regressive data now derived internally. Updated check_perf_regression() signature (removed regressive_data_list; now filters new_data_dict for regressions). Changed post-merge regression handling to use print_error and raise RuntimeError; pre-merge uses warnings.
Call Site Updates
tests/integration/defs/perf/test_perf_sanity.py
Removed regressive_data_list variable from prepare_regressive_test_cases() call (now side-effect only). Updated post_new_perf_data() call to omit regressive_data_list argument. Updated check_perf_regression() call to omit regressive_data_list argument.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely empty, containing only template placeholders with no actual explanation of the issue, solution, or test coverage provided. Fill in the Description and Test Coverage sections with details about why regression checks are limited to throughput metrics and what tests validate this change.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: restricting regression checks to only throughput metrics, which aligns with the refactoring shown in the raw_summary.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In @tests/integration/defs/perf/open_search_db_utils.py:
- Around line 459-474: The KeyError message references an undefined fallback_key
in _get_threshold_for_metric; define fallback_key as the alternate expected key
(the pre/post-merge counterpart) before raising the error and include it in the
message, e.g. compute fallback_key = f"d_threshold_post_merge_{metric_suffix}"
if is_post_merge is False (and vice versa), then raise the KeyError using both
threshold_key and fallback_key in the message.
🧹 Nitpick comments (1)
tests/integration/defs/perf/open_search_db_utils.py (1)

734-774: LGTM! Signature correctly updated and error handling improved.

The function signature has been updated to derive regressive_data_list from new_data_dict by filtering entries where b_is_regression is True (lines 739-742). Post-merge regressions now correctly use print_error and raise RuntimeError (lines 767-774), which is appropriately more severe than the warning approach for pre-merge regressions.

Optional: Consider using a custom exception class

Per static analysis (TRY003), the long error message on lines 773-774 could be moved to a custom exception class for better error handling practices:

class PostMergeRegressionError(RuntimeError):
    """Raised when post-merge performance regression is detected."""
    def __init__(self, count):
        super().__init__(f"Found {count} post-merge regression data")
        self.count = count

Then raise it as:

raise PostMergeRegressionError(len(post_merge_regressions))
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c63fad7 and 3534daf.

📒 Files selected for processing (2)
  • tests/integration/defs/perf/open_search_db_utils.py
  • tests/integration/defs/perf/test_perf_sanity.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Code developed for TensorRT-LLM should conform to Python 3.8+
Indent Python code with 4 spaces. Do not use tabs
Always maintain the namespace when importing in Python, even if only one class or function from a module is used
Python files should use snake_case naming: some_file.py
Python classes should use PascalCase naming: class SomeClass
Python functions and methods should use snake_case naming: def my_awesome_function():
Python local variables should use snake_case naming: my_variable = ...
Python variable names that start with a number should be prefixed with 'k': k_99th_percentile = ...
Python global variables should use upper snake_case with prefix 'G': G_MY_GLOBAL = ...
Python constants should use upper snake_case naming: MY_CONSTANT = ...
Avoid shadowing variables declared in an outer scope in Python
Initialize all externally visible members of a Python class in the constructor
For Python interfaces that may be used outside a file, prefer docstrings over comments
Python comments should be reserved for code within a function, or interfaces that are local to a file
Use Google style docstrings in Python for classes and functions, which can be parsed by Sphinx
Python attributes and variables can be documented inline with type and description
Avoid using reflection in Python when functionality can be easily achieved without reflection
When using try-except blocks in Python, limit the except to the smallest set of errors possible
When using try-except blocks in Python to handle multiple possible variable types (duck-typing), keep the body of the try as small as possible, using the else block for logic

Files:

  • tests/integration/defs/perf/open_search_db_utils.py
  • tests/integration/defs/perf/test_perf_sanity.py
**/*.{cpp,h,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the year of its latest meaningful modification

Files:

  • tests/integration/defs/perf/open_search_db_utils.py
  • tests/integration/defs/perf/test_perf_sanity.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: venkywonka
Repo: NVIDIA/TensorRT-LLM PR: 6029
File: .github/pull_request_template.md:45-53
Timestamp: 2025-08-27T17:50:13.264Z
Learning: For PR templates in TensorRT-LLM, avoid suggesting changes that would increase developer overhead, such as converting plain bullets to mandatory checkboxes. The team prefers guidance-style bullets that don't require explicit interaction to reduce friction in the PR creation process.
🧬 Code graph analysis (2)
tests/integration/defs/perf/open_search_db_utils.py (1)
tests/integration/defs/trt_test_alternative.py (1)
  • print_error (318-324)
tests/integration/defs/perf/test_perf_sanity.py (1)
tests/integration/defs/perf/open_search_db_utils.py (3)
  • prepare_regressive_test_cases (492-542)
  • post_new_perf_data (612-631)
  • check_perf_regression (734-778)
🪛 Ruff (0.14.10)
tests/integration/defs/perf/open_search_db_utils.py

472-474: Avoid specifying long messages outside the exception class

(TRY003)


474-474: Undefined name fallback_key

(F821)


773-774: Avoid specifying long messages outside the exception class

(TRY003)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (5)
tests/integration/defs/perf/open_search_db_utils.py (4)

65-71: LGTM! Core change aligning with PR objective.

The new REGRESSION_METRICS constant correctly restricts regression detection to throughput metrics only (seq, token, total_token, user), which aligns with the PR title "Only Use Throughput Metrics to Check Regression."


477-490: LGTM! Percentage difference calculation is correct.

The function correctly handles both MAXIMIZE_METRICS (higher is better) and MINIMIZE_METRICS (lower is better), returning positive percentages for performance improvements and negative for regressions. The zero baseline edge case is handled appropriately.


492-542: LGTM! Correctly implements throughput-only regression checks.

The function now updates new_data_dict entries in place with regression metadata. Importantly, while all metrics are logged in s_regression_info (lines 513-528), only REGRESSION_METRICS (throughput metrics) trigger the b_is_regression flag (lines 530-539), which correctly implements the PR objective.

The regression logic is also correct:

  • For MAXIMIZE_METRICS: regressive if new_value < baseline_value * (1 - threshold)
  • For MINIMIZE_METRICS: regressive if new_value > baseline_value * (1 + threshold)

612-632: LGTM! Signature correctly updated.

The function signature has been updated to remove the regressive_data_list parameter, which is consistent with the refactoring that embeds regression metadata directly in new_data_dict entries.

tests/integration/defs/perf/test_perf_sanity.py (1)

1363-1379: LGTM! Function calls correctly updated.

All three function calls have been correctly updated to match the new signatures from open_search_db_utils.py:

  • Line 1364: prepare_regressive_test_cases now updates new_data_dict in place with no return value
  • Line 1377: post_new_perf_data no longer requires the regressive_data_list parameter
  • Line 1379: check_perf_regression derives regression data internally from new_data_dict

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30564 [ run ] triggered by Bot. Commit: 3534daf

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
@chenfeiz0326
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30569 [ run ] triggered by Bot. Commit: a7d5b1c

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30569 [ run ] completed with state SUCCESS. Commit: a7d5b1c
/LLM/main/L0_MergeRequest_PR pipeline #23580 completed with status: 'FAILURE'

⚠️ 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

@chenfeiz0326
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30598 [ run ] triggered by Bot. Commit: a7d5b1c

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30598 [ run ] completed with state SUCCESS. Commit: a7d5b1c
/LLM/main/L0_MergeRequest_PR pipeline #23607 completed with status: 'SUCCESS'

@chenfeiz0326 chenfeiz0326 merged commit 8a04c05 into NVIDIA:main Jan 6, 2026
5 checks passed
videodanchik pushed a commit to videodanchik/TensorRT-LLM that referenced this pull request Jan 14, 2026
…0404)

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
Signed-off-by: Daniil Kulko <kulkodaniil@gmail.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.

3 participants