Skip to content

[https://nvbugs/6162860][fix] Set free_gpu_memory_fraction=0.6 only when torch_compile=True for test_bfloat16_#14109

Merged
liji-nv merged 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6162860
May 27, 2026
Merged

[https://nvbugs/6162860][fix] Set free_gpu_memory_fraction=0.6 only when torch_compile=True for test_bfloat16_#14109
liji-nv merged 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6162860

Conversation

@tensorrt-cicd

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

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: KvCacheConfig.free_gpu_memory_fraction=0.75 leaves no headroom for piecewise CUDA-graph workspaces and lazy cublasLt handle allocation when torch_compile + DP + MTP + ep4 are all enabled.
  • Fix: Set free_gpu_memory_fraction=0.6 only when torch_compile=True for test_bfloat16_4gpus; keep 0.75 otherwise. Remove the matching nvbugs/6162860 waiver. Verified test passes (gsm8k 64.63, threshold 61.237) on a fresh GPU node.
  • 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
    • Improved test reliability by dynamically adjusting memory configuration based on compilation settings.
    • Removed waived test entry to re-enable specific test validation.

Review Change Stack

@tensorrt-cicd
tensorrt-cicd requested a review from a team as a code owner May 14, 2026 00:55
@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: 287b5977-556e-47b7-a994-c30694172b12

📥 Commits

Reviewing files that changed from the base of the PR and between 8cc5b61 and af5e3cc.

📒 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

This PR adjusts KV cache memory allocation in the test_bfloat16_4gpus test to account for torch_compile mode, making the free_gpu_memory_fraction dynamic (0.6 when torch_compile is enabled, otherwise 0.75), and removes a now-unnecessary test waiver entry that was skipping this configuration.

Changes

test_bfloat16_4gpus memory configuration and waiver cleanup

Layer / File(s) Summary
Fix KV cache memory and remove waiver
tests/integration/defs/accuracy/test_llm_api_pytorch.py, tests/integration/test_lists/waives.txt
test_bfloat16_4gpus now computes free_gpu_memory_fraction based on whether torch_compile is enabled (0.6 if enabled, 0.75 otherwise) and passes it into KvCacheConfig. The waived entry for this test with ep4 configuration and torch_compile=True is removed from the waivers list.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • xinhe-nv
  • jieli-matrix
  • StanleySun639
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adjusting free_gpu_memory_fraction based on torch_compile flag for a specific test.
Description check ✅ Passed The description includes root cause, fix explanation, verification results, and test coverage, aligning well with the template requirements despite not using all template sections.
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.

@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6162860 branch from af5e3cc to ec2fcfc Compare May 15, 2026 06:21
@liji-nv
liji-nv force-pushed the repair-bot-bug6162860 branch from ec2fcfc to 50bbfad Compare May 20, 2026 07:07
@liji-nv

liji-nv commented May 20, 2026

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@liji-nv liji-nv self-assigned this May 20, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #49386 [ run ] triggered by Bot. Commit: 50bbfad Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #49386 [ run ] completed with state SUCCESS. Commit: 50bbfad
/LLM/main/L0_MergeRequest_PR pipeline #39038 completed with status: 'SUCCESS'

CI Report

Link to invocation

@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6162860 branch from 50bbfad to 479540c Compare May 21, 2026 05:57
…torch_compile

The variant ep4-mtp_nextn=2-attention_dp=True-cuda_graph=True-overlap_scheduler=True-torch_compile=True
fails on RTX Pro 6000 Blackwell Desktop with cublas handle creation failure
during warmup. With torch_compile=True, piecewise CUDA graph workspaces and
lazy cublasLt handle allocation cannot fit alongside a 0.75 KV cache reservation.
Lower free_gpu_memory_fraction to 0.6 only when torch_compile is enabled and
remove the matching waiver.

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
@liji-nv
liji-nv force-pushed the repair-bot-bug6162860 branch from 479540c to 7391428 Compare May 27, 2026 07:06
@liji-nv

liji-nv commented May 27, 2026

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@liji-nv
liji-nv enabled auto-merge (squash) May 27, 2026 07:06
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #50496 [ run ] triggered by Bot. Commit: 7391428 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #50496 [ run ] completed with state SUCCESS. Commit: 7391428
/LLM/main/L0_MergeRequest_PR pipeline #40004 completed with status: 'SUCCESS'

CI Report

Link to invocation

@liji-nv
liji-nv merged commit 8cd28ed into NVIDIA:main May 27, 2026
8 checks passed
bmarimuthu-nv pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request May 28, 2026
…hen torch_compile=True for test_bfloat16_ (NVIDIA#14109)

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
tensorrt-cicd added a commit to tensorrt-cicd/TensorRT-LLM that referenced this pull request Jun 17, 2026
…fp8 with torch_compile

Piecewise CUDA-graph capture under torch_compile=True needs additional GPU
workspace beyond what the default kv_cache fraction (0.9) reserves on the
44 GiB L40S. As a result, _capture_piecewise_cuda_graphs OOMs in the
executor_extra stage during executor creation.

Mirror the established fix from NVIDIA#14109 (nvbugs/6162860, TestDeepSeekV3Lite):
when torch_compile=True, set free_gpu_memory_fraction=0.6 so the executor
has room for graph workspace. The non-compile path keeps the default and
already passes.

Also remove the now-obsolete L40S waiver for this test.

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.

3 participants