[TRTLLM-10300][feat] Upload regression info to artifactory#10599
Conversation
📝 WalkthroughWalkthroughThe changes introduce a performance regression reporting pipeline integrated into the CI/CD workflow. Test execution generates regression data files, which are collected, processed by a new Python script, aggregated into an HTML report, and uploaded as a test artifact. Changes
Sequence DiagramsequenceDiagram
participant Test as Test Execution
participant Util as check_perf_regression()
participant YAMLFile as regression_data.yaml
participant Pipeline as L0_Test.groovy
participant Script as perf_regression.py
participant Report as perf_regression.html
participant Artifact as Test Artifact Storage
Test->>Util: check_perf_regression(data, output_dir)
Util->>YAMLFile: write regression_data.yaml
Pipeline->>Pipeline: downloadPerfResults()
Pipeline->>Script: invoke perf_regression.py<br/>(--input-files *.yaml<br/>--output-file report.html)
Script->>Script: merge_regression_data()
Script->>Script: generate_html()
Script->>Report: write HTML report
Pipeline->>Artifact: upload perf_regression.html
Artifact->>Artifact: store as test artifact
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
jenkins/L0_Test.groovy (1)
127-166: Perf scp globbing looks brittle (brace expansion + quoting likely prevents matches)
'${perfResultsBasePath}/{aggr,disagg}*'relies on brace expansion and/or remote globbing semantics; with the current quoting it’s very likely to be treated literally and download nothing. Safer to do two explicit scp attempts and OR the results.Proposed fix
- // Download perf test results - def perfResultsBasePath = "/home/svc_tensorrt/bloom/scripts/${nodeName}" - downloadPerfResultSucceed = Utils.exec(pipeline, script: "sshpass -p '${remote.passwd}' scp -P ${remote.port} -r -p ${COMMON_SSH_OPTIONS} ${remote.user}@${remote.host}:'${perfResultsBasePath}/{aggr,disagg}*' ${stageName}/", returnStatus: true, numRetries: 3) == 0 + // Download perf test results + def perfResultsBasePath = "/home/svc_tensorrt/bloom/scripts/${nodeName}" + def downloadAggrPerfResultSucceed = Utils.exec( + pipeline, + script: "sshpass -p '${remote.passwd}' scp -P ${remote.port} -r -p ${COMMON_SSH_OPTIONS} ${remote.user}@${remote.host}:${perfResultsBasePath}/aggr* ${stageName}/", + returnStatus: true, + numRetries: 3 + ) == 0 + def downloadDisaggPerfResultSucceed = Utils.exec( + pipeline, + script: "sshpass -p '${remote.passwd}' scp -P ${remote.port} -r -p ${COMMON_SSH_OPTIONS} ${remote.user}@${remote.host}:${perfResultsBasePath}/disagg* ${stageName}/", + returnStatus: true, + numRetries: 3 + ) == 0 + downloadPerfResultSucceed = downloadAggrPerfResultSucceed || downloadDisaggPerfResultSucceed
🤖 Fix all issues with AI agents
In @jenkins/scripts/perf/perf_regression.py:
- Around line 69-109: The merge_regression_data function currently swallows all
exceptions; change it to only catch OSError and yaml.YAMLError (import
yaml.YAMLError) when reading/parsing files, and remove the broad Exception
handler; while iterating collect failures in a local failures list as tuples of
(yaml_file, str(error)) and append on each caught error, and after the loop if
yaml_files is non-empty but regression_dict is still empty raise a RuntimeError
(or return a non-zero failure signal) that includes the list of failed files so
CI can detect that inputs were provided but none parsed; keep the rest of the
logic (stage_name/folder_name extraction and filtering) intact and reference
merge_regression_data, regression_dict, yaml_files, and failures when making
changes.
- Around line 1-8: Add the required NVIDIA SPDX/copyright header at the top of
the file and replace the "from html import escape as escape_html" import with a
module import to preserve the module namespace (use "import html"); then update
any uses of the alias escape_html to call html.escape(...) instead so the code
follows the guideline and includes the SPDX header.
In @tests/integration/defs/perf/open_search_db_utils.py:
- Around line 25-26: The test module imports the yaml module but the PyYAML
package is missing from the test requirements; add the package name pyyaml
(lowercase) to the perf requirements file so the import yaml resolves in the
test environment and the tests can install the dependency.
🧹 Nitpick comments (5)
jenkins/scripts/perf/perf_regression.py (1)
112-251: Optional: stabilize HTML output ordering (stage + folder) for easier diffsRight now output order depends on input ordering and dict insertion. Sorting
for stage_name in …(and maybe folders) would make artifacts more deterministic and reviewable.tests/integration/defs/perf/test_perf_sanity.py (1)
1065-1074: Good direction: regression YAMLs now land in a per-test output directory (enables CI collection)This wiring makes it much easier for Jenkins to collect
regression_data.yamland generate an aggregated report.But: initialize
perf_sanity_output_dirin__init__(avoid attribute-order fragility)Right now
upload_test_results_to_database()assumesget_commands()was called first. Per coding guidelines, initialize this member in the constructor afterparse_test_case_name().Proposed fix
class PerfSanityTestConfig: @@ def __init__(self, test_case_name: str, output_dir: str): self._output_dir = output_dir self._perf_results: Dict[int, List[Dict[str, float]]] = {} + self.perf_sanity_output_dir: Optional[str] = None # Parse test case name self.parse_test_case_name(test_case_name) + self.perf_sanity_output_dir = os.path.join(self._output_dir, self._test_param_labels) @@ def get_commands(self): """Get commands based on runtime.""" - self.perf_sanity_output_dir = os.path.join(self._output_dir, self._test_param_labels) os.makedirs(self.perf_sanity_output_dir, exist_ok=True)Also applies to: 1439-1443
jenkins/L0_MergeRequest.groovy (1)
867-886: Consider adding error handling for the Python script execution.The new stage lacks error handling around the Python script invocation. If
perf_regression.pyfails (e.g., malformed YAML, missing dependencies), the entireCollect Test Resultflow will fail. Consider wrapping the script execution in a try-catch block similar to the "Test Coverage" stage pattern (lines 926-968) to allow graceful degradation.Additionally, the
findcommand output processing could fail silently if path names contain special characters. Consider using\0delimiter withfind -print0for more robust handling, though this may be overkill for controlled CI environments.♻️ Suggested error handling pattern
stage("Collect Perf Regression Result") { + try { // Find all regression_data.yaml files. def yamlFiles = sh( returnStdout: true, script: 'find . -type f -name "regression_data.yaml" \\( -path "*/aggr*/*" -o -path "*/disagg*/*" \\) 2>/dev/null || true' ).trim() if (yamlFiles) { def yamlFileList = yamlFiles.split("\n").collect { it.trim() }.findAll { it }.join(",") echo "Found regression data files: ${yamlFileList}" sh """ python3 llm/jenkins/scripts/perf/perf_regression.py \ --input-files=${yamlFileList} \ --output-file=perf_regression.html """ trtllm_utils.uploadArtifacts("perf_regression.html", "${UPLOAD_PATH}/test-results/") echo "Perf regression report: https://urm.nvidia.com/artifactory/${UPLOAD_PATH}/test-results/perf_regression.html" } else { echo "No regression_data.yaml files found." } + } catch (InterruptedException e) { + throw e + } catch (Exception e) { + pipeline.echo("Perf regression report generation failed: ${e.toString()}") + } } // Collect Perf Regression Result stagetests/integration/defs/perf/open_search_db_utils.py (2)
1-2: Update the copyright year to reflect this modification.The copyright header indicates 2022-2024, but this file has meaningful modifications in 2026. As per coding guidelines, the copyright year should reflect the year of latest meaningful modification.
♻️ Suggested fix
-# SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
693-700: Consider handling the case whereoutput_dirdoes not exist.If
output_diris provided but the directory doesn't exist,open()will raiseFileNotFoundError. Consider either creating the directory or adding error handling to prevent unexpected failures during test execution.♻️ Suggested fix with directory creation
# Save regression data to yaml file if output_dir is provided if output_dir is not None and len(regressive_data_list) > 0: + os.makedirs(output_dir, exist_ok=True) regression_data_file = os.path.join(output_dir, "regression_data.yaml") with open(regression_data_file, 'w') as f: yaml.dump(regressive_data_list, f, default_flow_style=False) print_info( f"Saved {len(regressive_data_list)} regression data to {regression_data_file}" )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
jenkins/L0_MergeRequest.groovyjenkins/L0_Test.groovyjenkins/scripts/perf/perf_regression.pytests/integration/defs/perf/open_search_db_utils.pytests/integration/defs/perf/test_perf_sanity.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: The 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 Python modules, even if only one class or function from a module is used
Python filenames should use snake_case (e.g.,some_file.py)
Python classes should use PascalCase (e.g.,class SomeClass)
Python functions and methods should use snake_case (e.g.,def my_awesome_function():)
Python local variables should use snake_case, with prefixkfor variable names that start with a number (e.g.,k_99th_percentile)
Python global variables should use upper snake_case with prefixG(e.g.,G_MY_GLOBAL)
Python constants should use upper snake_case (e.g.,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
Use comments in Python for code within a function, or interfaces that are local to a file
Use Google-style docstrings for Python classes and functions, which can be parsed by Sphinx
Python attributes and variables can be documented inline with the format"""<type>: Description"""
Avoid using reflection in Python when functionality can be easily achieved without reflection
When using try-except blocks in Python, limit the except clause 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 and use the else block for the main logic
Files:
tests/integration/defs/perf/open_search_db_utils.pytests/integration/defs/perf/test_perf_sanity.pyjenkins/scripts/perf/perf_regression.py
**/*.{cpp,cc,cxx,h,hpp,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
All TensorRT-LLM source files (.cpp, .h, .cu, .py, and other source files) should contain an NVIDIA copyright header with the year of latest meaningful modification
Files:
tests/integration/defs/perf/open_search_db_utils.pytests/integration/defs/perf/test_perf_sanity.pyjenkins/scripts/perf/perf_regression.py
🧬 Code graph analysis (1)
tests/integration/defs/perf/test_perf_sanity.py (1)
tests/integration/defs/perf/open_search_db_utils.py (1)
check_perf_regression(669-736)
🪛 Ruff (0.14.10)
jenkins/scripts/perf/perf_regression.py
105-105: Do not catch blind exception: Exception
(BLE001)
⏰ 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 (1)
tests/integration/defs/perf/open_search_db_utils.py (1)
669-677: LGTM!The function signature change is backward-compatible with the optional
output_dirparameter defaulting toNone. The docstring appropriately documents the new behavior.
|
/bot run --disable-fail-fast --stage-list "GB200-4_GPUs-PyTorch-PerfSanity-1,GB200-4_GPUs-PyTorch-PerfSanity-2,GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1" |
|
PR_Github #31535 [ run ] triggered by Bot. Commit: |
|
PR_Github #31535 [ run ] completed with state |
|
/bot run --disable-fail-fast --stage-list "GB200-4_GPUs-PyTorch-PerfSanity-1,GB200-4_GPUs-PyTorch-PerfSanity-2,GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1" |
|
PR_Github #31583 [ run ] triggered by Bot. Commit: |
|
PR_Github #31583 [ run ] completed with state
|
|
/bot run --disable-fail-fast --stage-list "GB200-4_GPUs-PyTorch-PerfSanity-1,GB200-4_GPUs-PyTorch-PerfSanity-2,GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1" |
|
PR_Github #31670 [ run ] triggered by Bot. Commit: |
|
PR_Github #31670 [ run ] completed with state
|
|
/bot run --disable-fail-fast --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1" |
|
PR_Github #31713 [ run ] triggered by Bot. Commit: |
|
/bot run --disable-fail-fast --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-PerfSanity-Post-Merge-1" |
|
PR_Github #31743 [ run ] triggered by Bot. Commit: |
|
PR_Github #31743 [ run ] completed with state |
|
/bot run --disable-fail-fast --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-PerfSanity-Post-Merge-1" |
|
PR_Github #31759 [ run ] triggered by Bot. Commit: |
|
PR_Github #31759 [ run ] completed with state |
|
/bot run --disable-fail-fast --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-PerfSanity-Post-Merge-1" |
|
PR_Github #31781 [ run ] triggered by Bot. Commit: |
|
PR_Github #31781 [ run ] completed with state
|
|
/bot run --disable-fail-fast --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-PerfSanity-Post-Merge-2" |
1 similar comment
|
/bot run --disable-fail-fast --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-PerfSanity-Post-Merge-2" |
|
PR_Github #32379 [ run ] triggered by Bot. Commit: |
|
PR_Github #32379 [ run ] completed with state |
|
/bot run --disable-fail-fast --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-PerfSanity-Post-Merge-1,GB200-8_GPUs-2_Nodes-PyTorch-PerfSanity-Post-Merge-2" |
|
PR_Github #32388 [ run ] triggered by Bot. Commit: |
|
PR_Github #32388 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #32396 [ run ] triggered by Bot. Commit: |
|
PR_Github #32396 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #32407 [ run ] triggered by Bot. Commit: |
|
PR_Github #32407 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #32411 [ run ] triggered by Bot. Commit: |
|
PR_Github #32411 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #32424 [ run ] triggered by Bot. Commit: |
|
PR_Github #32424 [ run ] completed with state
|
Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
7c52a5d to
15f71fc
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #32427 [ run ] triggered by Bot. Commit: |
|
PR_Github #32427 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #32453 [ run ] triggered by Bot. Commit: |
|
PR_Github #32453 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #32482 [ run ] triggered by Bot. Commit: |
|
PR_Github #32482 [ run ] completed with state |
Summary by CodeRabbit
✏️ 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 thestage-listparameter 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.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip 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-pipelineReuse 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.