KEMBAR78
[None][test] Test trtllm-bench AD vs, PT BEs on H100 single gpu by MrGeva · Pull Request #6487 · NVIDIA/TensorRT-LLM · GitHub
Skip to content

Conversation

@MrGeva
Copy link
Collaborator

@MrGeva MrGeva commented Jul 30, 2025

Summary by CodeRabbit

  • New Features

    • Enhanced benchmark testing with detailed memory metric extraction and validation.
    • Added robust performance comparison between different backends with configurable tolerance levels.
    • Introduced a new test for backend performance comparison on specific GPU systems.
  • Refactor

    • Unified and extended benchmark test logic for improved flexibility and reliability.
  • Tests

    • Updated and expanded test coverage for benchmarking scenarios, including new performance and memory validation checks.
    • Modified test selection filters to exclude or include specific benchmark comparison tests on targeted GPU configurations.

Description

Test Coverage

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

@MrGeva MrGeva requested a review from a team as a code owner July 30, 2025 15:19
@MrGeva MrGeva requested a review from juney-nvidia July 30, 2025 15:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

📝 Walkthrough

Walkthrough

The changes update test configurations for A30, B200, and H100 GPU systems by excluding the test_trtllm_bench_backend_comparison test from A30 and B200 runs and adding it to H100 runs. The benchmark test was extensively refactored and expanded, introducing new functions for running benchmarks, extracting and validating memory metrics, and comparing backend performance with tolerances.

Changes

Cohort / File(s) Change Summary
A30 GPU test exclusion
tests/integration/test_lists/test-db/l0_a30.yml
Modified the PyTorch pre_merge test selection to exclude test_trtllm_bench_backend_comparison using a -k "not test_trtllm_bench_backend_comparison" filter. No other changes to test lists or logic.
H100 GPU test inclusion
tests/integration/test_lists/test-db/l0_h100.yml
Added unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py::test_trtllm_bench_backend_comparison to the PyTorch pre_merge test list for single-GPU H100 Ubuntu systems. No other test changes.
B200 GPU test exclusion
tests/integration/test_lists/test-db/l0_b200.yml
Modified the PyTorch pre_merge test selection to exclude test_trtllm_bench_backend_comparison using a -k "not test_trtllm_bench_backend_comparison" filter. No other changes to test lists or logic.
Benchmark test refactor and expansion
tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
Major refactor: replaced simple benchmark invocation with a comprehensive benchmarking function that runs subprocesses, captures stdout/stderr logs, parses and validates KV cache memory metrics, and compares backend performance with configurable tolerances. Added several helper and validation functions for extracting performance metrics, calculating expected KV cache metrics based on GPU memory, and printing results. Introduced a unified comparison test supporting backend and golden reference modes. Updated the original test to write extra_llm_api_options.yaml instead of model_kwargs.yaml. Added a new backend comparison test with a pytest marker to disable parallel execution.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner as Pytest
    participant Benchmark as run_benchmark()
    participant Subprocess as trtllm_bench subprocess
    participant Parser as parse_kv_cache_metrics()
    participant Validator as validate_kv_cache_metrics_dynamic()
    participant Comparator as compare_backends_performance()

    TestRunner->>Benchmark: Invoke run_benchmark() for backend A
    Benchmark->>Subprocess: Run trtllm_bench with backend A
    Subprocess-->>Benchmark: Return stdout/stderr logs
    Benchmark->>Parser: Parse KV cache metrics from logs
    Parser-->>Benchmark: Return metrics
    Benchmark->>Validator: Validate metrics against expectations
    Validator-->>Benchmark: Validation result

    TestRunner->>Benchmark: Invoke run_benchmark() for backend B
    Benchmark->>Subprocess: Run trtllm_bench with backend B
    Subprocess-->>Benchmark: Return stdout/stderr logs
    Benchmark->>Parser: Parse KV cache metrics from logs
    Parser-->>Benchmark: Return metrics
    Benchmark->>Validator: Validate metrics against expectations
    Validator-->>Benchmark: Validation result

    TestRunner->>Comparator: Compare backend A vs backend B performance
    Comparator-->>TestRunner: Assert within tolerance or fail
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • venkywonka
  • litaotju
  • yilin-void

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 519900f and 39f9cac.

📒 Files selected for processing (4)
  • tests/integration/test_lists/test-db/l0_a30.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_b200.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_h100.yml (1 hunks)
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (5 hunks)
✅ Files skipped from review due to trivial changes (1)
  • tests/integration/test_lists/test-db/l0_b200.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/integration/test_lists/test-db/l0_a30.yml
  • tests/integration/test_lists/test-db/l0_h100.yml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code 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 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. Prefix k for variable names that start with a number (e.g., k_99th_percentile).
Python global variables should use upper snake_case and prefix G (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 interfaces that may be used outside a Python file, prefer docstrings over comments.
Comments in Python should be reserved 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.
Attributes and variables in Python can be documented inline; attribute docstrings will be rendered under the class docstring.
Avoid using reflection in Python when functionality can be easily achieved without it.
When using try-except blocks in Python, limit the except to the smallest set of errors possible.
When using try-except blocks to handle multiple possible variable types in Python, keep the body of the try as small as possible, using the else block to implement the logic.

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
**/*.{cpp,h,hpp,cc,cxx,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
🧠 Learnings (6)
📓 Common learnings
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.
Learnt from: galagam
PR: NVIDIA/TensorRT-LLM#6487
File: tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py:1-12
Timestamp: 2025-08-06T13:58:07.506Z
Learning: In TensorRT-LLM, test files (files under tests/ directories) do not require NVIDIA copyright headers, unlike production source code files. Test files typically start directly with imports, docstrings, or code.
📚 Learning: in tensorrt-llm testing, it's common to have both cli flow tests (test_cli_flow.py) and pytorch api ...
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
📚 Learning: in tensorrt-llm, test files (files under tests/ directories) do not require nvidia copyright headers...
Learnt from: galagam
PR: NVIDIA/TensorRT-LLM#6487
File: tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py:1-12
Timestamp: 2025-08-06T13:58:07.506Z
Learning: In TensorRT-LLM, test files (files under tests/ directories) do not require NVIDIA copyright headers, unlike production source code files. Test files typically start directly with imports, docstrings, or code.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
📚 Learning: applies to **/*.{cpp,h,hpp,cc,cxx,cu,py} : all tensorrt-llm open source software code should contain...
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-08-06T21:22:55.018Z
Learning: Applies to **/*.{cpp,h,hpp,cc,cxx,cu,py} : All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
📚 Learning: applies to **/*.{h,hpp} : use a preprocessor guard in header files. the guard name must have prefix ...
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-08-06T21:22:55.018Z
Learning: Applies to **/*.{h,hpp} : Use a preprocessor guard in header files. The guard name must have prefix TRTLLM_ followed by the filename, all in caps, and no trailing underscore.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
📚 Learning: in tensorrt-llm, examples directory can have different dependency versions than the root requirement...
Learnt from: yibinl-nvidia
PR: NVIDIA/TensorRT-LLM#6506
File: examples/models/core/mixtral/requirements.txt:3-3
Timestamp: 2025-08-01T15:14:45.673Z
Learning: In TensorRT-LLM, examples directory can have different dependency versions than the root requirements.txt file. Version conflicts between root and examples dependencies are acceptable because examples are designed to be standalone and self-contained.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
⏰ 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 (7)
tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (7)

1-2: LGTM on import additions.

The added imports (json, re, pytest) are appropriate for the enhanced benchmark functionality and testing requirements.

Also applies to: 7-7


51-137: Well-structured benchmark execution function.

The function effectively handles the complex workflow of running benchmarks across different backends, with appropriate subprocess timeout protection and backend-specific configuration. The logic for parsing KV cache metrics only for the autodeploy backend is correct.


139-186: Solid performance comparison implementation.

The function implements robust performance comparison logic with appropriate tolerance handling. The approach of always passing when autodeploy performs better than or equal to pytorch, and using OR logic for tolerance checks, is correct.


188-228: Excellent golden value comparison logic.

The function correctly implements the "improvements always pass" philosophy for performance regression testing, with clear tolerance handling and informative error messages.


317-370: Comprehensive KV cache metrics validation.

The function implements thorough validation with appropriate tolerance levels, logical consistency checks (e.g., memory consumption during forward pass), and clear error messages. The tolerance values are well-chosen for different types of metrics.


451-586: Well-designed unified test orchestrator.

The function effectively unifies backend comparison and golden value testing in a single, configurable interface. The parameter documentation is comprehensive, the control flow is clear, and the separation between comparison modes is well-implemented.


594-594: Appropriate test function updates.

The change from model_kwargs.yaml to extra_llm_api_options.yaml aligns with the new configuration structure. The addition of @pytest.mark.no_xdist for the backend comparison test is appropriate to prevent parallel execution conflicts.

Also applies to: 607-610

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@MrGeva
Copy link
Collaborator Author

MrGeva commented Jul 30, 2025

/bot run

@coderabbitai coderabbitai bot requested a review from StanleySun639 July 30, 2025 15:23
@tensorrt-cicd
Copy link
Collaborator

PR_Github #13555 [ run ] triggered by Bot

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: 4

🧹 Nitpick comments (3)
tests/integration/test_lists/test-db/l0_a30.yml (1)

21-21: Document the reason for test exclusion on A30 GPUs.

The exclusion of test_trtllm_bench_backend_comparison from A30 runs should be documented to explain why this test is not suitable for A30 hardware. Consider adding a comment explaining whether this is due to:

  • H100-specific performance baselines
  • Hardware capability requirements
  • Resource constraints
   # ------------- PyTorch tests ---------------
   - unittest/_torch/modeling -k "modeling_nemotron_nas"
   - unittest/_torch/modeling -k "modeling_phi3"
   - unittest/_torch/modeling -k "modeling_qwen"
   - unittest/_torch/modeling -k "modeling_qwen_moe"
+  # test_trtllm_bench_backend_comparison excluded: H100-specific performance baselines
   - unittest/_torch/auto_deploy/unit/singlegpu -k "not test_trtllm_bench_backend_comparison"
   - unittest/_torch/test_beam_search.py
tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (2)

94-96: Document the use of environment variable for PyTorch backend.

The TLLM_OVERRIDE_LAYER_NUM environment variable is used specifically for the PyTorch backend, but its purpose and effect are not documented.

     if backend == "pytorch":
+        # Override the number of hidden layers for PyTorch backend testing
+        # This allows testing with a reduced model size for faster execution
         env["TLLM_OVERRIDE_LAYER_NUM"] = str(num_hidden_layers)
         print(f"📋 Using TLLM_OVERRIDE_LAYER_NUM from env: {env['TLLM_OVERRIDE_LAYER_NUM']}")
         cmd.extend(["--kv_cache_free_gpu_mem_fraction", str(free_mem_ratio)])

448-582: Consider breaking down this complex function.

This function is quite long (130+ lines) and handles multiple responsibilities. Consider extracting helper functions for better maintainability.

Consider extracting these logical blocks into separate functions:

  • Config file creation (lines 482-492)
  • Backend comparison logic (lines 518-551)
  • Golden comparison logic (lines 552-578)

This would improve readability and make the code easier to test and maintain.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03e38c9 and c4a11d5.

📒 Files selected for processing (3)
  • tests/integration/test_lists/test-db/l0_a30.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_h100.yml (1 hunks)
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (4 hunks)
🧰 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 in Python, 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. Prefix k for variable names that start with a number (e.g., k_99th_percentile).
Python global variables should use upper snake_case and prefix G (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 interfaces that may be used outside a file, prefer docstrings over comments in Python.
Comments in Python should be reserved 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.
Attributes and variables in Python can be documented inline; attribute docstrings will be rendered under the docstring for the class.
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 to handle multiple possible variable types in Python, keep the body of the try as small as possible, using the else block to implement the logic.

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
**/*.{cpp,h,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
🧠 Learnings (3)
tests/integration/test_lists/test-db/l0_h100.yml (1)

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

tests/integration/test_lists/test-db/l0_a30.yml (1)

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (1)

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

⏰ 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/test_lists/test-db/l0_h100.yml (1)

18-18: LGTM!

The addition of test_trtllm_bench_backend_comparison to the H100 test suite is appropriate and aligns with the PR objectives for H100-specific testing.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13555 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #10160 completed with status: 'FAILURE'

@MrGeva
Copy link
Collaborator Author

MrGeva commented Jul 30, 2025

/bot run --reuse-test --test-backend "pytorch" --disable-multi-gpu-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13572 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13572 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #10173 (Partly Tested) completed with status: 'FAILURE'

@MrGeva
Copy link
Collaborator Author

MrGeva commented Jul 31, 2025

/bot run

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: 0

♻️ Duplicate comments (4)
tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (4)

14-49: Replace print statements with proper logging.

The function uses print statements for debugging output. Consider using Python's logging module for better control over log levels and output formatting.


91-92: Move import statement to module level.

Import statements should be at the module level unless there's a specific reason for lazy loading.


99-105: Add timeout protection for subprocess execution.

The subprocess run could hang indefinitely. Consider adding a timeout to prevent test suite hangs.


278-284: Parameterize or document hardcoded memory values.

The function contains hardcoded values for model size and extra consumption that should be parameterized or at least better documented with their derivation.

🧹 Nitpick comments (1)
tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (1)

449-583: Consider breaking down this large function for better maintainability.

This function handles multiple responsibilities including configuration setup, benchmark execution, and result comparison. Consider extracting the mode-specific logic into separate helper functions to improve readability and testability.

For example:

def _run_backend_comparison(autodeploy_report, model_name, dataset_path, temp_dir, ...):
    """Handle backend comparison mode logic."""
    # Backend-specific logic here

def _run_golden_comparison(autodeploy_report, kv_cache_metrics, expected_metrics, ...):
    """Handle golden comparison mode logic."""
    # Golden-specific logic here
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4a11d5 and d3b90a3.

📒 Files selected for processing (2)
  • tests/integration/test_lists/test-db/l0_b200.yml (1 hunks)
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (4 hunks)
🧰 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 in Python, 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, and prefix k for variable names that start with a number (e.g., k_99th_percentile).
Python global variables should use upper snake_case and prefix G (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 interfaces that may be used outside a file, prefer docstrings over comments in Python.
Comments in Python should be reserved for code within a function, or interfaces that are local to a file.
Use Google style docstrings for classes and functions in Python, which can be parsed by Sphinx.
Attributes and variables in Python can be documented inline; attribute docstrings will be rendered under the docstring for the class.
Avoid using reflection in Python when functionality can be easily achieved without it.
When using try-except blocks in Python, limit the except to the smallest set of errors possible.
When using try-except blocks to handle multiple possible variable types in Python, keep the body of the try as small as possible, using the else block to implement the logic.

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
**/*.{cpp,h,hpp,cc,cxx,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py
🧠 Learnings (2)
tests/integration/test_lists/test-db/l0_b200.yml (1)

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py (1)

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

🔇 Additional comments (1)
tests/integration/test_lists/test-db/l0_b200.yml (1)

59-59: LGTM!

The exclusion of test_trtllm_bench_backend_comparison from the B200 test suite is consistent with the selective test execution strategy across different GPU configurations.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13639 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13639 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #10233 completed with status: 'FAILURE'

@MrGeva
Copy link
Collaborator Author

MrGeva commented Jul 31, 2025

/bot run --stage-list "H100_PCIe-PyTorch-2" --reuse-test --disable-multi-gpu-test

@MrGeva MrGeva changed the title Draft: h100 test for trtllm-bench AD compare to PT BEs Test trtllm-bench AD vs, PT BEs on H100 single gpu Jul 31, 2025
@tensorrt-cicd
Copy link
Collaborator

PR_Github #13665 [ run ] triggered by Bot

@galagam galagam self-assigned this Jul 31, 2025
@MrGeva MrGeva mentioned this pull request Jul 31, 2025
@MrGeva
Copy link
Collaborator Author

MrGeva commented Jul 31, 2025

/bot run

MrGeva and others added 6 commits August 9, 2025 22:54
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

added memory checks

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

changed kv cache test to be hw agnostic

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

added test with backend comparison

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

both tests pass

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

cleanups and refactoring

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

fixed llm_root issue

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

shrunk the model, and fixes

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

fixed trtllm-bench test stability

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

preserved the old test

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>

set mem ratio to 0.3, fixed bug in default params

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>
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
Signed-off-by: Gal Hubara Agam <96368689+galagam@users.noreply.github.com>
@galagam galagam force-pushed the user/egeva/h100_test branch from d552bfe to 806394c Compare August 10, 2025 06:06
@galagam
Copy link
Collaborator

galagam commented Aug 10, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #14712 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #14712 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #11104 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@galagam galagam merged commit b3e8fa2 into NVIDIA:main Aug 11, 2025
4 checks passed
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.

5 participants