Skip to content

[#13858][fix] AutoDeploy fix the piecewise vlm issue - #14006

Merged
nvchenghaoz merged 18 commits into
NVIDIA:mainfrom
nv-auto-deploy:chenghao/piecewise_vlm_0511
Jun 11, 2026
Merged

[#13858][fix] AutoDeploy fix the piecewise vlm issue#14006
nvchenghaoz merged 18 commits into
NVIDIA:mainfrom
nv-auto-deploy:chenghao/piecewise_vlm_0511

Conversation

@nvchenghaoz

@nvchenghaoz nvchenghaoz commented May 11, 2026

Copy link
Copy Markdown
Collaborator

#13858

Enable the piecewise CG by default to see if there are any further errors.

The main fix is to move the Gamma related op to the dynamic split. Also update the kwargs capture to only capture the static related ones..

Summary by CodeRabbit

  • New Features

    • Added support for Gemma4 multimodal mask preparation in CUDA graph compilation.
  • Improvements

    • Optimized buffer allocation for captured graphs to allocate memory only for model parameters actually consumed by compiled submodules, reducing memory overhead.
  • Configuration Changes

    • Enabled piecewise CUDA graph compilation by default.

Review Change Stack

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz
nvchenghaoz requested a review from a team as a code owner May 11, 2026 20:02
@nvchenghaoz
nvchenghaoz requested a review from galagam May 11, 2026 20:02
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1,DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47790 [ run ] triggered by Bot. Commit: 9933fc6 Link to invocation

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR enables piecewise CUDA graph compilation and optimizes static input buffer allocation in PiecewiseCapturedGraph by discovering which model-level kwargs are actually consumed by captured static runners and only allocating buffers for those specific kwargs, narrowing pre-allocation from all unstable kwargs to only those the runners use.

Changes

Static Input Buffer Filtering

Layer / File(s) Summary
Configuration & Operation Registration
tensorrt_llm/_torch/auto_deploy/config/default.yaml, tensorrt_llm/_torch/auto_deploy/compile/piecewise_utils.py
Enable piecewise_enabled in compile config. Register auto_deploy::gemma4_prepare_multimodal_mask as a metadata-prep dynamic op for graph splitting.
Static Runner Input Discovery
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py
New _static_runner_input_names() method collects placeholder input names from each ADPiecewiseRunner's FX graph and returns them as a set.
Buffer Allocation with Input Filtering
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py
Update _allocate_static_input_buffers() to compute the static-runner-consumed input set, early-return if empty, and skip buffering unstable-address kwargs whose keys are not in that set.
Test Infrastructure & Validation
tests/unittest/auto_deploy/singlegpu/compile/test_captured_graph.py, tests/unittest/auto_deploy/singlegpu/compile/test_piecewise_utils.py
Add _add_static_runner_with_inputs() helper to register minimal static runners. Update existing static-buffer test. Add new test verifying dynamic-only kwargs are skipped during allocation/copying. Add copyright update and import extension. Validate gemma4_prepare_multimodal_mask is classified as metadata-prep.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description addresses the main changes but lacks required template sections like Test Coverage and PR Checklist verification, making it incomplete according to the repository template. Add the missing sections: Test Coverage (list relevant tests), and verify the PR Checklist items to meet the repository's contribution requirements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the issue (#13858) and summarizes the fix for the piecewise VLM problem, directly reflecting the main changes in the changeset.
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.

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

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

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms

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.

@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)
tensorrt_llm/_torch/auto_deploy/config/default.yaml (1)

302-308: ⚠️ Potential issue | 🔴 Critical

Enabling prototype piecewise CUDA graphs by default introduces stability and performance risks.

Piecewise CUDA graph support is marked as experimental/prototype in the codebase (commit #11422). The feature has documented issues including severe memory fragmentation in logits (mitigated via warmup requests) and recent bug fixes (nvbugs/5880745 for MoE compatibility, VLM issues). More critically, existing piecewise tests in CI are marked TIMEOUT, indicating correctness or performance problems that will now affect all deployments by default.

Before enabling this as the default, consider:

  • Piecewise support should remain opt-in until production-ready status
  • Investigate why existing piecewise tests timeout under B200 hardware
  • Validate that memory fragmentation mitigations work correctly across batch sizes
  • Add performance regression gates to prevent silent degradation
🤖 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 `@tensorrt_llm/_torch/auto_deploy/config/default.yaml` around lines 302 - 308,
The default config enables the experimental piecewise CUDA graphs
(compile_model.piecewise_enabled: true), which is unstable; change the default
to opt-in by setting compile_model.piecewise_enabled to false and leave
piecewise_num_tokens as null, update any related documentation or comments near
the compile_model block to indicate the feature is experimental and how to
enable it, and ensure any CI or deployment gating checks reference this opt-in
flag so piecewise remains disabled unless explicitly turned on.
🤖 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 `@tensorrt_llm/_torch/auto_deploy/config/default.yaml`:
- Around line 302-308: The default config enables the experimental piecewise
CUDA graphs (compile_model.piecewise_enabled: true), which is unstable; change
the default to opt-in by setting compile_model.piecewise_enabled to false and
leave piecewise_num_tokens as null, update any related documentation or comments
near the compile_model block to indicate the feature is experimental and how to
enable it, and ensure any CI or deployment gating checks reference this opt-in
flag so piecewise remains disabled unless explicitly turned on.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2769bebe-0b71-4a4b-845e-7c676fcb7625

📥 Commits

Reviewing files that changed from the base of the PR and between e197b69 and 9933fc6.

📒 Files selected for processing (5)
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py
  • tensorrt_llm/_torch/auto_deploy/compile/piecewise_utils.py
  • tensorrt_llm/_torch/auto_deploy/config/default.yaml
  • tests/unittest/auto_deploy/singlegpu/compile/test_captured_graph.py
  • tests/unittest/auto_deploy/singlegpu/compile/test_piecewise_utils.py

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47790 [ run ] completed with state SUCCESS. Commit: 9933fc6
/LLM/main/L0_MergeRequest_PR pipeline #37681 (Partly Tested) 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: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47803 [ run ] triggered by Bot. Commit: 5609e4a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47803 [ run ] completed with state SUCCESS. Commit: 5609e4a
/LLM/main/L0_MergeRequest_PR pipeline #37696 (Partly Tested) 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

@suyoggupta

Copy link
Copy Markdown
Collaborator

…m_0511

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>

# Conflicts:
#	tensorrt_llm/_torch/auto_deploy/compile/piecewise_utils.py
#	tests/unittest/auto_deploy/singlegpu/compile/test_piecewise_utils.py
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #48948 [ run ] triggered by Bot. Commit: 3e8c0e0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #48948 [ run ] completed with state FAILURE. Commit: 3e8c0e0
/LLM/main/L0_MergeRequest_PR pipeline #38694 (Partly Tested) 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

@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #48963 [ run ] triggered by Bot. Commit: 3e8c0e0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #48963 [ run ] completed with state SUCCESS. Commit: 3e8c0e0
/LLM/main/L0_MergeRequest_PR pipeline #38708 (Partly Tested) 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

…m_0511

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
…o chenghao/piecewise_vlm_0511

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49979 [ run ] triggered by Bot. Commit: f408561 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49979 [ run ] completed with state FAILURE. Commit: f408561
/LLM/main/L0_MergeRequest_PR pipeline #39545 (Partly Tested) 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: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz
nvchenghaoz requested a review from a team as a code owner May 23, 2026 02:36
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" --disable-fail-fast

This reverts commit a75a643.

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51385 [ run ] triggered by Bot. Commit: bfb4f70 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51385 [ run ] completed with state FAILURE. Commit: bfb4f70
/LLM/main/L0_MergeRequest_PR pipeline #40798 (Partly Tested) 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

Link to invocation

@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51431 [ run ] triggered by Bot. Commit: bfb4f70 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51431 [ run ] completed with state SUCCESS. Commit: bfb4f70
/LLM/main/L0_MergeRequest_PR pipeline #40841 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

…m_0511

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>

# Conflicts:
#	tensorrt_llm/_torch/auto_deploy/compile/piecewise_utils.py
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-Build_Docs, A10-PackageSanityCheck-PY310-UB2204, A100X-PackageSanityCheck-PY312-UB2404, A30-AutoDeploy-1, H100_PCIe-AutoDeploy-1, DGX_B200-AutoDeploy-1, A100X-PyTorch-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1, DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51643 [ run ] triggered by Bot. Commit: cae8c0f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51643 [ run ] completed with state SUCCESS. Commit: cae8c0f
/LLM/main/L0_MergeRequest_PR pipeline #41030 (Partly Tested) 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: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53368 [ run ] triggered by Bot. Commit: 02d625e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53368 [ run ] completed with state FAILURE. Commit: 02d625e
/LLM/main/L0_MergeRequest_PR pipeline #42546 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: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53376 [ run ] triggered by Bot. Commit: 4b38a4d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53376 [ run ] completed with state FAILURE. Commit: 4b38a4d
/LLM/main/L0_MergeRequest_PR pipeline #42553 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

@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53466 [ run ] triggered by Bot. Commit: 4b38a4d Link to invocation

@nvchenghaoz
nvchenghaoz enabled auto-merge (squash) June 11, 2026 04:20
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53466 [ run ] completed with state SUCCESS. Commit: 4b38a4d
/LLM/main/L0_MergeRequest_PR pipeline #42631 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

@nvchenghaoz

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53612 [ run ] triggered by Bot. Commit: 4b38a4d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53612 [ run ] completed with state SUCCESS. Commit: 4b38a4d
/LLM/main/L0_MergeRequest_PR pipeline #42759 completed with status: 'SUCCESS'

CI Report

Link to invocation

@nvchenghaoz
nvchenghaoz merged commit 19b5d0e into NVIDIA:main Jun 11, 2026
8 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.

4 participants