Skip to content

[None][fix] Fix and unwaive nemotron related bugs - #15085

Merged
Wanli-Jiang merged 1 commit into
NVIDIA:mainfrom
Wanli-Jiang:user/williamj/nemotron-fix
Jun 10, 2026
Merged

[None][fix] Fix and unwaive nemotron related bugs#15085
Wanli-Jiang merged 1 commit into
NVIDIA:mainfrom
Wanli-Jiang:user/williamj/nemotron-fix

Conversation

@Wanli-Jiang

@Wanli-Jiang Wanli-Jiang commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Tests
    • Updated test setup configurations
    • Removed 4 obsolete test waiver entries

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-compatible or api-breaking. For api-breaking, include BREAKING in 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.

@Wanli-Jiang
Wanli-Jiang requested a review from a team as a code owner June 8, 2026 06:40
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR enables trust_remote_code=True in LLM constructor calls for two Nemotron tests and removes the corresponding test waivers that were previously required for these tests to pass.

Changes

Enable trust_remote_code in Nemotron tests

Layer / File(s) Summary
Unit test: enable trust_remote_code in test_nemotron_nas_lora
tests/unittest/llmapi/test_llm_pytorch.py, tests/integration/test_lists/waives.txt
Add trust_remote_code=True to the LLM constructor in test_nemotron_nas_lora and remove the two corresponding test waivers (test_nemotron_nas_lora[None] and test_nemotron_nas_lora[cuda_graph_config0]).
Integration test: enable trust_remote_code in test_auto_dtype_tp8
tests/integration/defs/accuracy/test_llm_api_pytorch.py, tests/integration/test_lists/waives.txt
Add trust_remote_code=True to the LLM constructor in TestNemotronNas.test_auto_dtype_tp8 and remove the two corresponding integration test waivers (TestNemotronNas::test_auto_dtype_tp8 and TestNemotronV3Super::test_nvfp4_8gpus_mtp).

Possibly related PRs

  • NVIDIA/TensorRT-LLM#14892: Modifies LLM test constructors to explicitly set trust_remote_code=True and adjusts corresponding waived tests with the same targeted behavior.
  • NVIDIA/TensorRT-LLM#14839: Removes integration test waivers including TestNemotronNas::test_auto_dtype_tp8, directly related to this PR's waiver removal.
  • NVIDIA/TensorRT-LLM#14783: Updates test_auto_dtype_tp8 to pass trust_remote_code=True and removes its waiver entry, centered on the same test case.

Suggested reviewers

  • tijyojwad
  • moraxu
  • JunyiXu-nv

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is entirely empty—only the template structure is present with no actual description, test coverage, or implementation details provided. Fill in the Description section explaining what nemotron bugs were fixed and why, specify which tests validate the changes in Test Coverage, and confirm the PR checklist items are complete.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates this is a fix for nemotron-related bugs and includes waiver removal, matching the changeset modifications to test files and waiver list.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Ensure LLM is always cleaned up in this test.

test_nemotron_nas_lora creates llm but never closes it. If generate()/assertion fails, resources can leak and destabilize later tests. Please wrap this in a context manager (or try/finally with llm.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

📥 Commits

Reviewing files that changed from the base of the PR and between 7e49baa and f37df1d.

📒 Files selected for processing (3)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tests/integration/test_lists/waives.txt
  • tests/unittest/llmapi/test_llm_pytorch.py
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52687 [ run ] triggered by Bot. Commit: f37df1d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52687 [ run ] completed with state FAILURE. Commit: f37df1d
/LLM/main/L0_MergeRequest_PR pipeline #41954 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-fix branch from f37df1d to 696108d Compare June 8, 2026 09:15
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52730 [ run ] triggered by Bot. Commit: 696108d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52730 [ run ] completed with state SUCCESS. Commit: 696108d
/LLM/main/L0_MergeRequest_PR pipeline #41995 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52910 [ run ] triggered by Bot. Commit: 696108d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52910 [ run ] completed with state SUCCESS. Commit: 696108d
/LLM/main/L0_MergeRequest_PR pipeline #42156 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-fix branch from 696108d to 49e3c7e Compare June 9, 2026 04:28
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52951 [ run ] triggered by Bot. Commit: 49e3c7e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52951 [ run ] completed with state SUCCESS. Commit: 49e3c7e
/LLM/main/L0_MergeRequest_PR pipeline #42192 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot skip --comment "the unwaived tests were passed"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53190 [ skip ] triggered by Bot. Commit: 49e3c7e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53190 [ skip ] completed with state SUCCESS. Commit: 49e3c7e
Skipping testing for commit 49e3c7e

Link to invocation

@Wanli-Jiang
Wanli-Jiang merged commit 8e40515 into NVIDIA:main Jun 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants