-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[TRTLLM-7048][feat] add benchmark TRT flow test for MIG #6884
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
📝 WalkthroughWalkthroughBenchRunner in the integration tests gained optional concurrency and num_requests parameters, uses them during dataset preparation and benchmark invocation, captures and parses benchmark stdout to return metrics, call returns the parsed results, and a new MIG-mode test runs throughput checks across multiple concurrency levels asserting throughput growth and positive latency. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as MIG Concurrency Test
participant BR as BenchRunner
participant DS as prepare_dataset
participant RB as run_bench
participant PB as parse_benchmark_output
Test->>BR: instantiate(concurrency, num_requests, ...)
Test->>BR: __call__()
BR->>DS: prepare_dataset(num_requests)
DS-->>BR: dataset ready
BR->>RB: run_bench(concurrency, num_requests)
RB-->>BR: stdout (benchmark output)
BR->>PB: parse_benchmark_output(output)
PB-->>BR: {concurrency, num_requests, throughput, latency}
BR-->>Test: results
Test->>Test: assert throughput trend, latency > 0
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
/bot run |
|
PR_Github #15231 [ run ] triggered by Bot |
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: 3
🔭 Outside diff range comments (1)
tests/integration/defs/test_e2e.py (1)
411-411: Remove the hard-coded sensitive test data.Line 411 contains a hard-coded message with mathematical expressions and prompts that appear to be test data. This should be externalized to a configuration file or test data repository for better maintainability and security.
Replace the hard-coded message with a reference to external test data:
- message = r"<|begin▁of▁sentence|><|User|>The operation $\otimes$ is defined for all nonzero numbers by $a \otimes b = \frac{a^{2}}{b}$. Determine $[(1 \otimes 2) \otimes 3] - [1 \otimes (2 \otimes 3)]$. Let's think step by step and output the final answer within \boxed{}.<|Assistant|>" + # Load test message from external configuration + message = load_test_message("qwen_math_operation_test")
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/integration/defs/test_e2e.py(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)
**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else
Files:
tests/integration/defs/test_e2e.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}
📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)
Prepend NVIDIA copyright header (current year) to all source files
Files:
tests/integration/defs/test_e2e.py
🧠 Learnings (1)
📚 Learning: 2025-07-28T17:06:08.621Z
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/integration/defs/test_e2e.py
🪛 Ruff (0.12.2)
tests/integration/defs/test_e2e.py
590-590: Do not use bare except
(E722)
596-596: Do not use bare except
(E722)
629-629: First line should end with a period, question mark, or exclamation point
Add closing punctuation
(D415)
🔇 Additional comments (5)
tests/integration/defs/test_e2e.py (5)
452-454: LGTM - Constructor signature properly extended.The new optional parameters
concurrencyandnum_requestsare correctly added with appropriate defaults and type hints.
479-480: LGTM - Instance variables properly initialized.The new instance variables are correctly stored for later use in the benchmark execution.
486-486: LGTM - Return value now properly captured.The method now returns the benchmark results instead of discarding them, enabling result processing and validation.
509-509: LGTM - Dynamic dataset size configuration.Using
self.num_requestsinstead of a hard-coded value makes the dataset generation configurable.
563-571: LGTM - Enhanced benchmark execution with parameter support.The conditional addition of concurrency and num_requests parameters and the switch from
check_calltocheck_outputproperly enables result capture and processing.
| @pytest.mark.parametrize("model_name", ["meta/Meta-Llama-3.1-8B"], | ||
| ids=["llama3_1-8b"]) | ||
| @pytest.mark.parametrize("model_subdir", ["llama-3.1-model/Meta-Llama-3.1-8B"], | ||
| ids=["llama_v3_1"]) | ||
| @pytest.mark.parametrize("use_pytorch_backend", [False], ids=["trt_backend"]) | ||
| def test_trtllm_bench_mig_launch(llm_root, llm_venv, model_name, model_subdir, | ||
| use_pytorch_backend): | ||
| "run bench mark in MIG mode, check if the throughput is increasing by concurrency" | ||
| skip_engine_build = False | ||
| results = {} | ||
| concurrency_list = [1, 32, 64, 128] | ||
|
|
||
| for concurrency in concurrency_list: | ||
| num_requests = concurrency * 10 | ||
| runner = BenchRunner(llm_root=llm_root, | ||
| llm_venv=llm_venv, | ||
| model_name=model_name, | ||
| model_subdir=model_subdir, | ||
| streaming=False, | ||
| use_pytorch_backend=use_pytorch_backend, | ||
| use_mpirun=False, | ||
| tp_size=1, | ||
| concurrency=concurrency, | ||
| num_requests=num_requests, | ||
| skip_engine_build=skip_engine_build) | ||
|
|
||
| output = runner() | ||
| results[concurrency] = output | ||
|
|
||
| print(f"\n=== Benchmark Results Comparison ===") | ||
| print(f"Model: {model_name}") | ||
| print(f"Backend: {'PyTorch' if use_pytorch_backend else 'TensorRT'}") | ||
| print( | ||
| f"{'Concurrency':<15} {'Throughput':<15} {'Latency':<15} {'Num Requests':<15}" | ||
| ) | ||
| print("-" * 60) | ||
|
|
||
| for idx, val in enumerate(concurrency_list): | ||
| if hasattr(results[val], 'get'): | ||
| throughput = float(results[val].get('throughput', 0)) | ||
| latency = float(results[val].get('latency', 0)) | ||
| num_requests = int(results[val].get('num_requests', 0)) | ||
| assert throughput > 0, f"Throughput is 0 for concurrency {concurrency}" | ||
| assert latency > 0, f"Latency is 0 for concurrency {concurrency}" | ||
| print( | ||
| f"{concurrency:<15} {throughput:<15} {latency:<15} {num_requests:<15}" | ||
| ) | ||
| if idx > 0: | ||
| assert throughput > float( | ||
| results[concurrency_list[idx - 1]].get('throughput', 0) | ||
| ) * 1.3, f"Throughput is not increasing for concurrency {concurrency_list[idx]}" | ||
|
|
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.
🛠️ Refactor suggestion
Fix docstring format and improve test logic.
The test function docstring on line 629 should end with proper punctuation. Additionally, consider improving the assertion logic for better test reliability.
Fix the docstring and improve assertions:
- "run bench mark in MIG mode, check if the throughput is increasing by concurrency"
+ """Run benchmark in MIG mode, check if the throughput is increasing by concurrency."""Also consider making the throughput increase assertion more robust:
assert throughput > float(
results[concurrency_list[idx - 1]].get('throughput', 0)
- ) * 1.3, f"Throughput is not increasing for concurrency {concurrency_list[idx]}"
+ ) * 1.2, f"Expected throughput increase from {concurrency_list[idx-1]} to {concurrency_list[idx]}, but got {prev_throughput} -> {throughput}"The 1.3x factor seems quite aggressive and might cause flaky tests. Consider a more conservative factor like 1.2x or make it configurable.
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 Ruff (0.12.2)
629-629: First line should end with a period, question mark, or exclamation point
Add closing punctuation
(D415)
🤖 Prompt for AI Agents
In tests/integration/defs/test_e2e.py around lines 622-673, the function
docstring should end with proper punctuation and the test assertions are
brittle: update the docstring to end with a period; change every use of the
undefined/outer "concurrency" variable inside the final loop to the loop
variable "val" (for both assertion messages and print outputs); ensure numeric
parsing uses safe defaults already present but add a guard so the throughput
comparison only runs if previous_throughput > 0 (fail with a clear message
otherwise); and relax the growth requirement from 1.3x to a more conservative
1.2x (or make this factor a small configurable constant at the top of the test)
with clearer assertion messages when the increase expectation is not met.
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: 1
♻️ Duplicate comments (3)
tests/integration/defs/test_e2e.py (3)
633-633: Fix function docstring formatting and wording.Use a proper docstring with closing punctuation; also “benchmark” is one word.
- "run bench mark in MIG mode, check if the throughput is increasing by concurrency" + """Run benchmark in MIG mode; check that throughput increases with concurrency."""
573-601: Parse numeric throughput/latency values; current string parsing will break downstream.
parse_benchmark_outputcurrently stores raw strings (likely with units), but the MIG test converts them tofloat, which will raiseValueErrorwhen units are present. Parse and store numeric floats.def parse_benchmark_output(self, output): """Parse the benchmark output to extract key metrics.""" result = { 'concurrency': self.concurrency, 'num_requests': self.num_requests, - 'throughput': 0, - 'latency': 0 + 'throughput': 0.0, + 'latency': 0.0 } lines = output.split('\n') for line in lines: line = line.strip() if 'total token throughput' in line.lower( ) and 'tokens/sec' in line.lower(): try: - throughput = line.split(":")[1].strip() - result['throughput'] = throughput - except (IndexError, ValueError) as e: - print(f"Failed to parse throughput from line: {line}. Error: {e}") + throughput_str = line.split(":", 1)[1].strip() + m = re.search(r'([-+]?\d*\.?\d+)', throughput_str) + if m: + result['throughput'] = float(m.group(1)) + except (IndexError, ValueError) as e: + print(f"Failed to parse throughput from line: {line}. Error: {e}") pass elif 'total latency' in line.lower() and 'ms' in line.lower(): try: - latency = line.split(":")[1].strip() - result['latency'] = latency - except (IndexError, ValueError) as e: - print(f"Failed to parse latency from line: {line}. Error: {e}") + latency_str = line.split(":", 1)[1].strip() + m = re.search(r'([-+]?\d*\.?\d+)', latency_str) + if m: + result['latency'] = float(m.group(1)) + except (IndexError, ValueError) as e: + print(f"Failed to parse latency from line: {line}. Error: {e}") pass return result
678-679: Relax growth factor and wrap long assert message (E501).
- The 1.3x requirement is aggressive and may be flaky; use 1.2x (or make it a constant).
- The assert line exceeds 120 chars; wrap with parentheses.
- prev_throughput = float(results[concurrency_list[idx - 1]].get('throughput', 0)) - assert throughput > prev_throughput * 1.3, f"Throughput is not increasing for concurrency {concurrency_list[idx]}" + prev_throughput = float( + results[concurrency_list[idx - 1]].get('throughput', 0) + ) + growth_factor = 1.2 + assert throughput > prev_throughput * growth_factor, ( + f"Expected >= {growth_factor}x throughput increase from " + f"{concurrency_list[idx-1]} to {concurrency_list[idx]}: " + f"{prev_throughput} -> {throughput}" + )
🧹 Nitpick comments (1)
tests/integration/defs/test_e2e.py (1)
563-567: Use explicit None checks for CLI options to avoid dropping 0-values.Truthiness checks will skip valid zero-values (e.g., concurrency=0). Prefer explicit
is not None.- if self.concurrency: - benchmark_cmd += f" --concurrency {self.concurrency}" - if self.num_requests: - benchmark_cmd += f" --num_requests {self.num_requests}" + if self.concurrency is not None: + benchmark_cmd += f" --concurrency {self.concurrency}" + if self.num_requests is not None: + benchmark_cmd += f" --num_requests {self.num_requests}"
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/integration/defs/test_e2e.py(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)
**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else
Files:
tests/integration/defs/test_e2e.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}
📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)
Prepend NVIDIA copyright header (current year) to all source files
Files:
tests/integration/defs/test_e2e.py
🧠 Learnings (1)
📚 Learning: 2025-07-28T17:06:08.621Z
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/integration/defs/test_e2e.py
🪛 Ruff (0.12.2)
tests/integration/defs/test_e2e.py
664-664: SyntaxError: Expected an indented block after for statement
679-679: Line too long (126 > 120)
(E501)
⏰ 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/test_e2e.py (5)
452-455: Constructor extension (concurrency/num_requests) looks good.The added knobs are sensible and well-scoped for benchmarking scenarios.
Also applies to: 479-481
486-486: Good: call now returns the benchmark results.This enables callers/tests to consume metrics directly.
509-509: Good: dataset size parameterized viaself.num_requests.Keeps dataset generation consistent with the run config.
568-571: Capturing benchmark stdout and returning parsed metrics: LGTM.Assuming parsing is robust (see next comment), this is the right direction.
624-631: MIG-mode test scaffolding is reasonable.Skip markers and parametrization look aligned with resource requirements.
|
/bot run |
|
PR_Github #15242 [ run ] triggered by Bot |
|
PR_Github #15231 [ run ] completed with state |
|
/bot run |
|
PR_Github #15269 [ run ] triggered by Bot |
|
PR_Github #15269 [ run ] completed with state |
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com>
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
♻️ Duplicate comments (3)
tests/integration/defs/test_e2e.py (3)
635-635: Fix docstring punctuation and wording.End the docstring with a period and use “benchmark” as one word. D415 flagged the missing punctuation.
Apply this diff:
- "run bench mark in MIG mode, check if the throughput is increasing by concurrency" + """Run benchmark in MIG mode, check if the throughput increases with concurrency."""
681-685: Relax growth factor and wrap long assertion message (E501).1.3x may be too aggressive and can flake depending on scheduling/noise; 1.2x is more conservative. Also wrap the assertion string to satisfy the 120-column limit.
Apply this diff:
- if idx > 0: - prev_throughput = float(results[concurrency_list[idx - 1]].get( - 'throughput', 0)) - assert throughput > prev_throughput * 1.3, f"Throughput is not increasing for concurrency {concurrency_list[idx]}" + if idx > 0: + prev_throughput = float( + results[concurrency_list[idx - 1]].get('throughput', 0) + ) + assert throughput > prev_throughput * 1.2, ( + f"Expected throughput increase from {concurrency_list[idx - 1]} " + f"to {concurrency_list[idx]}: {prev_throughput} -> {throughput}" + )
575-603: Parse numeric throughput/latency; return floats instead of raw strings.The parser currently stores raw substrings (e.g., “123 tokens/sec”), which will cause
float(...)conversion errors downstream. Extract the numeric portion and return floats. Also split only once on “:” to avoid surprises.Apply this diff:
- def parse_benchmark_output(self, output): - """Parse the benchmark output to extract key metrics.""" - result = { - 'concurrency': self.concurrency, - 'num_requests': self.num_requests, - 'throughput': 0, - 'latency': 0 - } - - lines = output.split('\n') - for line in lines: - line = line.strip() - if 'total token throughput' in line.lower( - ) and 'tokens/sec' in line.lower(): - try: - throughput = line.split(":")[1].strip() - result['throughput'] = throughput - except (IndexError, ValueError) as e: - print( - f"Failed to parse throughput from line: {line}. Error: {e}" - ) - elif 'total latency' in line.lower() and 'ms' in line.lower(): - try: - latency = line.split(":")[1].strip() - result['latency'] = latency - except (IndexError, ValueError) as e: - print( - f"Failed to parse latency from line: {line}. Error: {e}" - ) - - return result + def parse_benchmark_output(self, output: str): + """Parse benchmark stdout to extract numeric metrics. + + Returns: + dict: { + 'concurrency': Optional[int], + 'num_requests': int, + 'throughput': float, # tokens/sec + 'latency': float, # ms + } + """ + result = { + 'concurrency': self.concurrency, + 'num_requests': self.num_requests, + 'throughput': 0.0, + 'latency': 0.0, + } + + lines = output.split('\n') + for line in lines: + s = line.strip() + low = s.lower() + if 'total token throughput' in low and 'tokens/sec' in low: + try: + payload = s.split(":", 1)[1].strip() + m = re.search(r'([-+]?\d*\.?\d+)', payload) + if m: + result['throughput'] = float(m.group(1)) + except (IndexError, ValueError) as e: + print(f"Failed to parse throughput from line: {s}. Error: {e}") + elif 'total latency' in low and 'ms' in low: + try: + payload = s.split(":", 1)[1].strip() + m = re.search(r'([-+]?\d*\.?\d+)', payload) + if m: + result['latency'] = float(m.group(1)) + except (IndexError, ValueError) as e: + print(f"Failed to parse latency from line: {s}. Error: {e}") + + return resultNote: This also preserves your targeted exception handling introduced here. Nice improvement over the previous bare
except.
🧹 Nitpick comments (2)
tests/integration/defs/test_e2e.py (2)
452-455: New BenchRunner parameters look good; please document them.Adding
concurrencyandnum_requestsis a clean extension and aligns with the new MIG-flow test usage. Consider adding a short Google-style docstring for__init__to document these params and their semantics (e.g., whether0is meaningful) for future readers.
563-567: Use explicit None-checks to avoid silently skipping zero values.Truthiness checks will skip
0, which could be a valid explicit input in some scenarios. Prefer explicit None-checks.Apply this diff:
- if self.concurrency: - benchmark_cmd += f" --concurrency {self.concurrency}" - if self.num_requests: - benchmark_cmd += f" --num_requests {self.num_requests}" + if self.concurrency is not None: + benchmark_cmd += f" --concurrency {self.concurrency}" + if self.num_requests is not None: + benchmark_cmd += f" --num_requests {self.num_requests}"
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
tests/integration/defs/test_e2e.py(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)
**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else
Files:
tests/integration/defs/test_e2e.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}
📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)
Prepend NVIDIA copyright header (current year) to all source files
Files:
tests/integration/defs/test_e2e.py
🧠 Learnings (1)
📚 Learning: 2025-07-28T17:06:08.621Z
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/integration/defs/test_e2e.py
🪛 Ruff (0.12.2)
tests/integration/defs/test_e2e.py
635-635: First line should end with a period, question mark, or exclamation point
Add closing punctuation
(D415)
684-684: Line too long (126 > 120)
(E501)
⏰ 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/test_e2e.py (5)
479-481: State captured correctly for concurrency and num_requests.Persisting these values on the instance enables the new parsing/printing logic. No issues here.
486-486: Good change: return parsed benchmark results from call.Returning the parsed metrics makes the runner composable and simplifies the test logic that aggregates results.
494-510: Using num_requests from the constructor is correct.Passing
--num-requestsfromself.num_requestsensures dataset size matches concurrency-driven test scenarios. Looks good.
568-572: Good: capture stdout and return parsed metrics.Switching to
check_outputand returning the parsed metrics enables robust assertions without scraping temp files.
590-599: Nice: replaced bare except with targeted exception handling.Catching
IndexError/ValueErroris the right choice here and prevents masking unrelated failures.
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com> Signed-off-by: xinhe-nv <200704525+xinhe-nv@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Summary by CodeRabbit
New Features
Performance/Benchmarking
Tests
Security/Privacy
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 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.