Skip to content

[https://nvbugs/6105768][fix] ** Runtime GPU detection inside the test function: when total_memory < 80 GiB - #13471

Open
tensorrt-cicd wants to merge 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6105768
Open

[https://nvbugs/6105768][fix] ** Runtime GPU detection inside the test function: when total_memory < 80 GiB #13471
tensorrt-cicd wants to merge 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6105768

Conversation

@tensorrt-cicd

@tensorrt-cicd tensorrt-cicd commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: ** DeepSeek-V3-Lite bf16 model requires ~37 GiB per disaggregated worker. With two workers (context + generation) sharing a single L40S GPU (44.4 GiB), total memory needed is ~74 GiB, causing OOM during model._apply(init_meta_tensor). The test was designed for H100 (80 GiB) with workers on separate GPUs but had no memory guard.
  • Fix: ** Runtime GPU detection inside the test function: when total_memory < 80 GiB and device_count < 2, fall back to TinyLlama-1.1B-Chat-v1.0 (~2 GiB) with a dedicated small-model config (disagg_config_cancel_stress_test_small.yaml) that uses conservative free_gpu_memory_fraction values (0.2/0.3 vs 0.3/0.85) to prevent KV cache allocation races on shared GPUs. The parametrize ID [DeepSeek-V3-Lite-bf16] is preserved since it comes from the fixture parameter, not the actual model loaded. On H100 or multi-GPU systems, the original DeepSeek-V3-Lite bf16 path is unchanged.
  • 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
    • Added a TinyLlama cancellation stress-test configuration for low-memory, single-GPU systems.
    • Updated cancellation stress tests to select TinyLlama or DeepSeek-V3-Lite based on GPU memory and device count.
    • Added configurable prompt-length ranges to the cancellation test helper.
    • Re-enabled the DeepSeek-V3-Lite large-context cancellation test.

Dev Engineer Review

  • The runtime GPU detection preserves the existing DeepSeek-V3-Lite path on H100 and multi-GPU systems.
  • The TinyLlama configuration uses conservative GPU memory fractions for systems with less than 80 GiB of memory.
  • The new YAML configuration defines consistent PyTorch, disaggregated serving, chunked prefill, KV-cache reuse, cache transceiver, and CUDA graph settings.
  • The run_disaggregated_cancel_test API change preserves the existing default prompt range.
  • The waiver removal uses the existing test path and removes the obsolete nvbugs/6105768 skip.
  • No configuration typos, duplicate waiver entries, or unintended scope changes were identified.

QA Engineer Review

  • Modified test_disaggregated_cancel_large_context_requests.
  • Modified run_disaggregated_cancel_test to accept configurable prompt-length ranges.
  • Added the cancel_stress_test_small test configuration.
  • The modified test remains represented in tests/integration/test_lists/waives.txt; the previous waiver was removed.
  • Verdict: sufficient.

@tensorrt-cicd
tensorrt-cicd requested a review from a team as a code owner April 26, 2026 07:42
@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds a TinyLlama disaggregated cancellation configuration. The test runner now accepts prompt-length ranges and selects test settings based on GPU count and memory. The existing DeepSeek-V3-Lite waiver is removed.

Changes

Cancellation stress test

Layer / File(s) Summary
Small cancellation test configuration
tests/integration/defs/disaggregated/test_configs/disagg_config_cancel_stress_test_small.yaml
Adds TinyLlama context and generation server settings with chunked prefill, KV-cache reuse, cache transceiver buffering, and padded CUDA graphs.
GPU-aware test execution
tests/integration/defs/disaggregated/test_disaggregated.py
Registers the small configuration, forwards prompt_len_range, and selects TinyLlama with 200–800-token prompts on single-GPU systems below 80 GiB. Other systems retain DeepSeek-V3-Lite with 2,000–8,000-token prompts.
Large-context test enablement
tests/integration/test_lists/waives.txt
Removes the waiver for the DeepSeek-V3-Lite large-context cancellation test.

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

Sequence Diagram(s)

sequenceDiagram
  participant CancellationTest
  participant GPUDetection
  participant CancelStressRunner
  CancellationTest->>GPUDetection: read GPU count and memory
  GPUDetection->>CancellationTest: return available resources
  CancellationTest->>CancelStressRunner: run selected model with prompt-length range
Loading

Possibly related PRs

  • NVIDIA/TensorRT-LLM#17217: Removes a related DeepSeekV3Lite test waiver, but uses a different test configuration and issue.

Suggested reviewers: schetlur-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the bug, fix type, and primary change: runtime GPU detection for low-memory systems.
Description check ✅ Passed The description explains the root cause, solution, affected configurations, test plan, and linked bug.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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.

🧹 Nitpick comments (1)
tests/integration/defs/disaggregated/test_disaggregated.py (1)

1-1: Consider updating copyright year.

The copyright header shows 2022-2024, but since this file is being modified in 2026, it should be updated to 2022-2026 per coding guidelines. As per coding guidelines: "update year on modified files".

📝 Proposed fix
-# SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/integration/defs/disaggregated/test_disaggregated.py` at line 1, Update
the copyright header year range in test_disaggregated.py from "2022-2024" to
"2022-2026" so the file reflects the current modification year; locate the
SPDX/header comment at the top of the file and change the year substring
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/integration/defs/disaggregated/test_disaggregated.py`:
- Line 1: Update the copyright header year range in test_disaggregated.py from
"2022-2024" to "2022-2026" so the file reflects the current modification year;
locate the SPDX/header comment at the top of the file and change the year
substring accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5baeccdf-3fcb-478d-926d-8942b9c81d28

📥 Commits

Reviewing files that changed from the base of the PR and between eeba2eb and ba07791.

📒 Files selected for processing (3)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cancel_stress_test_small.yaml
  • tests/integration/defs/disaggregated/test_disaggregated.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6105768 branch 4 times, most recently from a0728f1 to 24110eb Compare May 15, 2026 08:39
@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6105768 branch from 24110eb to d23214d Compare May 28, 2026 07:04
@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6105768 branch 4 times, most recently from c9c14f2 to 92ebad0 Compare June 13, 2026 23:16
@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6105768 branch from 92ebad0 to 4f684d0 Compare June 25, 2026 11:52
@trtllm-agent
trtllm-agent force-pushed the repair-bot-bug6105768 branch 2 times, most recently from 7b9048b to 0adb238 Compare July 11, 2026 10:45
@trtllm-agent
trtllm-agent force-pushed the repair-bot-bug6105768 branch from 0adb238 to d19b782 Compare July 18, 2026 08:51
@trtllm-agent
trtllm-agent requested review from a team as code owners July 18, 2026 08:51
…M on L40S

The test_disaggregated_cancel_large_context_requests test fails with OOM
on L40S (44.4 GiB) because DeepSeek-V3-Lite bf16 requires ~37 GiB per
disaggregated worker, and two workers sharing a single GPU need ~74 GiB.

Add runtime GPU memory detection to fall back to TinyLlama with a
smaller config on single-GPU systems with <80 GiB memory. This preserves
the test's cancellation stress-test coverage while fitting within L40S
memory constraints. On H100 or multi-GPU systems, the original
DeepSeek-V3-Lite bf16 model is still used.

Also adds a TinyLlama-compatible disagg config with conservative memory
fractions to prevent KV cache allocation races on shared GPUs, and
removes the test waiver from waives.txt.

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
@trtllm-agent
trtllm-agent force-pushed the repair-bot-bug6105768 branch from d19b782 to f38489b Compare August 5, 2026 08:13
@trtllm-agent
trtllm-agent requested a review from a team as a code owner August 5, 2026 08:13
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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/integration/defs/disaggregated/test_configs/disagg_config_cancel_stress_test_small.yaml`:
- Line 1: Add the repository-standard NVIDIA copyright header at the beginning
of the configuration file before the hostname entry, using 2026 as the latest
meaningful modification year.
🪄 Autofix

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: 1430ad7f-6db5-4ef7-9f0d-00106408abbc

📥 Commits

Reviewing files that changed from the base of the PR and between 975efd3 and f38489b.

📒 Files selected for processing (3)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cancel_stress_test_small.yaml
  • tests/integration/defs/disaggregated/test_disaggregated.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/integration/defs/disaggregated/test_disaggregated.py

@@ -0,0 +1,39 @@
hostname: localhost

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add the required NVIDIA copyright header.

This new file starts with hostname and has no NVIDIA copyright header. Add the repository-standard header before Line 1 and use 2026 as the latest meaningful modification year.

As per coding guidelines, all new files matching **/* must include the NVIDIA copyright header with the year of the latest meaningful modification.

🤖 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/integration/defs/disaggregated/test_configs/disagg_config_cancel_stress_test_small.yaml`
at line 1, Add the repository-standard NVIDIA copyright header at the beginning
of the configuration file before the hostname entry, using 2026 as the latest
meaningful modification year.

Source: Coding guidelines

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