-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[#8391][fix] check perf by device subtype #8428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
📝 WalkthroughWalkthroughAdds device subtype support to GPU performance testing infrastructure. Extends GPU clock lock properties to compute and expose device subtypes, adds lookup logic with PCI ID mapping, integrates subtype into test configuration and labels, filters performance dataframes by subtype for consistency, and exports subtype information through test descriptions. Changes
Sequence DiagramsequenceDiagram
participant Test as Performance Test
participant GPU as GPUClockLock
participant Misc as misc.get_device_subtype
participant Config as PerfTestConfig
participant Perf as SanityPerfCheck
participant Export as Data Export
Test->>GPU: Initialize GPU properties
GPU->>GPU: Retrieve PCI device ID & product name
GPU->>Misc: get_device_subtype(pci_id, product_name)
Misc-->>GPU: Return device_subtype (mapped or derived)
GPU->>GPU: Store device_subtype in _gpu_properties
GPU->>Config: get_device_subtype()
Config->>Config: Include device_subtype in label & metric naming
Test->>Perf: Receive baseline & current perf data
Perf->>Perf: _filter_by_device_subtype(base, current)
Perf->>Perf: Filter dataframes by matching subtype
Perf->>Perf: Compute diffs on filtered data
Perf->>Export: Provide filtered results
Export->>Export: Include device_subtype in exported test description
Export-->>Test: Return formatted results with subtype
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes The changes introduce device subtype support across multiple interconnected files with new methods and logic paths. While individual changes are manageable, the distributed nature requires understanding how subtype flows from GPU properties through lookup, configuration, filtering, and export layers. Data consistency patterns and the conditional filtering logic warrant careful review. Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tests/integration/defs/perf/misc.py (1)
23-64: LGTM! Consider documentation for mapping updates.The PCI device ID to subtype mapping and fallback logic are well-implemented. The function provides a clean abstraction for device subtype resolution.
Optional: Document the mapping maintenance process.
Consider adding a comment at the top of
_PCI_DEVICE_ID_TO_SUBTYPEnoting where to find PCI device IDs for new GPU variants and the process for keeping this mapping current. This would help future maintainers when new GPU families are released.Example:
+# Mapping of PCI device IDs to device subtypes +# PCI device IDs can be found in NVML documentation or by querying pynvml.nvmlDeviceGetPciInfo() +# Add new entries when introducing support for new GPU variants _PCI_DEVICE_ID_TO_SUBTYPE = {tests/integration/defs/perf/test_perf.py (1)
977-981: Consider explicit Optional type annotations.The
gpu_clock_lockparameter uses implicitOptionaltyping. While functionally correct, explicit typing improves code clarity.Apply this diff to use explicit Optional typing:
def set_runtime_configs(self, llm_root, working_dir, perf_cache_fpath, - gpu_clock_lock=None) -> None: + gpu_clock_lock: Optional[GPUClockLock] = None) -> None:Note: Ensure
Optionalis imported fromtypingandGPUClockLockis imported from the appropriate module.Also applies to: 1012-1012
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
tests/integration/defs/perf/data_export.py(1 hunks)tests/integration/defs/perf/gpu_clock_lock.py(3 hunks)tests/integration/defs/perf/misc.py(1 hunks)tests/integration/defs/perf/sanity_perf_check.py(2 hunks)tests/integration/defs/perf/test_perf.py(6 hunks)tests/integration/defs/perf/utils.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Use only spaces, no tabs; indent with 4 spaces.
Files:
tests/integration/defs/perf/data_export.pytests/integration/defs/perf/misc.pytests/integration/defs/perf/gpu_clock_lock.pytests/integration/defs/perf/utils.pytests/integration/defs/perf/sanity_perf_check.pytests/integration/defs/perf/test_perf.py
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.
Files:
tests/integration/defs/perf/data_export.pytests/integration/defs/perf/misc.pytests/integration/defs/perf/gpu_clock_lock.pytests/integration/defs/perf/utils.pytests/integration/defs/perf/sanity_perf_check.pytests/integration/defs/perf/test_perf.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Files:
tests/integration/defs/perf/data_export.pytests/integration/defs/perf/misc.pytests/integration/defs/perf/gpu_clock_lock.pytests/integration/defs/perf/utils.pytests/integration/defs/perf/sanity_perf_check.pytests/integration/defs/perf/test_perf.py
🧬 Code graph analysis (4)
tests/integration/defs/perf/misc.py (1)
tests/integration/defs/perf/gpu_clock_lock.py (1)
get_device_subtype(127-131)
tests/integration/defs/perf/gpu_clock_lock.py (2)
tests/integration/defs/trt_test_alternative.py (3)
print_error(318-324)print_info(300-306)print_warning(309-315)tests/integration/defs/perf/misc.py (2)
clean_device_product_name(67-82)get_device_subtype(48-64)
tests/integration/defs/perf/utils.py (3)
tests/integration/defs/perf/gpu_clock_lock.py (1)
get_device_subtype(127-131)tests/integration/defs/perf/misc.py (1)
get_device_subtype(48-64)tests/integration/defs/perf/test_perf.py (1)
get_test_name(974-975)
tests/integration/defs/perf/test_perf.py (4)
tests/integration/defs/perf/utils.py (1)
set_runtime_configs(391-395)tests/integration/defs/conftest.py (1)
trt_gpu_clock_lock(662-676)tests/integration/defs/perf/gpu_clock_lock.py (1)
get_device_subtype(127-131)tests/integration/defs/perf/misc.py (1)
get_device_subtype(48-64)
🪛 Ruff (0.14.0)
tests/integration/defs/perf/test_perf.py
502-502: PEP 484 prohibits implicit Optional
Convert to T | None
(RUF013)
503-503: PEP 484 prohibits implicit Optional
Convert to T | None
(RUF013)
⏰ 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 (9)
tests/integration/defs/perf/data_export.py (1)
73-73: LGTM! Device subtype added to exported keys.The addition of "device_subtype" to TEST_DESCRIPTION_KEYS correctly expands the exported test description data to include device subtype information, consistent with the broader device subtype support introduced across the performance testing infrastructure.
tests/integration/defs/perf/utils.py (1)
578-591: LGTM! Device subtype properly integrated into test descriptions.The implementation correctly retrieves device_subtype from GPUClockLock when available and includes it in the test description dictionary. The conditional check ensures safe handling when gpu_clock_lock is not provided.
tests/integration/defs/perf/gpu_clock_lock.py (2)
127-131: LGTM! Device subtype getter correctly implemented.The getter method follows the established pattern for accessing GPU properties and provides safe None fallback when device_subtype is unavailable.
509-512: LGTM! Device subtype properly computed and stored.The device_subtype is correctly computed using the PCI device ID and cleaned product name, and stored in the GPU properties dictionary alongside other device attributes.
tests/integration/defs/perf/sanity_perf_check.py (1)
142-206: Verify the autodeploy filtering logic.The device subtype filtering implementation looks reasonable, but please confirm the following behavior is intended:
Base filtering (lines 178-185): Keeps entries with matching subtype OR null subtype for backward compatibility. This allows comparing against baselines that don't have device_subtype information.
Current filtering for autodeploy (lines 188-204): Filters autodeploy entries to only keep those WITH device_subtype, while preserving all non-autodeploy entries. This means autodeploy tests without device_subtype will be excluded from comparison.
Is this the desired behavior? If autodeploy tests should always have device_subtype, this logic is correct. However, if there's a transition period where some autodeploy baselines might not have device_subtype, you may want to handle that case differently.
tests/integration/defs/perf/test_perf.py (4)
502-510: LGTM! Device subtype parameter added to test name generation.The device_subtype parameter is correctly added to the
to_stringmethod signature and properly integrated into the test name entries when provided. This enables device-subtype-aware test naming for autodeploy scenarios.
672-675: LGTM! Device subtype correctly extracted from test labels.The extraction logic properly parses the optional device_subtype from test parameter labels, storing it for later use in test configuration.
1916-1932: LGTM! Device subtype correctly retrieved for autodeploy tests.The logic appropriately:
- Checks for the presence of
_gpu_clock_lockattribute and instance- Restricts device_subtype retrieval to autodeploy tests (
backend == "_autodeploy")- Passes device_subtype to
to_stringfor both builder metrics and per-bs/length labelsThis ensures device-subtype-aware metric naming is only applied where needed.
2132-2133: LGTM! GPU clock lock properly passed to runtime configuration.The gpu_clock_lock is correctly threaded through to
set_runtime_configs, enabling downstream access to device subtype information during test execution.
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
|
/bot run --stage-list "H100_PCIe-PyTorch-Perf-1" |
|
PR_Github #21582 [ run ] triggered by Bot |
|
PR_Github #21582 [ run ] completed with state |
|
/bot run --stage-list "H100_PCIe-PyTorch-Perf-1" |
|
PR_Github #21611 [ run ] triggered by Bot |
|
PR_Github #21611 [ run ] completed with state |
|
/bot run --stage-list "H100_PCIe-PyTorch-Perf-1" |
|
PR_Github #21784 [ run ] triggered by Bot. Commit: |
|
PR_Github #21784 [ run ] completed with state |
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
|
/bot run --stage-list "H100_PCIe-PyTorch-Perf-1" |
|
PR_Github #21791 [ run ] triggered by Bot. Commit: |
|
PR_Github #21791 [ run ] completed with state |
|
/bot run --stage-list "H100_PCIe-PyTorch-Perf-1" |
|
PR_Github #21800 [ run ] triggered by Bot. Commit: |
|
PR_Github #21800 [ run ] completed with state |
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
|
/bot run --stage-list "H100_PCIe-PyTorch-Perf-1" |
|
PR_Github #21805 [ run ] triggered by Bot. Commit: |
|
PR_Github #21805 [ run ] completed with state |
|
/bot run |
|
PR_Github #21809 [ run ] triggered by Bot. Commit: |
|
PR_Github #21809 [ run ] completed with state |
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
|
/bot run |
|
PR_Github #22133 [ run ] triggered by Bot. Commit: |
|
PR_Github #22133 [ run ] completed with state |
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com> Signed-off-by: yufeiwu-nv <230315618+yufeiwu-nv@users.noreply.github.com>
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
In L0 the perf regression test runs on a job called H100_PCIe, however it actually uses several kinds of H100 (PCIE, NVL and Plain H100). Each of them yields a different performance, hence this change implements support for setting device subtype thresholds and comparing them according to the actual device subtype being used.
Summary by CodeRabbit
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
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.
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.