Skip to content

[https://nvbugs/6437410][fix] fix nemotron weight update test - #16712

Merged
zhaoyangwang-nvidia merged 3 commits into
NVIDIA:mainfrom
shuyixiong:user/shuyix/fix_nemotron_weight_update
Aug 18, 2026
Merged

[https://nvbugs/6437410][fix] fix nemotron weight update test#16712
zhaoyangwang-nvidia merged 3 commits into
NVIDIA:mainfrom
shuyixiong:user/shuyix/fix_nemotron_weight_update

Conversation

@shuyixiong

@shuyixiong shuyixiong commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Nemotron-H setup now checks required imports directly.
  • The test derives and passes layers_block_type from the checkpoint configuration.
  • The logits comparison threshold now reflects expected numerical differences.
  • Ray CI stages install pinned causal-conv1d and mamba_ssm wheels by architecture.
  • The obsolete part4 waiver was removed.
  • No obvious correctness, API, configuration, or regression issues identified.

QA Engineer Review

Modified test functions and helpers:

  • Refactored test_llm_update_weights_nemotron_h.
  • Removed mamba_deps.
  • Removed _nemotron_h_body.
  • Removed _nemotron_h_subprocess_entry.
  • Updated RefHFModelWithIPCHandles.__init__.

Coverage:

  • test_llm_update_weights_nemotron_h was listed in tests/integration/test_lists/waives.txt; its waiver was removed.
  • No test-db/ or qa/ changes were provided.
  • CI runs completed with partly tested status, but CBTS coverage data is unavailable.

Verdict: needs follow-up — CBTS coverage data is unavailable.

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.

@shuyixiong

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --stage-list "H100_PCIe-PyTorch-Ray-1, DGX_B200-4_GPUs-PyTorch-Ray-1"

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 800cc4a1-e608-479a-8f99-95db2ac70196

📥 Commits

Reviewing files that changed from the base of the PR and between efeaa76 and 6996ad5.

📒 Files selected for processing (3)
  • jenkins/L0_Test.groovy
  • jenkins/scripts/slurm_install.sh
  • tests/integration/test_lists/waives.txt
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/integration/test_lists/waives.txt
  • jenkins/L0_Test.groovy
  • jenkins/scripts/slurm_install.sh

Walkthrough

The Ray test setup now installs pinned architecture-specific Mamba dependencies. Update-weights tests pass checkpoint-derived layer configuration directly. The Nemotron-H test runs in-process with explicit dependency checks and an updated logits threshold. Its part4 waiver is removed.

Changes

Update-weights test coverage

Layer / File(s) Summary
Install Ray test dependencies
jenkins/L0_Test.groovy, jenkins/scripts/slurm_install.sh
Ray-enabled test setup installs pinned, architecture-specific causal_conv1d and mamba_ssm wheels without dependencies.
Update model configuration and Nemotron-H test
tests/unittest/_torch/ray_orchestrator/single_gpu/test_llm_update_weights.py, tests/unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py
The reference model forwards optional configuration values. The Nemotron-H test checks imports, derives layers_block_type, runs in-process, removes subprocess helpers, and uses a 0.85 logits threshold.
Enable the multi-GPU test
tests/integration/test_lists/waives.txt
The part4 waiver entry is removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: ⚪ Minimal · up to 6996a

This change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Possibly related PRs

Suggested reviewers: crazydemo, schetlur-nv, niukuo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing the Nemotron weight update test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Actionable comments posted: 1

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

Inline comments:
In
`@tests/unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py`:
- Around line 796-847: Update test_llm_update_weights_nemotron_h to launch the
pytest command with subprocess.Popen(start_new_session=True), replacing
subprocess.run while preserving its output capture and timeout behavior. In the
subprocess.TimeoutExpired handler, terminate the entire process group with
os.killpg using the child’s process group ID before failing the test, ensuring
Ray/NCCL workers are also stopped.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bf9183ba-ae60-4bd9-9a0e-04b6c54031a4

📥 Commits

Reviewing files that changed from the base of the PR and between 128d020 and 4c17c85.

📒 Files selected for processing (3)
  • tests/integration/test_lists/waives.txt
  • tests/unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py
  • tests/unittest/_torch/ray_orchestrator/single_gpu/test_llm_update_weights.py
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60897 [ run ] triggered by Bot. Commit: 4c17c85 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60897 [ run ] completed with state SUCCESS. Commit: 4c17c85
/LLM/main/L0_MergeRequest_PR pipeline #49165 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@shikicloud shikicloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

Comment thread tests/unittest/_torch/ray_orchestrator/single_gpu/test_llm_update_weights.py Outdated
Comment thread tests/unittest/_torch/ray_orchestrator/single_gpu/test_llm_update_weights.py Outdated

@chzblych chzblych left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved for the waive list change.

@fredricz-20070104 fredricz-20070104 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review summary - CONCERNS

Verdict: This test-only fix is mechanically mergeable and the core approach (truncating hybrid NemotronH via layers_block_type instead of the silently-ignored num_hidden_layers) looks correct, but the timeout error path leaks GPU-holding worker processes and should be fixed before merge.

Concerns

  1. [MAJOR] tests/unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py:831 - TimeoutExpired handler leaks the Ray/NCCL process group
    • What is wrong: The subprocess is started with subprocess.run(...) with no new session / process group. On subprocess.TimeoutExpired, only the direct pytest child is terminated; the Ray/NCCL/CUDA workers it forked are orphaned.
    • How it fails: The 1800s timeout exists precisely to catch a Ray/NCCL/CUDA deadlock. When that hang occurs -> TimeoutExpired fires -> pytest.fail(...) is raised, but the worker grandchildren survive and keep holding multi-GPU memory. Subsequent tests on the same node then fail with OOM / device-busy, turning a single hang into a cascade.
    • Suggested fix: launch in its own process group and kill the group on timeout, e.g.
      proc = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE, text=True,
                              start_new_session=True)
      try:
          out, err = proc.communicate(timeout=subprocess_timeout_s)
      except subprocess.TimeoutExpired:
          os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
          out, err = proc.communicate()
          pytest.fail(f"Nemotron-H subprocess hung >{subprocess_timeout_s:.0f}s; killed.\n{out}\n{err}")

Minor notes (non-blocking)

  • tests/unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py:772 - threshold lowered 0.9 -> 0.8 while observed overlap is ~0.89; the ~0.09 slack could mask a real regression. Consider ~0.85.
  • tests/unittest/_torch/ray_orchestrator/single_gpu/test_llm_update_weights.py:44 - dropping the num_hidden_layers=4 default means any caller that relied on it now loads the full checkpoint. Please confirm no other instantiations depend on the old default.
  • tests/unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py:812 - -p no:xdist can error if pytest-xdist is not installed in the subprocess env.

QA view

  • Test coverage: adequate for a test-only change - it re-enables the previously waived Nemotron-H test; there is no production code to cover. Runtime pass/fail is unverified (CBTS results unavailable per the PR description) and the timeout/leak path is not itself exercised.
  • SM coverage: arch-guarded by @skip_pre_hopper, so it runs on Hopper+ only; the FP8 Nemotron/Qwen case stays waived, so the fp8 variant of this path remains untested. No new arch introduced without a test.
  • Test code: see the MAJOR (process-group leak) plus the loosened threshold and -p no:xdist notes above.
  • Test time: significant - removing the part4 waiver re-enables a 4-GPU weight-update test on a (7-layer-truncated) 30B model with an 1800s budget. Exact runtime can't be read from the diff.
  • Needs /qa-verify: yes - this un-waives a previously failing bug-fix test whose result is unavailable, changes test infrastructure (subprocess-driven pytest + process lifecycle), and has a leaky error path. A human QA should confirm it passes on Hopper+ and leaves no orphaned GPU workers.

Does this actually fix nvbugs/6437410?

Likely yes. The traced failure is that NemotronHConfig derives num_hidden_layers from layers_block_type and silently ignores the direct override, so the old model_kwargs={'num_hidden_layers':7} kept the full 30B model (OOM / unmatched logits). The diff truncates via layers_block_type[:7] on both the HF reference and the LLM, adds an assert to catch the silent-ignore case, loosens the threshold for mamba/selective-scan drift, and re-runs in a fresh python -m pytest subprocess so the mamba-ssm fast path is picked up. That chain addresses the root cause, but it is unverified at runtime.

Possible new issues

  • Leaked Ray/NCCL GPU workers on a hang (MAJOR) can break later tests on the same node.
  • Removed num_hidden_layers=4 default may cause unshown callers to load full checkpoints.
  • The 0.8 threshold reduces sensitivity to future numerical regressions.

What I could not verify

  • The other instantiations of RefHFModelWithIPCHandles (not in the diff) and whether any relied on the old default of 4 layers.
  • Actual test pass/fail and whether the subprocess leaves orphaned processes at runtime - CBTS coverage was not provided.
  • Whether pytest-xdist is guaranteed present in the subprocess environment.

Automated review by NVCortex Lite, run by @fredricz-20070104.

@shikicloud
shikicloud requested a review from a team as a code owner August 4, 2026 02:43
@shikicloud
shikicloud requested a review from crazydemo August 4, 2026 02:43

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
jenkins/L0_Test.groovy (1)

3811-3813: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Verify the integrity of the downloaded native wheels.

These commands install native-code wheels from public GitHub during CI. The release assets publish SHA-256 checksums, but this command does not verify them. Add per-architecture checksum validation or mirror the wheels into controlled Artifactory before installation. (github.com)

🤖 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 `@jenkins/L0_Test.groovy` around lines 3811 - 3813, Update the native wheel
installation block to verify SHA-256 checksums for both causal-conv1d and
mamba_ssm assets before pip installation, using the architecture-specific
published checksums for mambaArch. Alternatively, source the wheels from
controlled Artifactory, but do not install directly from the public URLs without
integrity validation.
🤖 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.

Inline comments:
In
`@tests/unittest/_torch/ray_orchestrator/single_gpu/test_llm_update_weights.py`:
- Around line 44-51: Update RefHFModelWithIPCHandles.__init__ to annotate its
return as None and replace Optional[int] with int | None and Optional[List[str]]
with list[str] | None, preserving the existing constructor behavior and
parameters.

---

Nitpick comments:
In `@jenkins/L0_Test.groovy`:
- Around line 3811-3813: Update the native wheel installation block to verify
SHA-256 checksums for both causal-conv1d and mamba_ssm assets before pip
installation, using the architecture-specific published checksums for mambaArch.
Alternatively, source the wheels from controlled Artifactory, but do not install
directly from the public URLs without integrity validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 21608973-137a-4a75-89a8-c7863f851674

📥 Commits

Reviewing files that changed from the base of the PR and between 4c17c85 and 3705f99.

📒 Files selected for processing (4)
  • jenkins/L0_Test.groovy
  • jenkins/scripts/slurm_install.sh
  • tests/unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py
  • tests/unittest/_torch/ray_orchestrator/single_gpu/test_llm_update_weights.py

@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast --stage-list "H100_PCIe-PyTorch-Ray-1, DGX_B200-4_GPUs-PyTorch-Ray-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63636 [ run ] triggered by Bot. Commit: fd0b20c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63636 [ run ] completed with state SUCCESS. Commit: fd0b20c
/LLM/main/L0_MergeRequest_PR pipeline #51592 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66447 [ run ] triggered by Bot. Commit: 11e00d9 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66447 [ run ] completed with state FAILURE. Commit: 11e00d9
/LLM/main/L0_MergeRequest_PR pipeline #54089 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

@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66485 [ run ] triggered by Bot. Commit: 11e00d9 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66485 [ run ] completed with state SUCCESS. Commit: 11e00d9
/LLM/main/L0_MergeRequest_PR pipeline #54125 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

@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66519 [ run ] triggered by Bot. Commit: 11e00d9 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

CI Report

Link to invocation

@shikicloud

Copy link
Copy Markdown
Collaborator

Hi @zhaoyangwang-nvidia, all review threads have been addressed and the full pre-merge CI has passed. Could you please re-enable auto-merge? Thanks!

@zhaoyangwang-nvidia
zhaoyangwang-nvidia enabled auto-merge (squash) August 17, 2026 02:52
@zhaoyangwang-nvidia

Copy link
Copy Markdown
Collaborator

Enabled, please check the conflict

shuyixiong and others added 3 commits August 16, 2026 20:11
Signed-off-by: Shuyi Xiong <219646547+shuyixiong@users.noreply.github.com>
Signed-off-by: shuyixiong <219646547+shuyixiong@users.noreply.github.com>
… drop nested pytest

Signed-off-by: shikicloud <shikiw@nvidia.com>
auto-merge was automatically disabled August 17, 2026 03:18

Head branch was pushed to by a user without write access

@shikicloud
shikicloud force-pushed the user/shuyix/fix_nemotron_weight_update branch from 11e00d9 to 86440e7 Compare August 17, 2026 03:18
@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66620 [ run ] triggered by Bot. Commit: 86440e7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66620 [ run ] completed with state FAILURE. Commit: 86440e7
/LLM/main/L0_MergeRequest_PR pipeline #54241 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

@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66678 [ run ] triggered by Bot. Commit: 86440e7 Link to invocation

@zhaoyangwang-nvidia
zhaoyangwang-nvidia enabled auto-merge (squash) August 17, 2026 08:03
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66678 [ run ] completed with state SUCCESS. Commit: 86440e7
/LLM/main/L0_MergeRequest_PR pipeline #54294 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

@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66725 [ run ] triggered by Bot. Commit: 86440e7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66725 [ run ] completed with state FAILURE. Commit: 86440e7
/LLM/main/L0_MergeRequest_PR pipeline #54333 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

@shikicloud

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66728 [ run ] triggered by Bot. Commit: 86440e7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

CI Report

Link to invocation

@zhaoyangwang-nvidia
zhaoyangwang-nvidia merged commit 8077016 into NVIDIA:main Aug 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants