-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[https://nvbugs/5427043][fix] cherrypick: request length exceeds max_num_tokens #7718
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
📝 WalkthroughWalkthroughAdded an early passthrough in handle_for_ipc_batched to forward pre-existing Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Worker
participant BGCheck as BackgroundErrorCheck
Client->>Worker: send batched request
Worker->>Worker: produce/receive response
alt response is ErrorResponse (passthrough)
Worker-->>Client: forward ErrorResponse (unchanged)
else not ErrorResponse
Worker->>BGCheck: _has_background_error(response)?
alt background error present
Worker-->>Client: _create_error_response(...) -> _send_rsp
else no background error
alt response.has_error()
Worker-->>Client: wrap as ErrorResponse -> _send_rsp
else success
Worker->>Worker: compute logprobs / wrap if needed
Worker-->>Client: _send_rsp success
end
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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 |
|
/bot run |
|
PR_Github #18597 [ 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tensorrt_llm/executor/worker.py (1)
1-1: Add mandatory NVIDIA Apache-2.0 header (2025).All Python sources must start with the NVIDIA Apache-2.0 copyright header for 2025.
Apply this diff at the top of the file:
+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License.tests/unittest/llmapi/apps/_test_openai_completions.py (1)
1-1: Add mandatory NVIDIA Apache-2.0 header (2025).All Python sources must start with the NVIDIA Apache-2.0 copyright header for 2025.
Apply this diff at the top of the file:
+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License.
🧹 Nitpick comments (1)
tests/unittest/llmapi/test_llm_pytorch.py (1)
829-838: Make the test deterministic and release resources.
- Seed RNG or avoid randomness to prevent flaky tests.
- Use the LLM context manager (or explicit shutdown) to avoid leaking GPU resources.
- Decorate with force_ampere to match other GPU-bound tests.
Apply this diff:
-class TestLlmError: +class TestLlmError: - def test_max_num_token_check(self): + @force_ampere + def test_max_num_token_check(self): """ LLM should raise error when got prompt length exceed the valid range. """ llm = LLM(llama_model_path, kv_cache_config=global_kvcache_config, max_num_tokens=100) - with pytest.raises(ValueError, - match="should not exceed max_num_tokens"): - ids = [random.randint(10, 100) for _ in range(101)] - llm.generate([ids]) + with llm: + with pytest.raises(ValueError, match="should not exceed max_num_tokens"): + random.seed(0) + ids = [random.randint(10, 100) for _ in range(101)] + llm.generate([ids])
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tensorrt_llm/executor/worker.py(1 hunks)tests/unittest/llmapi/apps/_test_openai_completions.py(1 hunks)tests/unittest/llmapi/test_llm_pytorch.py(2 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:
tensorrt_llm/executor/worker.pytests/unittest/llmapi/test_llm_pytorch.pytests/unittest/llmapi/apps/_test_openai_completions.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:
tensorrt_llm/executor/worker.pytests/unittest/llmapi/test_llm_pytorch.pytests/unittest/llmapi/apps/_test_openai_completions.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:
tensorrt_llm/executor/worker.pytests/unittest/llmapi/test_llm_pytorch.pytests/unittest/llmapi/apps/_test_openai_completions.py
🧬 Code graph analysis (3)
tensorrt_llm/executor/worker.py (2)
tensorrt_llm/serve/openai_protocol.py (1)
ErrorResponse(100-105)tensorrt_llm/executor/utils.py (1)
ErrorResponse(107-110)
tests/unittest/llmapi/test_llm_pytorch.py (1)
tensorrt_llm/llmapi/llm.py (1)
generate(235-313)
tests/unittest/llmapi/apps/_test_openai_completions.py (1)
tests/unittest/llmapi/apps/_test_openai_chat.py (2)
client(82-83)model_name(21-22)
🪛 Ruff (0.12.2)
tests/unittest/llmapi/test_llm_pytorch.py
837-837: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ 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
|
PR_Github #18597 [ run ] completed with state |
05b308d to
73c482e
Compare
|
/bot run |
|
PR_Github #18687 [ 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: 0
♻️ Duplicate comments (1)
tests/unittest/llmapi/test_llm_pytorch.py (1)
1-1: No NVIDIA header needed in tests (ack past bot comment).Per repo convention, files under tests/ don’t require the NVIDIA Apache-2.0 header. The prior bot warning can be ignored.
🧹 Nitpick comments (2)
tests/unittest/llmapi/test_llm_pytorch.py (2)
1-1: Drop unnecessary RNG import (make test deterministic).Avoids flakiness and silences Ruff S311 by not using
randomat all.Apply:
-import random
827-838: Make the test deterministic, ensure LLM cleanup, and relax the exception match
- Use a deterministic token sequence (e.g. ids = [42] * 101) instead of random.
- Construct/enter the LLM with a context manager to guarantee cleanup (with LLM(model=..., kv_cache_config=..., max_num_tokens=100) as llm: ...).
- Rename test to test_max_num_tokens_check and fix docstring to: "LLM should raise an error when prompt length exceeds max_num_tokens."
- Relax the pytest.raises match to something robust (e.g. match=r"max_num_tokens") — the exact phrase "should not exceed max_num_tokens" only appears in this test, not in the raise sites.
Location: tests/unittest/llmapi/test_llm_pytorch.py (around lines 827–838).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tensorrt_llm/executor/worker.py(1 hunks)tests/unittest/llmapi/apps/_test_openai_completions.py(1 hunks)tests/unittest/llmapi/test_llm_pytorch.py(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- tensorrt_llm/executor/worker.py
- tests/unittest/llmapi/apps/_test_openai_completions.py
🧰 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/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/test_llm_pytorch.py
🧠 Learnings (2)
📚 Learning: 2025-09-04T17:00:29.500Z
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-09-04T17:00:29.500Z
Learning: Applies to **/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py} : Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Applied to files:
tests/unittest/llmapi/test_llm_pytorch.py
📚 Learning: 2025-08-06T13:58:07.506Z
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/llmapi/test_llm_pytorch.py
🧬 Code graph analysis (1)
tests/unittest/llmapi/test_llm_pytorch.py (1)
tensorrt_llm/llmapi/llm.py (2)
LLM(1111-1127)generate(235-313)
🪛 Ruff (0.12.2)
tests/unittest/llmapi/test_llm_pytorch.py
837-837: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ 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/unittest/llmapi/test_llm_pytorch.py (1)
825-826: Whitespace-only change.No action needed.
|
PR_Github #18687 [ run ] completed with state |
73c482e to
0e21a58
Compare
|
/bot run |
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 (1)
tests/unittest/llmapi/apps/_test_openai_completions.py (1)
83-93: Turn this into a real assertion; printing isn’t a test.Assert the client raises on too-long prompts and remove the print.
Apply this diff:
-def test_single_completion_with_too_long_prompt(client: openai.OpenAI, - model_name): - completion = client.completions.create( - model=model_name, - prompt="Hello, my name is" * 100, - max_tokens=5, - temperature=0.0, - ) - - print(completion) +def test_single_completion_with_too_long_prompt(client: openai.OpenAI, + model_name): + with pytest.raises(openai.BadRequestError, + match=r"(should not exceed max_num_tokens|exceed|too\s+long)"): + client.completions.create( + model=model_name, + prompt="Hello, my name is" * 100, + max_tokens=5, + temperature=0.0, + )
🧹 Nitpick comments (2)
tests/unittest/llmapi/test_llm_pytorch.py (2)
1-1: Drop randomness in tests; make deterministic (also silences Ruff S311).Random token IDs can cause flakiness and trigger S311. Use a fixed sequence; token ID 0 is valid and already used elsewhere in this file.
Apply this diff:
-import random
829-838: Make the check deterministic and tighten the docstring.Deterministic IDs make the failure mode consistent across runs; improve docstring grammar.
Apply this diff:
- def test_max_num_token_check(self): - """ LLM should raise error when got prompt length exceed the valid range. """ + def test_max_num_token_check(self): + """LLM should raise when prompt length exceeds max_num_tokens.""" llm = LLM(llama_model_path, kv_cache_config=global_kvcache_config, max_num_tokens=100) with pytest.raises(ValueError, match="should not exceed max_num_tokens"): - ids = [random.randint(10, 100) for _ in range(101)] + ids = [0] * 101 llm.generate([ids])
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tensorrt_llm/executor/worker.py(1 hunks)tests/unittest/llmapi/apps/_test_openai_completions.py(1 hunks)tests/unittest/llmapi/test_llm_pytorch.py(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- tensorrt_llm/executor/worker.py
🧰 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/unittest/llmapi/apps/_test_openai_completions.pytests/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/apps/_test_openai_completions.pytests/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/apps/_test_openai_completions.pytests/unittest/llmapi/test_llm_pytorch.py
🧠 Learnings (2)
📚 Learning: 2025-09-04T17:00:29.500Z
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-09-04T17:00:29.500Z
Learning: Applies to **/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py} : Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Applied to files:
tests/unittest/llmapi/test_llm_pytorch.py
📚 Learning: 2025-08-06T13:58:07.506Z
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/llmapi/test_llm_pytorch.py
🧬 Code graph analysis (2)
tests/unittest/llmapi/apps/_test_openai_completions.py (1)
tests/unittest/llmapi/apps/_test_openai_chat.py (2)
client(82-83)model_name(21-22)
tests/unittest/llmapi/test_llm_pytorch.py (2)
tests/unittest/_torch/test_beam_search.py (1)
llm(37-50)tensorrt_llm/llmapi/llm.py (2)
LLM(1111-1127)generate(235-313)
🪛 Ruff (0.12.2)
tests/unittest/llmapi/test_llm_pytorch.py
837-837: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ 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
0e21a58 to
aecf43c
Compare
|
/bot run |
|
PR_Github #18790 [ 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: 0
🧹 Nitpick comments (2)
tests/unittest/llmapi/test_llm_pytorch.py (2)
1-1: Remove unused nondeterministic import.Drop
randomand make the test deterministic (also silences Ruff S311).Apply this diff:
-import random
829-838: Make the test deterministic, robust, and ensure cleanup.Avoid randomness, wrap LLM in a context manager, and relax the regex to be less brittle.
Apply this diff:
- with pytest.raises(ValueError, - match="should not exceed max_num_tokens"): - ids = [random.randint(10, 100) for _ in range(101)] - llm.generate([ids]) + with llm: + with pytest.raises(ValueError, match=r"exceed.*max_num_tokens"): + ids = list(range(101)) + llm.generate([ids])Optional: add a boundary test to prevent off‑by‑one regressions:
def test_max_num_token_at_limit(self): llm = LLM(llama_model_path, kv_cache_config=global_kvcache_config, max_num_tokens=100) with llm: ids = list(range(100)) # exactly at limit llm.generate([ids]) # should not raise
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tensorrt_llm/executor/worker.py(1 hunks)tests/unittest/llmapi/apps/_test_openai_completions.py(1 hunks)tests/unittest/llmapi/test_llm_pytorch.py(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- tensorrt_llm/executor/worker.py
- tests/unittest/llmapi/apps/_test_openai_completions.py
🧰 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/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/test_llm_pytorch.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: tongyuantongyu
PR: NVIDIA/TensorRT-LLM#7726
File: tensorrt_llm/executor/worker.py:983-986
Timestamp: 2025-09-15T10:44:42.133Z
Learning: ErrorResponse objects are only created for the IPC path (handle_for_ipc_batched()) to work around serialization issues when tllm.Response contains Exception objects. They never appear in the single-process path (handle_for_worker()).
📚 Learning: 2025-09-04T17:00:29.500Z
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-09-04T17:00:29.500Z
Learning: Applies to **/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py} : Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Applied to files:
tests/unittest/llmapi/test_llm_pytorch.py
📚 Learning: 2025-08-06T13:58:07.506Z
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/llmapi/test_llm_pytorch.py
🧬 Code graph analysis (1)
tests/unittest/llmapi/test_llm_pytorch.py (1)
tensorrt_llm/llmapi/llm.py (2)
LLM(1111-1127)generate(235-313)
🪛 Ruff (0.12.2)
tests/unittest/llmapi/test_llm_pytorch.py
837-837: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ 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/unittest/llmapi/test_llm_pytorch.py (1)
1-1: Ignore header bot for tests.Per repo convention, test files under tests/ don’t require the NVIDIA Apache-2.0 header. No action needed here.
|
PR_Github #18790 [ run ] completed with state |
aecf43c to
e6710b8
Compare
|
/bot run |
|
PR_Github #19171 [ 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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tensorrt_llm/executor/worker.py (2)
809-813: Construct ErrorResponse with a string message.Passing the Exception object as
error_msgviolates theErrorResponseschema and can break IPC serialization.Apply this diff:
- worker._await_response_helper.temp_error_responses.put( - ErrorResponse(req.id, e, req.id)) + worker._await_response_helper.temp_error_responses.put( + ErrorResponse(req.id, str(e), req.id))
935-944: Convert all non-string ErrorResponse message arguments to strings
- tensorrt_llm/executor/worker.py:257 — already uses str(bck_error) (OK).
- tensorrt_llm/executor/worker.py:812 — currently passes exception variable
e; change tostr(e)when constructing ErrorResponse.- tensorrt_llm/executor/worker.py:942 — passes
response.error_msg; ensure it is a string (wrap withstr(response.error_msg)or provide a string fallback).- tensorrt_llm/serve/openai_server.py:132 —
messageis non-string; passmessage=str(message)(or otherwise ensure it is a string).Re-run the AST/script after changes to confirm no remaining non-string usages.
♻️ Duplicate comments (1)
tensorrt_llm/executor/worker.py (1)
935-937: Do not forward ErrorResponse with non‑string error_msg; coerce to str before IPC.Without coercion, upstream sites that pass Exception objects (see worker_main) will leak non‑serializable payloads and can break pickling/JSON expectations.
Apply this diff:
- if isinstance(response, ErrorResponse): - pass # send ErrorResponse directly + if isinstance(response, ErrorResponse): + # Normalize error_msg for transport/schema + if not isinstance(response.error_msg, str): + response = ErrorResponse( + response.client_id, str(response.error_msg), response.request_id + )
🧹 Nitpick comments (2)
tests/unittest/llmapi/test_llm_pytorch.py (2)
1-1: Remove unnecessary randomness (and import).Deterministic IDs are sufficient here; using
randomadds noise and triggers S311. Replace with a fixed list and drop the import.Apply this diff:
-import random
827-839: Make the test deterministic and ensure resource cleanup.
- Use a context manager for LLM to avoid leaks.
- Replace RNG with a deterministic token list; only length matters.
Apply this diff:
-class TestLlmError: - - def test_max_num_token_check(self): - """ LLM should raise error when got prompt length exceed the valid range. """ - llm = LLM(llama_model_path, - kv_cache_config=global_kvcache_config, - max_num_tokens=100) - - with pytest.raises(ValueError, - match="should not exceed max_num_tokens"): - ids = [random.randint(10, 100) for _ in range(101)] - llm.generate([ids]) +class TestLlmError: + def test_max_num_token_check(self): + """LLM raises when prompt length exceeds max_num_tokens.""" + with LLM( + llama_model_path, + kv_cache_config=global_kvcache_config, + max_num_tokens=100, + ) as llm: + with pytest.raises(ValueError, match="should not exceed max_num_tokens"): + ids = [42] * 101 # deterministic valid token id + llm.generate([ids])
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tensorrt_llm/executor/worker.py(1 hunks)tests/unittest/llmapi/apps/_test_openai_completions.py(1 hunks)tests/unittest/llmapi/test_llm_pytorch.py(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/unittest/llmapi/apps/_test_openai_completions.py
🧰 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:
tensorrt_llm/executor/worker.pytests/unittest/llmapi/test_llm_pytorch.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:
tensorrt_llm/executor/worker.pytests/unittest/llmapi/test_llm_pytorch.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:
tensorrt_llm/executor/worker.pytests/unittest/llmapi/test_llm_pytorch.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: tongyuantongyu
PR: NVIDIA/TensorRT-LLM#7726
File: tensorrt_llm/executor/worker.py:983-986
Timestamp: 2025-09-15T10:44:42.160Z
Learning: ErrorResponse objects are only created for the IPC path (handle_for_ipc_batched()) to work around serialization issues when tllm.Response contains Exception objects. They never appear in the single-process path (handle_for_worker()).
📚 Learning: 2025-09-04T17:00:29.500Z
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-09-04T17:00:29.500Z
Learning: Applies to **/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py} : Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Applied to files:
tests/unittest/llmapi/test_llm_pytorch.py
📚 Learning: 2025-08-06T13:58:07.506Z
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/llmapi/test_llm_pytorch.py
🧬 Code graph analysis (1)
tensorrt_llm/executor/worker.py (2)
tensorrt_llm/serve/openai_protocol.py (1)
ErrorResponse(100-105)tensorrt_llm/executor/utils.py (1)
ErrorResponse(107-110)
🪛 Ruff (0.12.2)
tests/unittest/llmapi/test_llm_pytorch.py
837-837: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ 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/unittest/llmapi/test_llm_pytorch.py (1)
1-1: Clarification: header not required for tests.Per repo convention, test files don’t carry the NVIDIA Apache-2.0 header. The prior bot warning can be ignored.
|
PR_Github #19171 [ run ] completed with state |
e6710b8 to
8355705
Compare
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 (1)
tensorrt_llm/executor/worker.py (1)
935-937: Coerce ErrorResponse.error_msg to str before IPC.Passing Exception objects through IPC can break serialization. Convert error_msg to str here.
Apply this diff:
- if isinstance(response, ErrorResponse): - pass # send ErrorResponse directly + if isinstance(response, ErrorResponse): + # Ensure string payload for transport/schema compliance + if not isinstance(response.error_msg, str): + response = ErrorResponse(response.client_id, + str(response.error_msg), + response.request_id)Also fix the construction site that enqueues a raw Exception (outside this hunk) to keep call-sites consistent:
- worker._await_response_helper.temp_error_responses.put( - ErrorResponse(req.id, e, req.id)) + worker._await_response_helper.temp_error_responses.put( + ErrorResponse(req.id, str(e), req.id))
🧹 Nitpick comments (1)
tests/unittest/llmapi/test_llm_pytorch.py (1)
1-1: Make the test deterministic and ensure cleanup.Avoid RNG in unit tests and use the LLM context manager to prevent resource leaks.
Apply this diff:
-import random @@ class TestLlmError: def test_max_num_token_check(self): """ LLM should raise error when got prompt length exceed the valid range. """ - llm = LLM(llama_model_path, - kv_cache_config=global_kvcache_config, - max_num_tokens=100) - - with pytest.raises(ValueError, - match="should not exceed max_num_tokens"): - ids = [random.randint(10, 100) for _ in range(101)] - llm.generate([ids]) + with LLM(llama_model_path, + kv_cache_config=global_kvcache_config, + max_num_tokens=100) as llm: + with pytest.raises(ValueError, + match="should not exceed max_num_tokens"): + ids = [42] * 101 + llm.generate([ids])Also applies to: 829-839
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tensorrt_llm/executor/worker.py(1 hunks)tests/unittest/llmapi/apps/_test_openai_completions.py(1 hunks)tests/unittest/llmapi/test_llm_pytorch.py(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/unittest/llmapi/apps/_test_openai_completions.py
🧰 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/unittest/llmapi/test_llm_pytorch.pytensorrt_llm/executor/worker.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/unittest/llmapi/test_llm_pytorch.pytensorrt_llm/executor/worker.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/unittest/llmapi/test_llm_pytorch.pytensorrt_llm/executor/worker.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: tongyuantongyu
PR: NVIDIA/TensorRT-LLM#7726
File: tensorrt_llm/executor/worker.py:983-986
Timestamp: 2025-09-15T10:44:42.160Z
Learning: ErrorResponse objects are only created for the IPC path (handle_for_ipc_batched()) to work around serialization issues when tllm.Response contains Exception objects. They never appear in the single-process path (handle_for_worker()).
📚 Learning: 2025-09-04T17:00:29.500Z
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-09-04T17:00:29.500Z
Learning: Applies to **/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py} : Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Applied to files:
tests/unittest/llmapi/test_llm_pytorch.py
📚 Learning: 2025-08-06T13:58:07.506Z
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/llmapi/test_llm_pytorch.py
🧬 Code graph analysis (2)
tests/unittest/llmapi/test_llm_pytorch.py (1)
tensorrt_llm/llmapi/llm.py (2)
LLM(1111-1127)generate(235-313)
tensorrt_llm/executor/worker.py (2)
benchmarks/cpp/gptManagerBenchmark.cpp (4)
response(208-230)response(208-209)response(232-270)response(232-232)tensorrt_llm/executor/utils.py (1)
ErrorResponse(107-110)
🪛 Ruff (0.12.2)
tests/unittest/llmapi/test_llm_pytorch.py
837-837: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ 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
|
PR_Github #19266 [ run ] triggered by Bot |
|
PR_Github #19266 [ run ] completed with state |
|
/bot run |
|
PR_Github #19358 [ run ] triggered by Bot |
Signed-off-by: Superjomn <[email protected]>
8355705 to
903a995
Compare
|
/bot run |
|
PR_Github #19489 [ 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: 0
🧹 Nitpick comments (2)
tests/unittest/llmapi/test_llm_pytorch.py (2)
1-1: Remove random import (switch test to deterministic IDs).After making the test deterministic (see suggestion below), drop this now‑unneeded import.
-import random
827-839: Make the test deterministic and guarantee LLM cleanup.
- Use fixed token IDs to avoid non‑determinism and S311 noise; the test only cares about length.
- Use the LLM context manager so resources are released even when the exception is raised.
- Tighten the docstring.
-class TestLlmError: +class TestLlmError: - def test_max_num_token_check(self): - """ LLM should raise error when got prompt length exceed the valid range. """ - llm = LLM(llama_model_path, - kv_cache_config=global_kvcache_config, - max_num_tokens=100) - - with pytest.raises(ValueError, - match="should not exceed max_num_tokens"): - ids = [random.randint(10, 100) for _ in range(101)] - llm.generate([ids]) + def test_max_num_token_check(self): + """Raise when prompt length exceeds max_num_tokens.""" + with LLM(model=llama_model_path, + kv_cache_config=global_kvcache_config, + max_num_tokens=100) as llm: + with pytest.raises(ValueError, match="should not exceed max_num_tokens"): + ids = [42] * 101 + llm.generate([ids])Optional: add a passing boundary case (len==100) in a separate test.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tensorrt_llm/executor/worker.py(1 hunks)tests/unittest/llmapi/apps/_test_openai_completions.py(1 hunks)tests/unittest/llmapi/test_llm_pytorch.py(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/unittest/llmapi/apps/_test_openai_completions.py
- tensorrt_llm/executor/worker.py
🧰 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/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/test_llm_pytorch.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/unittest/llmapi/test_llm_pytorch.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: tongyuantongyu
PR: NVIDIA/TensorRT-LLM#7726
File: tensorrt_llm/executor/worker.py:983-986
Timestamp: 2025-09-15T10:44:42.160Z
Learning: ErrorResponse objects are only created for the IPC path (handle_for_ipc_batched()) to work around serialization issues when tllm.Response contains Exception objects. They never appear in the single-process path (handle_for_worker()).
📚 Learning: 2025-09-04T17:00:29.500Z
Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-09-04T17:00:29.500Z
Learning: Applies to **/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py} : Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Applied to files:
tests/unittest/llmapi/test_llm_pytorch.py
📚 Learning: 2025-08-06T13:58:07.506Z
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/llmapi/test_llm_pytorch.py
🧬 Code graph analysis (1)
tests/unittest/llmapi/test_llm_pytorch.py (1)
tensorrt_llm/llmapi/llm.py (2)
LLM(1111-1127)generate(235-313)
🪛 Ruff (0.13.1)
tests/unittest/llmapi/test_llm_pytorch.py
837-837: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ 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/unittest/llmapi/test_llm_pytorch.py (1)
1-1: No license header needed for tests; ignore the bot’s suggestion.Per repo norms for tests/ files, copyright headers are not required. Leaving the file headerless is correct. (Based on retrieved learnings.)
|
PR_Github #19489 [ run ] completed with state |
|
/bot run |
|
PR_Github #19542 [ run ] triggered by Bot |
|
PR_Github #19542 [ run ] completed with state |
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (#7718) Signed-off-by: Superjomn <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (NVIDIA#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
…num_tokens (#7718) Signed-off-by: Superjomn <[email protected]> Signed-off-by: Wangshanshan <[email protected]>
Summary by CodeRabbit
Bug Fixes
Tests
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.