Skip to content

[None][refactor] visual_gen Attention: drop redundant enable_ulysses kwarg (rebase artifact from #13978)#15141

Merged
luyiyun1021 merged 1 commit into
NVIDIA:mainfrom
luyiyun1021:dev/drop-enable-ulysses-kwarg
Jun 11, 2026
Merged

[None][refactor] visual_gen Attention: drop redundant enable_ulysses kwarg (rebase artifact from #13978)#15141
luyiyun1021 merged 1 commit into
NVIDIA:mainfrom
luyiyun1021:dev/drop-enable-ulysses-kwarg

Conversation

@luyiyun1021

@luyiyun1021 luyiyun1021 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai summary

Description

The enable_ulysses kwarg on Attention.__init__ is a rebase artifact from #13978. Before that PR merged, #13944 (Attention2D) had already consolidated the kwarg surface to a single enable_sequence_parallel master switch — the rebase resolution re-introduced the older enable_ulysses as a redundant gate.

Only LTX2Attention forwarded enable_ulysses=use_ulysses, and it always co-varied with enable_sequence_parallel (self-attn: both True; cross-attn: both False). No model uses the SP-on-but-Ulysses-off escape hatch.

  • Drop enable_ulysses kwarg from base Attention.__init__.
  • Simplify the use_ulysses local-var gate (remove and enable_ulysses).
  • Drop the enable_ulysses=use_ulysses forwarding from LTX2Attention.__init__.

LTX2Attention's own use_ulysses kwarg is preserved — it still drives async_ulysses gating and the audio dual-attention setup, both LTX-local logic.

Test Coverage

tests/unittest/_torch/visual_gen/test_ltx2_attention.py (6/6) + test_ltx2_transformer.py (14/14) — covered by existing tests.

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.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@luyiyun1021
luyiyun1021 requested review from a team as code owners June 9, 2026 05:16
@luyiyun1021
luyiyun1021 requested a review from yuxianq June 9, 2026 05:16
@luyiyun1021

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@luyiyun1021
luyiyun1021 requested a review from NVShreyas June 9, 2026 05:21
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52965 [ run ] triggered by Bot. Commit: 2a28cf0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52965 [ run ] completed with state FAILURE. Commit: 2a28cf0

Link to invocation

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR refactors Ulysses-parallel-attention gating in the visual generation modules. The enable_ulysses parameter is removed from Attention.__init__, and Ulysses behavior is now controlled solely through enable_sequence_parallel alongside existing ulysses_size and async_ulysses conditions. The LTX2Attention call site is updated to match this contract change.

Changes

Ulysses Gating Refactoring

Layer / File(s) Summary
Attention module Ulysses control refactoring
tensorrt_llm/_torch/visual_gen/modules/attention.py
Attention.__init__ signature removes the enable_ulysses parameter. The use_ulysses eligibility logic is updated to gate Ulysses behavior by enable_sequence_parallel instead, while preserving ulysses_size > 1 and QKV-mode/async_ulysses constraints.
LTX2 attention initialization update
tensorrt_llm/_torch/visual_gen/models/ltx2/transformer_ltx2.py
LTX2Attention.__init__ removes enable_ulysses=use_ulysses from the parent Attention constructor call and passes enable_sequence_parallel=enable_sp and async_ulysses=self._use_async_ulysses to match the updated contract.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#13978: Refactors Attention.__init__ to remove enable_ulysses and consolidate Ulysses control around enable_sequence_parallel, with async_ulysses as the knob for async Ulysses pipeline optimization in LTX2.

Suggested labels

VisualGen

Suggested reviewers

  • chang-l
  • yizhang-nv
  • zhenhuaw-me
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: removing a redundant enable_ulysses parameter from the Attention class as a rebase cleanup artifact.
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.
Description check ✅ Passed PR description is comprehensive, explains the rebase artifact issue, provides clear rationale for changes, and includes test coverage details and checklist confirmation.

✏️ 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.

@luyiyun1021

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52970 [ run ] triggered by Bot. Commit: 2a28cf0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@NVShreyas

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53079 [ run ] triggered by Bot. Commit: 2a28cf0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

…kwarg

The enable_ulysses kwarg was a rebase artifact in PR NVIDIA#13978. Before that PR merged, base Attention had only enable_sequence_parallel as the single sequence-parallel master switch (Attention2D PR NVIDIA#13944 had already consolidated the kwarg surface). NVIDIA#13978's rebase resolution kept the older enable_ulysses kwarg in a union with enable_sequence_parallel, re-introducing the redundant gate.

Only LTX2Attention explicitly forwarded enable_ulysses=use_ulysses, and it always co-varied with enable_sequence_parallel (line 591 self-attn: both True; line 605 cross-attn: both False). No model uses the SP-on-but-Ulysses-off escape hatch the kwarg notionally provided.

Changes:

- Drop enable_ulysses kwarg from base Attention.__init__.

- Simplify the use_ulysses local: gate on (ulysses_size > 1 and enable_sequence_parallel and (qkv_mode != SEPARATE_QKV or async_ulysses)).

- Drop the enable_ulysses=use_ulysses forwarding from LTX2Attention.__init__.

LTX2Attention's own use_ulysses kwarg is preserved -- it still drives async_ulysses gating (line 109) and the audio dual-attn (_has_dual_attn) setup (line 176) independent of the base. Verified locally: 6/6 test_ltx2_attention.py + 14/14 test_ltx2_transformer.py pass on the parent k_pe-drop branch which carries the same Attention surface.

Signed-off-by: Yiyun Lu <55233584+luyiyun1021@users.noreply.github.com>
@luyiyun1021
luyiyun1021 force-pushed the dev/drop-enable-ulysses-kwarg branch from 2a28cf0 to 33f449a Compare June 10, 2026 04:02
@luyiyun1021

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53222 [ run ] triggered by Bot. Commit: 33f449a Link to invocation

@luyiyun1021
luyiyun1021 enabled auto-merge (squash) June 10, 2026 11:13
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53222 [ run ] completed with state SUCCESS. Commit: 33f449a
/LLM/main/L0_MergeRequest_PR pipeline #42417 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

@NVShreyas

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

1 similar comment
@NVShreyas

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53361 [ run ] triggered by Bot. Commit: 33f449a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53361 [ run ] completed with state FAILURE. Commit: 33f449a
/LLM/main/L0_MergeRequest_PR pipeline #42540 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

@NVShreyas

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53603 [ run ] triggered by Bot. Commit: 33f449a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53603 [ run ] completed with state SUCCESS. Commit: 33f449a
/LLM/main/L0_MergeRequest_PR pipeline #42749 completed with status: 'SUCCESS'

CI Report

Link to invocation

@luyiyun1021
luyiyun1021 merged commit 80f18fe 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.

5 participants