Skip to content

[TRTLLM-15403][fix] VisualGen: warn when a requested attention backend silently falls back to VANILLA - #17698

Merged
chang-l merged 2 commits into
NVIDIA:mainfrom
chang-l:fix/vgoa-attn-backend-fallback-warning
Aug 19, 2026
Merged

[TRTLLM-15403][fix] VisualGen: warn when a requested attention backend silently falls back to VANILLA#17698
chang-l merged 2 commits into
NVIDIA:mainfrom
chang-l:fix/vgoa-attn-backend-fallback-warning

Conversation

@chang-l

@chang-l chang-l commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

[TRTLLM-XXXXX][fix] VisualGen: warn when a requested attention backend silently falls back to VANILLA

Description

Problem

VisualGen attention backend resolution can silently ignore the backend the user requested:

  1. tensorrt_llm/_torch/visual_gen/modules/attention.py — any Attention module constructed
    with qkv_mode=SEPARATE_QKV (cross-attention, and separate-projection joint attention such
    as Qwen-Image's QwenJointAttention or Cosmos3CausalAttention) swaps a requested TRTLLM
    backend — or CUTEDSL with a VSA sparse config — to VANILLA with zero log output.
  2. tensorrt_llm/_torch/visual_gen/models/cosmos3/transformer_cosmos3.py
    Cosmos3CrossAttention swaps a requested TRTLLM backend to VANILLA before calling the
    base constructor, also silently.

A user who sets attention.backend=TRTLLM can end up with every attention module in the
model running VANILLA (torch SDPA) and nothing in the logs saying so. Observed with an internal
study harness (B200, TRT-LLM 1.3.0rc24 container; numbers are from that baseline):

Model Requested backend Actually constructed Log output
Qwen-Image TRTLLM VANILLA on 60/60 joint-attention modules (module census: by_resolved_backend {VANILLA: 60}) none
Cosmos (cosmos3) TRTLLM VANILLA on 128/128 attention modules none

The Cosmos case was initially recorded in a perf study as if TRTLLM had run; the silent
fallback was only caught later by a post-construction module census and invalidated two study
conclusions. The same silent path also blocks CUTEDSL VSA sparse attention on SEPARATE_QKV
models: the sparse config is accepted but every module quietly resolves to dense VANILLA.

The change

Add a logger.warning_once at both fallback sites naming the module class, the requested
backend, and the resolved backend. The warning is keyed on the
(module class, requested, resolved) triple, so each distinct fallback is reported exactly
once per process instead of once per module instance (one line instead of 60 on Qwen-Image).

No behavior change — backend resolution is unchanged; this only makes the existing
fallback visible. Dedup reuses the existing Logger.log_once machinery
(tensorrt_llm/logger.py); no new mechanism or configuration knob is introduced.

Example output (standard [TRT-LLM] [W] warning line):

QwenJointAttention: requested attention backend TRTLLM does not support qkv_mode=SEPARATE_QKV; falling back to VANILLA.

Test Coverage

  • python3 -m py_compile on both touched files.
  • No new behavior to test: backend resolution outcomes are unchanged, only a log line is
    added on paths already exercised by existing unit tests
    (tests/unittest/_torch/visual_gen/test_attention_integration.py,
    tests/unittest/_torch/visual_gen/test_qwen_image_pipeline.py,
    tests/unittest/_torch/visual_gen/test_cosmos3_transformer.py).
  • Warning dedup relies on the existing, already-tested Logger.log_once implementation.

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.

Dev Engineer Review

  • Added deduplicated warnings for unsupported attention backend fallbacks.
  • Covered SEPARATE_QKV modules and Cosmos3 cross-attention.
  • Preserved existing backend resolution behavior.
  • Warnings identify the module class, requested backend, and resolved backend.
  • Syntax checks passed for both modified files.
  • No public API, configuration, or test-list changes were made.

QA Engineer Review

No test changes.

…d silently falls back to VANILLA

VisualGen attention resolution silently swaps a requested TRTLLM (or
CUTEDSL VSA) backend to VANILLA for SEPARATE_QKV modules, and Cosmos3
cross-attention does the same before construction. Add logger.warning_once
at both fallback sites, keyed on (module class, requested, resolved), so
the fallback is visible without per-instance log spam. No behavior change.

Evidence: internal harness (B200, 1.3.0rc24 baseline) — Qwen-Image 60/60 joint-attention modules and cosmos3 128/128 attention modules constructed VANILLA under a TRTLLM request with zero log output.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Chang Liu <9713593+chang-l@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 24dd6c57-cbd2-451c-9c3a-3b763d1f43e0

📥 Commits

Reviewing files that changed from the base of the PR and between 24be2c1 and 2ea2c80.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/visual_gen/models/cosmos3/transformer_cosmos3.py
  • tensorrt_llm/_torch/visual_gen/modules/attention.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tensorrt_llm/_torch/visual_gen/modules/attention.py
  • tensorrt_llm/_torch/visual_gen/models/cosmos3/transformer_cosmos3.py

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


Walkthrough

The changes add deduplicated warnings for unsupported attention backend configurations. The warnings identify the requested backend, resolved VANILLA backend, and relevant attention class or backend combination.

Changes

Attention backend diagnostics

Layer / File(s) Summary
Backend fallback warnings
tensorrt_llm/_torch/visual_gen/modules/attention.py, tensorrt_llm/_torch/visual_gen/models/cosmos3/transformer_cosmos3.py
The attention modules import the TensorRT-LLM logger and emit once-per-configuration warnings when unsupported TRTLLM or CUTEDSL VSA configurations fall back to VANILLA.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 2ea2c

This change only makes existing attention-backend fallbacks visible through deduplicated warnings without changing backend resolution or runtime behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

  • NVIDIA/TensorRT-LLM#17476: Both changes handle unsupported separate-QKV configurations by falling back to the VANILLA backend.

Suggested reviewers: o-stoner, yunruis, luyiyun1021

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the warning added for attention backend fallbacks to VANILLA.
Description check ✅ Passed The description explains the problem, solution, test coverage, unchanged behavior, and checklist items in the required sections.
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.

@chang-l
chang-l requested review from o-stoner and yuxianq August 17, 2026 17:06
@chang-l

chang-l commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67147 [ run ] triggered by Bot. Commit: 258823d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67147 [ run ] completed with state FAILURE. Commit: 258823d
/LLM/main/L0_MergeRequest_PR pipeline #54680 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

@coderabbitai

coderabbitai Bot commented Aug 18, 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.

@chang-l

chang-l commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67191 [ run ] triggered by Bot. Commit: 2ea2c80 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67191 [ run ] completed with state SUCCESS. Commit: 2ea2c80
/LLM/main/L0_MergeRequest_PR pipeline #54721 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Ask a member of NVIDIA/trt-llm-ci-approvers to add the label, then re-trigger CI with the same bot command (no rebase needed).

⚠️ 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

@chang-l

chang-l commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67214 [ run ] triggered by Bot. Commit: 2ea2c80 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67214 [ run ] completed with state FAILURE. Commit: 2ea2c80
/LLM/main/L0_MergeRequest_PR pipeline #54742 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

@chang-l

chang-l commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67281 [ run ] triggered by Bot. Commit: 2ea2c80 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67281 [ run ] completed with state SUCCESS. Commit: 2ea2c80
/LLM/main/L0_MergeRequest_PR pipeline #54808 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

@chang-l

chang-l commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67494 [ run ] triggered by Bot. Commit: 2ea2c80 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67494 [ run ] completed with state SUCCESS. Commit: 2ea2c80
/LLM/main/L0_MergeRequest_PR pipeline #54993 completed with status: 'SUCCESS'

CI Report

Link to invocation

@chang-l
chang-l merged commit 8fc097f into NVIDIA:main Aug 19, 2026
13 checks passed
@github-actions

Copy link
Copy Markdown

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental) --high-priority]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Supports wildcard * for pattern matching (e.g., "*PerfSanity*" matches all stages containing PerfSanity). Examples: "A10-PyTorch-1, xxx", "PerfSanity". The patterns "*", "*Post-Merge*", and "*PerfSanity*", including equivalent escaped or repeated-star forms and their use in comma-separated lists, require the ci: post-merge approved PR label. Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Requires the ci: full pre-merge approved label on the PR (ask a member of NVIDIA/trt-llm-ci-approvers). Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline. Requires the ci: full pre-merge approved label on the PR (ask a member of NVIDIA/trt-llm-ci-approvers).

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline. Requires the ci: post-merge approved PR label applied by an active member of NVIDIA/trt-llm-ci-approvers. The approval label remains in place when new commits are pushed.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Supports wildcard * for pattern matching. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx", --extra-stage "Post-Merge". The patterns "*", "*Post-Merge*", and "*PerfSanity*", including equivalent escaped or repeated-star forms and their use in comma-separated lists, require the ci: post-merge approved PR label.

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

--high-priority (OPTIONAL) : Run the pipeline with high priority. This option is restricted to authorized users only and will route the job to a high-priority queue.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

ishovkun added a commit to ishovkun/TensorRT-LLM that referenced this pull request Aug 22, 2026
Transfer landed on main as a squash (cbc3784), so the conflict set is
the same action-vs-transfer overlap staged earlier on
cosmos3-action-staging; the resolution is taken from there (1e4c1bb286)
with the two hunks transfer gained after that staging base folded in via
a file-level three-way merge (the Cosmos3CrossAttention backend-fallback
warning_once from NVIDIA#17698 and the guardrail early-return fix from NVIDIA#17510).

Resolution summary, argued in full in the staging commit:
- Token layout control|video|action(|audio): transfer prepends control
  tokens, action appends, so the velocity decode reads video at
  T_control..T_control+T_vid_tokens and the extra span starts after it.
  Control latents are mutually exclusive with both audio (transfer's
  guard) and action (added here).
- Kept the per-request cached_freqs_gen_combined mRoPE table for the
  audio branch rather than transfer's per-step rebuild.
- Dropped action's probe_video_dimensions for transfer's
  video_stream_info (a strict superset: same header read also returns
  the frame rate); action_reference_size raises on an unreadable
  container instead of propagating None.
- Action skips the source-following parameter resolution: its frame
  rate is a trained property of the embodiment, not of the reference
  footage.
- Action's scheduler stream joins transfer's `transfer_config is None`
  rebuild guard; the two never arrive together.

Signed-off-by: Igor Shovkun <igshov@gmail.com>
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.

5 participants