Skip to content

[https://nvbugs/6171743][fix] Set PYTORCH_ALLOC_CONF=expandable_segments:True on MPI workers via `patch_mpi_ - #14152

Merged
dominicshanshan merged 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6171743
May 21, 2026
Merged

[https://nvbugs/6171743][fix] Set PYTORCH_ALLOC_CONF=expandable_segments:True on MPI workers via `patch_mpi_#14152
dominicshanshan merged 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6171743

Conversation

@tensorrt-cicd

@tensorrt-cicd tensorrt-cicd commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: On RTX PRO 6000 Blackwell (96 GB, SM120), the DeepSeek-R1 NVFP4 throughput_tp8 config leaves only ~7 GiB free CUDA memory after kv_cache, so the MoE autotuner's ~14.3 GiB contiguous workspace request fails despite ~13 GiB held in PyTorch's fragmented cache.
  • Fix: Set PYTORCH_ALLOC_CONF=expandable_segments:True on MPI workers via patch_mpi_pool_session_for_env so the allocator can satisfy the autotuner request from non-contiguous virtual segments; also lower free_gpu_memory_fraction from 0.70 to 0.5 for more headroom; remove the waiver.
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Summary by CodeRabbit

  • Tests
    • Enhanced test reliability by improving environment configuration handling for multi-GPU setups.
    • Adjusted memory allocation parameters to optimize resource usage in memory-constrained test scenarios.
    • Re-enabled a previously skipped test case with fixes to address underlying stability issues.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

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: 5292f179-6166-4964-baad-cf5e4f3e24bf

📥 Commits

Reviewing files that changed from the base of the PR and between e6ccf97 and 56e2162.

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

📝 Walkthrough

Walkthrough

The PR updates the SM120 NVFP4 multi-GPU test to enable MPI environment variable propagation for PyTorch memory allocation expansion, adjusts the KV-cache memory fraction configuration, and removes the test's skip waiver.

Changes

SM120 NVFP4 Test Configuration

Layer / File(s) Summary
SM120 NVFP4 test configuration and MPI environment patching
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Test function adds mocker fixture, patches MPI pool session environment to set PYTORCH_ALLOC_CONF=expandable_segments:True, and reduces KV cache free_gpu_memory_fraction from 0.70 to 0.5.
Test waiver removal
tests/integration/test_lists/waives.txt
Skip waiver for TestDeepSeekR1::test_nvfp4_multi_gpus_sm120[throughput_tp8] is removed, enabling the test to run.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • xinhe-nv
  • hyukn
  • jieli-matrix
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title is truncated and incomplete, ending abruptly at 'patch_mpi_', making it unclear and difficult to understand the full scope of the change. Complete the PR title to clearly convey the full change: '[https://nvbugs/6171743][fix] Set PYTORCH_ALLOC_CONF=expandable_segments:True on MPI workers via patch_mpi_pool_session_for_env'.
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
Description check ✅ Passed The PR description covers the root cause, fix, and test plan comprehensively. It clearly explains the issue, the solution implemented, and verification steps performed.
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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@dominicshanshan

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #48483 [ run ] triggered by Bot. Commit: 56e2162 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #48483 [ run ] completed with state SUCCESS. Commit: 56e2162
/LLM/main/L0_MergeRequest_PR pipeline #38279 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

@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6171743 branch from 56e2162 to 6833844 Compare May 15, 2026 06:21
@ziyixiong-nv

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #48555 [ run ] triggered by Bot. Commit: 6833844 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #48555 [ run ] completed with state SUCCESS. Commit: 6833844
/LLM/main/L0_MergeRequest_PR pipeline #38345 completed with status: 'SUCCESS'

CI Report

Link to invocation

@dominicshanshan

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #48683 [ run ] triggered by Bot. Commit: 6833844 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #48683 [ run ] completed with state SUCCESS. Commit: 6833844
/LLM/main/L0_MergeRequest_PR pipeline #38460 completed with status: 'SUCCESS'

CI Report

Link to invocation

@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6171743 branch from 6833844 to 11ec076 Compare May 18, 2026 03:40
Comment thread tests/integration/defs/accuracy/test_llm_api_pytorch.py
@dominicshanshan
dominicshanshan enabled auto-merge (squash) May 20, 2026 01:50
The test failed during executor creation with CUDA OOM at the
'executor_extra' stage on RTX PRO 6000 Blackwell (96 GB) when the MoE
autotuner forward pass needed a ~14.3 GiB contiguous workspace but the
allocator only had ~7 GiB free with ~13 GiB held in fragmented cache.

Set PYTORCH_ALLOC_CONF=expandable_segments:True for the MPI workers via
the existing patch_mpi_pool_session_for_env helper to let PyTorch satisfy
the autotuner allocation across non-contiguous segments. Also lower
free_gpu_memory_fraction from 0.70 to 0.5 for additional headroom on this
tight 96 GB SKU. Remove the corresponding waiver.

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6171743 branch from 11ec076 to aeb0d85 Compare May 21, 2026 01:53
@dominicshanshan

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #49625 [ run ] triggered by Bot. Commit: aeb0d85 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #49625 [ run ] completed with state SUCCESS. Commit: aeb0d85
/LLM/main/L0_MergeRequest_PR pipeline #39245 completed with status: 'SUCCESS'

CI Report

Link to invocation

@dominicshanshan
dominicshanshan merged commit b7c2303 into NVIDIA:main May 21, 2026
7 checks passed
xxi-nv pushed a commit to xxi-nv/TensorRT-LLM that referenced this pull request May 22, 2026
…ents:True` on MPI workers via `patch_mpi_ (NVIDIA#14152)

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
KleinBlueC pushed a commit to KleinBlueC/TensorRT-LLM that referenced this pull request May 26, 2026
…ents:True` on MPI workers via `patch_mpi_ (NVIDIA#14152)

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
bmarimuthu-nv pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request May 28, 2026
…ents:True` on MPI workers via `patch_mpi_ (NVIDIA#14152)

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
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.

4 participants