[None][fix] Fix and unwaive nemotron related bugs - #15085
Conversation
|
/bot run --disable-fail-fast |
📝 WalkthroughWalkthroughThis PR enables ChangesEnable trust_remote_code in Nemotron tests
Possibly related PRs
Suggested reviewers
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/unittest/llmapi/test_llm_pytorch.py (1)
609-630:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winEnsure
LLMis always cleaned up in this test.
test_nemotron_nas_loracreatesllmbut never closes it. Ifgenerate()/assertion fails, resources can leak and destabilize later tests. Please wrap this in a context manager (ortry/finallywithllm.shutdown()).Suggested fix
- llm = LLM( - model= - f"{llm_models_root()}/nemotron-nas/Llama-3_3-Nemotron-Super-49B-v1", - lora_config=lora_config, - cuda_graph_config=cuda_graph_config, - trust_remote_code=True) - - prompts = [ - "Hello, how are you?", - "Hello, how are you?", - ] - - sampling_params = SamplingParams(max_tokens=3, add_special_tokens=False) - lora_req = LoRARequest( - "task-0", 0, - f"{llm_models_root()}/nemotron-nas/Llama-3_3-Nemotron-Super-49B-v1-lora-adapter_r64" - ) - lora_request = [lora_req, None] - - outputs = llm.generate(prompts, sampling_params, lora_request=lora_request) - - assert similar(outputs[0].outputs[0].text, outputs[1].outputs[0].text) + with LLM( + model= + f"{llm_models_root()}/nemotron-nas/Llama-3_3-Nemotron-Super-49B-v1", + lora_config=lora_config, + cuda_graph_config=cuda_graph_config, + trust_remote_code=True) as llm: + prompts = [ + "Hello, how are you?", + "Hello, how are you?", + ] + + sampling_params = SamplingParams(max_tokens=3, add_special_tokens=False) + lora_req = LoRARequest( + "task-0", 0, + f"{llm_models_root()}/nemotron-nas/Llama-3_3-Nemotron-Super-49B-v1-lora-adapter_r64" + ) + lora_request = [lora_req, None] + + outputs = llm.generate(prompts, sampling_params, lora_request=lora_request) + assert similar(outputs[0].outputs[0].text, outputs[1].outputs[0].text)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unittest/llmapi/test_llm_pytorch.py` around lines 609 - 630, The test creates an LLM instance (LLM(...)) but never closes it; modify test_nemotron_nas_lora to always call llm.shutdown() by wrapping use of LLM in a context manager or a try/finally: create llm, call outputs = llm.generate(...), run the assertion, and in finally call llm.shutdown() so resources are released even if generate() or the assert fails; reference the LLM constructor and the shutdown() method to locate where to add the cleanup.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tests/unittest/llmapi/test_llm_pytorch.py`:
- Around line 609-630: The test creates an LLM instance (LLM(...)) but never
closes it; modify test_nemotron_nas_lora to always call llm.shutdown() by
wrapping use of LLM in a context manager or a try/finally: create llm, call
outputs = llm.generate(...), run the assertion, and in finally call
llm.shutdown() so resources are released even if generate() or the assert fails;
reference the LLM constructor and the shutdown() method to locate where to add
the cleanup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7868ddec-a48c-4988-8ac7-b92f73865149
📒 Files selected for processing (3)
tests/integration/defs/accuracy/test_llm_api_pytorch.pytests/integration/test_lists/waives.txttests/unittest/llmapi/test_llm_pytorch.py
💤 Files with no reviewable changes (1)
- tests/integration/test_lists/waives.txt
|
PR_Github #52687 [ run ] triggered by Bot. Commit: |
|
PR_Github #52687 [ run ] completed with state
|
f37df1d to
696108d
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #52730 [ run ] triggered by Bot. Commit: |
|
PR_Github #52730 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #52910 [ run ] triggered by Bot. Commit: |
|
PR_Github #52910 [ run ] completed with state
|
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
696108d to
49e3c7e
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #52951 [ run ] triggered by Bot. Commit: |
|
PR_Github #52951 [ run ] completed with state
|
|
/bot skip --comment "the unwaived tests were passed" |
|
PR_Github #53190 [ skip ] triggered by Bot. Commit: |
|
PR_Github #53190 [ skip ] completed with state |
Summary by CodeRabbit
Description
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.