Skip to content

[TRTLLM-11320][refactor] Refactor VisualGenArgs API and registry - #14175

Merged
zhenhuaw-me merged 2 commits into
NVIDIA:mainfrom
zhenhuaw-me:update-api-step5
May 22, 2026
Merged

[TRTLLM-11320][refactor] Refactor VisualGenArgs API and registry#14175
zhenhuaw-me merged 2 commits into
NVIDIA:mainfrom
zhenhuaw-me:update-api-step5

Conversation

@zhenhuaw-me

@zhenhuaw-me zhenhuaw-me commented May 15, 2026

Copy link
Copy Markdown
Member

Description

Refactor the VisualGen public API surface (TRTLLM-11320 and follow-up cleanups) so the schema, sub-config naming, pipeline registry, and CLI flags are validated in one place.

  • Move VisualGenArgs and its sub-configs to tensorrt_llm.visual_gen.args. Rename master switches to drop class-name prefixes (dit_cfg_sizecfg_size, …) and add _config suffixes to sub-config attributes (attentionattention_config, …).
  • Clean up the schema: replace flat skip_warmup / skip_components with CompilationConfig.skip_warmup and component-level controls; resolve quant lazily in PipelineLoader; reshape SageAttentionConfig into a recipe-based QuantAttentionConfig validated centrally.
  • Add a per-family pipeline registry, exposed via VisualGen.supported_models() / VisualGen.pipeline_config(model) and validated at load time. LTX-2 paths now live inside pipeline_config.
  • Add --visual_gen_args on trtllm-serve / trtllm-bench, with --extra_visual_gen_options retained as a back-compat alias.

Example YAML configs and example scripts are updated to the new names.

Test Coverage

VisualGen unit suites under tests/unittest/_torch/visual_gen/ (args, loader, pipeline, transformer, attention, per-model) and integration tests (tests/integration/defs/examples/test_visual_gen.py, tests/integration/defs/perf/test_visual_gen_perf_sanity.py) are updated to the new schema. Verified on GB200.

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.

Summary by CodeRabbit

Release Notes

  • Configuration Schema Updates

    • Consolidated visual generation configuration structure with renamed sections (attention_config, parallel_config, cache_config, cuda_graph_config)
    • Standardized parallelism field names (cfg_size, ulysses_size replacing dit_cfg_size, dit_ulysses_size)
  • CLI Updates

    • Renamed command-line argument from --extra_visual_gen_options to --visual_gen_args for model serving
    • Updated documentation examples to reflect new configuration schema

Review Change Stack

@zhenhuaw-me zhenhuaw-me added breaking-api-change When the PR breaks backwards compatibility VisualGen labels May 15, 2026
@zhenhuaw-me zhenhuaw-me changed the title [TRTLLM-11320][refactor][BREAKING] Refactor VisualGenArgs and registry [TRTLLM-11320][refactor] Refactor VisualGenArgs and registry May 15, 2026
@zhenhuaw-me zhenhuaw-me removed the breaking-api-change When the PR breaks backwards compatibility label May 15, 2026
@zhenhuaw-me zhenhuaw-me added breaking-api-change When the PR breaks backwards compatibility and removed breaking-api-change When the PR breaks backwards compatibility labels May 15, 2026
zhenhuaw-me added a commit to zhenhuaw-me/TensorRT-LLM that referenced this pull request May 15, 2026
…efactor

Apply the agreed code changes from review feedback on PR NVIDIA#14175.

Public API renames:
- VisualGenArgs.checkpoint_path -> VisualGenArgs.model (field + all
  callsites + YAML keys + test/example fixtures + docs).
- diffusion_args -> visual_gen_args across executor.py, serve.py,
  visual_gen.py, bench/benchmark/visual_gen.py, examples, and tests.
- --visual_gen_args flag dest renamed to visual_gen_args (Python identifier);
  --extra_visual_gen_options stays as a CLI alias only.

Schema cleanup:
- Remove runtime state fields (ret_steps, cutoff_steps, num_steps, _cnt)
  from TeaCacheConfig. TeaCacheBackend now owns warmup/cutoff bounds on
  the TeaCacheHook instance and derives them per-generation from
  num_inference_steps in refresh().
- ParallelConfig docstring trimmed; per-field description text now carries
  the per-axis semantics (cfg_size / ulysses_size / attn2d_size) directly.
- CompilationConfig docstring trimmed; quant_config gets a description=.

Pipeline registry updates:
- LTX2Pipeline.hf_ids: Lightricks/LTX-Video -> Lightricks/LTX-2.
- LTX2Pipeline.defaults: only text_encoder_path (default google/gemma-3-12b-it).
- LTX2TwoStagesPipeline now registers its own hf_ids + defaults
  (text_encoder_path + spatial_upsampler_path=None + distilled_lora_path=None);
  docstring describes stage 1 / stage 2 directly.
- WanPipeline / WanImageToVideoPipeline doc strings normalized.

Internal config module:
- tensorrt_llm._torch.visual_gen.config no longer re-exports public
  config classes through __all__; internal callers now import
  VisualGenArgs, PipelineComponent, AttentionConfig, SageAttentionConfig,
  and TeaCacheConfig from tensorrt_llm.visual_gen.args directly.
- examples/visual_gen/serve/configs/ltx2.yml: drop pipeline_config block
  (the path now defaults from the registry entry).

PipelineLoader hardening:
- PipelineLoader(args, ...) now requires args; the optional/None branch
  was unused in production (executor always passes a real instance).

Comment scrub:
- Repo-wide: drop §13.x / §7.5 / §13.1 / Pre-AC-N references and
  "previously X / kept for one release / legacy alias" framing across
  files touched by this PR.

Signed-off-by: Zhenhua Wang <zhenhuaw@nvidia.com>
@zhenhuaw-me zhenhuaw-me changed the title [TRTLLM-11320][refactor] Refactor VisualGenArgs and registry [TRTLLM-11320][refactor] Refactor VisualGenArgs API and registry May 15, 2026
@zhenhuaw-me
zhenhuaw-me force-pushed the update-api-step5 branch 2 times, most recently from e0448d0 to b8d8a6f Compare May 19, 2026 14:45
@zhenhuaw-me
zhenhuaw-me marked this pull request as ready for review May 19, 2026 14:46
@zhenhuaw-me
zhenhuaw-me requested review from a team as code owners May 19, 2026 14:46
Comment thread examples/visual_gen/serve/configs/ltx2.yml
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Migrates VisualGen to a new public Pydantic args schema (VisualGenArgs), rewires pipeline loading/registry and DiffusionModelConfig, renames Sage attention configs to quantized QuantAttentionConfig, updates CLI/bench/serve flags and YAML schema, adjusts TeaCache behavior, updates examples, pipelines, and extensive tests.

Changes

VisualGen public args API, loaders, attention, and ecosystem updates

Layer / File(s) Summary
Public VisualGen args API and VisualGen class additions
tensorrt_llm/visual_gen/args.py, tensorrt_llm/visual_gen/__init__.py, tensorrt_llm/visual_gen/visual_gen.py, docs/source/models/visual-generation.md
Defines Pydantic VisualGenArgs and sub-configs, expands package exports, adds VisualGen.supported_models/pipeline_config, and updates docs/examples to use model=.
*Configs & CLI: rename to _config and flag wiring
examples/visual_gen/configs/*.yaml, examples/visual_gen/serve/configs/*.yml, examples/visual_gen/models/wan_t2v.py, tensorrt_llm/bench/benchmark/visual_gen.py, tensorrt_llm/commands/serve.py, tensorrt_llm/serve/scripts/benchmark_visual_gen.py
Renames top-level YAML sections to *_config (attention_config/parallel_config/cache_config/cuda_graph_config), renames dit_*cfg_size/ulysses_size, replaces --extra_visual_gen_options with --visual_gen_args (alias preserved), and updates CLI/bench/serve wiring.
Public args & model config consolidation
tensorrt_llm/_torch/visual_gen/config.py, tensorrt_llm/_torch/visual_gen/executor.py
DiffusionModelConfig replaces typed pipeline with pipeline_config: Dict[str, Any], adds enable_layerwise_nvtx_marker, and from_pretrained() accepts new *_config attributes; executor/API now use visual_gen_args.
PipelineLoader & Registry overhaul
tensorrt_llm/_torch/visual_gen/pipeline_loader.py, tensorrt_llm/_torch/visual_gen/pipeline_registry.py, tensorrt_llm/_torch/visual_gen/pipeline.py
Adds PipelineComponent enum, requires VisualGenArgs at loader construction, validates/merges pipeline_config via registry defaults, moves skip-components to TLLM_VG_SKIP_COMP env, and enriches registry entries and register_pipeline decorator.
Attention backend: Sage → QuantAttentionConfig
tensorrt_llm/_torch/visual_gen/attention_backend/trtllm.py, tensorrt_llm/_torch/visual_gen/attention_backend/utils.py, tests under tests/unittest/_torch/visual_gen/*_attention*
Replaces sage_attention_config with quant_attention_config/QuantAttentionConfig across backend and tests; forward path and kernel params now use quant config fields and dtype.
TeaCache warmup/cutoff and weight loader import fix
tensorrt_llm/_torch/visual_gen/cache/teacache.py, tensorrt_llm/_torch/visual_gen/checkpoints/weight_loader.py
TeaCacheHook stores per-generation ret_steps/cutoff_steps on the hook instance derived in backend.refresh; weight_loader imports PipelineComponent from pipeline_loader.
Model pipelines metadata and gating updates
tensorrt_llm/_torch/visual_gen/models/*, tensorrt_llm/_torch/visual_gen/mapping.py
Adds pipeline registration metadata (hf_ids, defaults, doc), updates error messages to reference cfg_size/ulysses_size, and uses model_config.cuda_graph.enable / model_config.torch_compile.enable for gating.
Examples and example scripts refactored
examples/visual_gen/*.py, examples/visual_gen/serve/benchmark_visual_gen_mgmn_distributed.sh
Example launchers and helper scripts updated to construct VisualGenArgs with model=..., pipe args=visual_gen_args, and switch Sage attention wiring to quant_attention_config; script docs updated to cfg_size * ulysses_size.
Tests, fixtures, and perf tooling alignment
tests/**/visual_gen/**, tests/integration/**, tests/scripts/perf-sanity/**
Extensive test updates to import and construct using tensorrt_llm.visual_gen.args types, switch YAML keys to nested *_config schema, add autouse fixtures for env-based component skipping, and adjust perf/benchmark code to use visual_gen_args paths.
_torch package internal exports cleanup
tensorrt_llm/_torch/visual_gen/__init__.py
Narrows re-exports in the internal package, delegating public config types to tensorrt_llm.visual_gen.args.

Estimated code review effort
🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#13570: Touches the TRTLLM attention backend and Sage/quant attention plumbing; overlaps attention-config changes here.
  • NVIDIA/TensorRT-LLM#12548: Modifies Cache-DiT/TeaCache wiring in example scripts—related to the cache-config/API updates in this PR.

Suggested reviewers

  • laikhtewari
  • chang-l
  • QiJune
  • Shixiaowei02
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@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: 20

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
tests/integration/defs/perf/README_test_visual_gen_perf_sanity.md (1)

141-145: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update remaining stale server_config.parallel references to server_config.parallel_config.

The README still has two old-key references, which conflicts with the refactored schema and can cause invalid config authoring.

Suggested patch
-- `hardware.gpus_per_node` must match the GPU count derived from
-  `server_config.parallel`
+- `hardware.gpus_per_node` must match the GPU count derived from
+  `server_config.parallel_config`
...
-3. **Verify `hardware.gpus_per_node`** matches the GPU count implied by
-   `server_config.parallel` (cfg × ulysses).
+3. **Verify `hardware.gpus_per_node`** matches the GPU count implied by
+   `server_config.parallel_config` (cfg × ulysses).

Also applies to: 236-238

🤖 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/perf/README_test_visual_gen_perf_sanity.md` around
lines 141 - 145, The README references the old key server_config.parallel;
update those occurrences to server_config.parallel_config (including the block
mentioning visual_gen_args_path merging and the note about
hardware.gpus_per_node matching GPU counts derived from server_config.parallel),
and ensure any guidance that derives GPU counts or examples use
server_config.parallel_config; also confirm the note about
client_configs[].generation_mode remains accurate after the key rename.
tensorrt_llm/serve/scripts/benchmark_visual_gen.py (1)

573-579: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale CLI help text to the new flag name.

The --num-gpus help still says the value is inferred from --extra-visual-gen-options; it should reference --visual-gen-args to match the renamed argument.

Suggested fix
     parser.add_argument(
         "--num-gpus",
         type=int,
         default=None,
         help="Number of GPUs used by the server. Overrides the value inferred "
-        "from --extra-visual-gen-options. Defaults to 1 if neither is given.",
+        "from --visual-gen-args. Defaults to 1 if neither is given.",
     )
🤖 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/serve/scripts/benchmark_visual_gen.py` around lines 573 - 579,
Update the stale help string for the parser.add_argument call that defines the
"--num-gpus" option: change the reference from "--extra-visual-gen-options" to
the new flag name "--visual-gen-args" so the help text correctly matches the
renamed argument (look for the parser.add_argument(... "--num-gpus" ...) entry
and edit its help parameter).
tests/unittest/_torch/visual_gen/test_wan21_i2v_pipeline.py (1)

269-275: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use checkpoint_path= when calling _assert_pipeline_matches_hf().

The helper still accepts checkpoint_path, so this renamed keyword now raises TypeError instead of running the correctness check.

💡 Proposed fix
         _assert_pipeline_matches_hf(
-            model=WAN21_I2V_480P_PATH,
+            checkpoint_path=WAN21_I2V_480P_PATH,
             height=480,
             width=832,
             num_frames=33,
             guidance_scale=5.0,
             model_label="Wan2.1-I2V-14B-480P",
🤖 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/unittest/_torch/visual_gen/test_wan21_i2v_pipeline.py` around lines 269
- 275, Call the helper with the renamed keyword by replacing the model= argument
with checkpoint_path= when invoking _assert_pipeline_matches_hf; specifically
change the call that currently passes model=WAN21_I2V_480P_PATH to
checkpoint_path=WAN21_I2V_480P_PATH (keeping the other args height, width,
num_frames, guidance_scale, model_label unchanged) so the helper receives the
expected parameter name.
tests/unittest/_torch/visual_gen/test_attention_perf.py (1)

201-205: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

uses_sage is only checking requested config, not the executed kernel path.

TrtllmAttention now carries quant_attention_config, so this helper returns True even if runtime dispatch falls back to plain TRTLLM attention. The new assertions can therefore pass without actually covering SageAttention execution. Please assert on an observable execution signal instead (e.g. backend instrumentation/counters or a mocked dispatch point), not on the presence of the config field. Based on learnings: do not expect public LLM/attention object attributes to reveal which path executed; if a test needs to prove a specific path ran, it needs production-side instrumentation or another observable signal.

Also applies to: 447-449, 960-962, 989-990, 1030-1031

🤖 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/unittest/_torch/visual_gen/test_attention_perf.py` around lines 201 -
205, The helper _is_sage_attention_enabled currently checks only for the
presence of quant_attention_config on the attention object which can be set even
when runtime dispatch falls back to non-Sage code; change the test to assert an
observable execution signal instead: update _is_sage_attention_enabled (and the
similar checks at the other locations) to verify a production-side
instrumentation point or mockable dispatch hook (e.g., incremented counter,
telemetry flag, or a mocked TrtllmAttention.dispatch/choose_kernel call) that is
set when SageAttention actually runs; locate the runtime dispatch in
TrtllmAttention (or the backend dispatch function) and either read a
runtime-executed counter/flag exposed by that component or patch the dispatch to
set a test-only marker, and have the helper return True only if that runtime
marker was observed.
tests/unittest/_torch/visual_gen/test_wan21_t2v_pipeline.py (1)

286-297: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

This autouse env override breaks the full-pipeline tests and misses the cached fixtures.

The module now mixes full-pipeline tests with transformer-only fixtures, but this function-scoped autouse fixture sets TLLM_VG_SKIP_COMP for every test. That can make the correctness/batch tests load incomplete pipelines, while the module/class-scoped transformer fixtures are created before the env override is applied. Please make skipping explicit on the transformer-only fixtures (or split them into a separate module) instead of using a global function-scoped autouse.

Also applies to: 393-399, 413-446

🤖 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/unittest/_torch/visual_gen/test_wan21_t2v_pipeline.py` around lines 286
- 297, The autouse function-scoped fixture that sets the TLLM_VG_SKIP_COMP env
var is globally affecting tests (including wan21_full_pipeline) and breaking
full-pipeline caching; remove or disable the global autouse behavior and instead
apply the skip logic only to transformer-only fixtures: delete autouse=True from
the env-override fixture (or change its scope to module/class and limit its
import), and add explicit skip/conditional checks (pytest.skip or
pytest.mark.skipif tied to TLLM_VG_SKIP_COMP) on the transformer-only fixtures
or move those fixtures into a separate module; ensure wan21_full_pipeline and
other full-pipeline fixtures (e.g., wan21_full_pipeline) are not subject to the
env override so they load the complete pipeline.
🧹 Nitpick comments (2)
tensorrt_llm/_torch/visual_gen/attention_backend/trtllm.py (1)

289-292: ⚡ Quick win

Replace assertion with explicit runtime validation.

This guard should raise a real exception instead of using assert, so behavior is preserved in optimized runs.

Proposed fix
-        if self.quant_attention_config is not None:
-            assert k is not None and v is not None, (
-                "SageAttention requires separate Q, K, V tensors"
-            )
+        if self.quant_attention_config is not None:
+            if k is None or v is None:
+                raise ValueError("SageAttention requires separate Q, K, V tensors")
As per coding guidelines: use exceptions for error handling, not assertions.
🤖 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/visual_gen/attention_backend/trtllm.py` around lines 289
- 292, The current guard uses an assert to check that k and v are present when
self.quant_attention_config is not None; replace the assert in the
SageAttention-related code with an explicit runtime exception (e.g., raise
ValueError or RuntimeError) that includes a clear message like "SageAttention
requires separate Q, K, V tensors" so the check still triggers in
optimized/production runs; update the block around self.quant_attention_config,
k, and v in trtllm.py to raise the exception instead of using assert.
tests/integration/defs/visual_gen/test_visual_gen_benchmark.py (1)

193-325: QA list updates appear unnecessary for this integration-test edit.

This updates existing VisualGen benchmark test wiring/flags but does not introduce a new integration test definition that needs scheduling-list onboarding.

As per coding guidelines: if integration tests under tests/integration/defs/ are changed, explicitly call out whether QA list updates are needed.

🤖 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/visual_gen/test_visual_gen_benchmark.py` around lines
193 - 325, The PR changed integration tests under
tests/integration/defs/visual_gen (functions test_online_benchmark and
test_offline_benchmark) but the reviewer noted QA list updates are unnecessary;
update the PR by adding a brief note to the commit message or PR description
stating that these edits only adjust existing benchmark wiring/flags and do not
add new integration tests so no QA scheduling-list changes are required
(alternatively add a single-line comment in the test file near
test_online_benchmark/test_offline_benchmark indicating "No QA list update
required — only wiring/flag changes").
🤖 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 `@examples/visual_gen/visual_gen_wan_i2v.py`:
- Around line 331-339: When args.enable_sage_attention is set, ensure we fail
fast if the current backend is not TRTLLM: add a check before computing
k_block_size (use the same location where _wan_needs_fine_grained_sage is
called) that verifies the backend type (e.g., inspect args.backend or the
runtime backend variable) and raise/exit with a clear error or logger.error if
it's not "trtllm"; only proceed to set attention_cfg["quant_attention_config"]
and call logger.info when the backend is TRTLLM. Reference symbols:
args.enable_sage_attention, _wan_needs_fine_grained_sage, attention_cfg, and
logger.info.

In `@examples/visual_gen/visual_gen_wan_t2v.py`:
- Around line 345-354: When args.enable_sage_attention is true, ensure the
attention backend is TRTLLM before configuring SageAttention: check
args.attention_backend (or the variable holding the backend) and if it is not
"TRTLLM" set it to "TRTLLM" (or raise/exit if you prefer strict behavior), then
proceed to compute k_block_size with _wan_needs_fine_grained_sage and populate
attention_cfg and logger.info as currently done; this guarantees SageAttention
only runs with the TRTLLM backend and avoids misleading logs.

In `@tensorrt_llm/_torch/visual_gen/__init__.py`:
- Around line 11-23: The file imports AttentionConfig and
discover_pipeline_components but doesn't use or re-export them; either remove
those two imports to fix the F401 lint, or explicitly include them in the
module's public surface by adding their names to __all__ so they become
documented re-exports. Locate the import list (contains VisualGenArgs,
TeaCacheConfig, etc.) and either delete AttentionConfig and
discover_pipeline_components from that list, or update the module's __all__ to
include "AttentionConfig" and "discover_pipeline_components" alongside existing
public symbols like "VisualGenMapping" and "VisualGenArgs" to resolve the
mismatch.

In `@tensorrt_llm/_torch/visual_gen/models/flux/pipeline_flux.py`:
- Around line 43-47: The registry for FluxPipeline only lists
"black-forest-labs/FLUX.1-dev" in the register_pipeline decorator's hf_ids,
which can cause strict resolver failures for the schnell variant; update the
hf_ids list on the `@register_pipeline` for "FluxPipeline" to include
"black-forest-labs/FLUX.1-schnell" (and any other FLUX.1 family variants you
want supported) so the pipeline resolves for schnell builds—modify the hf_ids
parameter in the register_pipeline decorator that registers FluxPipeline
accordingly.

In `@tensorrt_llm/_torch/visual_gen/models/ltx2/pipeline_ltx2_two_stages.py`:
- Around line 583-595: The decorator on LTX2TwoStagesPipeline registers HF IDs
that duplicate those already used by LTX2Pipeline, causing duplicates in
VisualGen.supported_models() and ambiguous pipeline_config lookups; remove the
conflicting entries from the register_pipeline call on the LTX2TwoStagesPipeline
(i.e., update the hf_ids argument for the decorator on the LTX2TwoStagesPipeline
class) so it does not include "Lightricks/LTX-2" or
"Lightricks/LTX-Video-13B-Distilled" (keep only unique IDs or leave hf_ids
empty), ensuring the two-stage pipeline is registered with distinct identifiers
while preserving the defaults and doc strings already present in the decorator.

In `@tensorrt_llm/_torch/visual_gen/models/ltx2/pipeline_ltx2.py`:
- Around line 707-708: The error message raised in the LTX-2 pipeline guard
references the old "SageAttention" name but the guard checks attn_cfg and its
"quant_attention_config" attribute; update the NotImplementedError text in the
block that checks attn_cfg and getattr(attn_cfg, "quant_attention_config", None)
to mention "quant_attention_config (quantized attention)" or similar accurate
term and reference the LTX-2 pipeline so the message aligns with the renamed
config and helps debugging.

In `@tensorrt_llm/_torch/visual_gen/pipeline_loader.py`:
- Around line 88-93: PipelineLoader accepts an explicit device via self.device
but the code that materializes meta tensors uses a hardcoded "cuda" device;
update all tensor allocations inside the PipelineLoader class that currently
pass device="cuda" (e.g., calls to torch.empty_strided, torch.empty,
torch.zeros_like, torch.tensor(..., device="cuda") or similar) to use
device=self.device (or device=str(self.device) where a string is required) so
meta tensors are created on the configured device; search for allocations in
PipelineLoader (including the meta-tensor materialization logic referenced near
the later allocation block) and replace "cuda" with self.device consistently.

In `@tensorrt_llm/commands/serve.py`:
- Around line 1049-1057: In _serve_visual_gen(), the local assignment to
visual_gen_args shadows the outer variable so the RHS reads an uninitialized
local and raises UnboundLocalError; rename the parsed result (e.g.,
parsed_visual_gen_args) and use that when calling launch_visual_gen_server,
i.e., call VisualGenArgs.from_yaml(visual_gen_args) into parsed_visual_gen_args
(if visual_gen_args is not None else None) and pass parsed_visual_gen_args to
launch_visual_gen_server; keep the metadata_server_cfg logic using
parse_metadata_server_config_file(metadata_server_config_file) unchanged.

In `@tensorrt_llm/visual_gen/__init__.py`:
- Around line 22-23: Update the module docstring/comments that claim QuantConfig
is re-exported from tensorrt_llm.llmapi to reflect the actual source import
(tensorrt_llm.models.modeling_utils); locate mentions in __init__.py (the lines
around the existing docstring and the other occurrence at the later doc block
near lines 62-63) and change the referenced module name to
tensorrt_llm.models.modeling_utils so the comment matches the actual import of
QuantConfig.

In `@tensorrt_llm/visual_gen/args.py`:
- Around line 518-531: The from_yaml classmethod in VisualGenArgs currently
assumes yaml.safe_load returns a mapping and calls
config_dict.update(overrides), which will raise an AttributeError for
scalars/lists; change it to validate the loader output: after config_dict =
yaml.safe_load(f) or {}, check that config_dict is a dict/mapping
(isinstance(config_dict, dict)), and if not raise a clear TypeError/ValueError
explaining the YAML root must be a mapping; only then merge overrides and return
cls(**config_dict) so overrides handling stays the same and errors are explicit.

In `@tests/integration/defs/visual_gen/test_visual_gen_benchmark.py`:
- Around line 109-113: The current truthy check drops empty dict inputs; change
the condition that guards config-file creation from a truthiness test to an
explicit None check (i.e., use "if visual_gen_args is not None:"), so that an
empty dict is treated as a valid present config; update the block that writes
self._config_file and appends "--visual_gen_args" (the variables
visual_gen_args, self._config_file and args) accordingly.

In `@tests/unittest/_torch/visual_gen/multi_gpu/test_wan_pipeline_parallel.py`:
- Around line 326-330: The test is passing an unexpected keyword "model" to
_logic_wan_cfg_ulysses_pvae; change the call in run_test_in_distributed to use
the correct keyword that the worker expects (checkpoint_path) so replace
model=WAN21_1_3B_PATH with checkpoint_path=WAN21_1_3B_PATH when invoking
run_test_in_distributed for the _logic_wan_cfg_ulysses_pvae test.

In `@tests/unittest/_torch/visual_gen/test_attention_perf.py`:
- Line 940: Update the pytest.parametrization decorators that pair quant_cfg and
cfg_id to use strict zipping: find the `@pytest.mark.parametrize` decorator that
currently uses zip(_QUANT_CONFIGS, _QUANT_CONFIG_IDS) for the "quant_cfg,cfg_id"
parameters (and the two other identical parametrizations in the same test
module) and change each call to zip(_QUANT_CONFIGS, _QUANT_CONFIG_IDS,
strict=True) so mismatched lengths raise an error instead of silently
truncating.

In `@tests/unittest/_torch/visual_gen/test_flux_pipeline.py`:
- Around line 66-80: The autouse function-scoped fixture
_autouse_skip_components runs too late for class-level pipelines like
TestFluxBatchGeneration.flux1_pipeline and flux2_pipeline, so move the
environment control into a broader scope or into the pipeline fixtures
themselves: either change _autouse_skip_components to a class- or session-scoped
fixture (scope="class" or "session") so it runs before class-level fixtures, or
remove it and explicitly set/clear TLLM_VG_SKIP_COMP inside the pipeline
fixtures that create flux1_pipeline and flux2_pipeline; ensure the logic still
respects _FULL_PIPELINE_TEST_CLASSES and uses SKIP_COMPONENTS to build the env
value when opting into skipping components.

In `@tests/unittest/_torch/visual_gen/test_ltx2_pipeline.py`:
- Around line 23-31: The test imports PipelineComponent from
tensorrt_llm.visual_gen.args but that module no longer exports it; update the
import to the module that actually defines/exports PipelineComponent (e.g.,
import PipelineComponent from tensorrt_llm._torch.visual_gen.args or the
specific module where PipelineComponent is declared) so the symbol resolves at
import time; modify the import line in
tests/unittest/_torch/visual_gen/test_ltx2_pipeline.py alongside the existing
imports of DiffusionModelConfig, LTX2_FORCE_ONE_STAGE_ENV and PipelineLoader to
reference the correct module that provides PipelineComponent.

In `@tests/unittest/_torch/visual_gen/test_wan21_t2v_pipeline.py`:
- Around line 248-249: The test calls to _assert_pipeline_matches_hf use the
wrong keyword name; replace the keyword argument model with checkpoint_path in
the _assert_pipeline_matches_hf(...) invocations (e.g., the call currently
passing WAN21_1_3B_PATH as model) so the helper receives checkpoint_path
correctly—update both occurrences where _assert_pipeline_matches_hf is called in
this test file.

In `@tests/unittest/_torch/visual_gen/test_wan22_i2v_pipeline.py`:
- Line 289: The test calls _assert_pipeline_matches_hf with model=WAN22_I2V_PATH
but the helper signature expects checkpoint_path; update the call to use
checkpoint_path=WAN22_I2V_PATH (or alternatively rename the helper parameter to
model) so the keyword matches the function signature; locate the call to
_assert_pipeline_matches_hf and replace model=... with checkpoint_path=... to
avoid the TypeError at runtime.

In `@tests/unittest/_torch/visual_gen/test_wan22_t2v_pipeline.py`:
- Around line 265-267: The test call to _assert_pipeline_matches_hf uses the
wrong keyword: change the argument named model to checkpoint_path so the helper
receives the expected parameter (i.e., replace model=WAN22_A14B_PATH with
checkpoint_path=WAN22_A14B_PATH in the call to _assert_pipeline_matches_hf);
verify other calls to _assert_pipeline_matches_hf use checkpoint_path as well.
- Around line 282-287: Change the _autouse_skip_components fixture to module
scope and set the env var directly via os.environ so it is in place before
module-scoped pipeline fixtures (wan22_t2v_fp8, wan22_t2v_trtllm) initialize:
make the decorator `@pytest.fixture`(scope="module", autouse=True), compute the
value with ",".join(getattr(c, "value", c) for c in _SKIP_AUX), assign it to
os.environ["TLLM_VG_SKIP_COMP"] before yielding, and restore the previous env
value (or delete the key) after the fixture yields to avoid leaking state.

In `@tests/unittest/_torch/visual_gen/test_wan22_ti2v_5b_pipeline.py`:
- Line 288: The test calls to _assert_pipeline_matches_hf use the keyword model
(e.g., model=WAN22_TI2V_5B_PATH) but the helper still expects checkpoint_path;
update the test invocations to use checkpoint_path=<constant> (replace model=
with checkpoint_path=) for the occurrences that reference WAN22_TI2V_5B_PATH
(also fix the identical call at the other location) so the keyword matches the
helper function signature.

---

Outside diff comments:
In `@tensorrt_llm/serve/scripts/benchmark_visual_gen.py`:
- Around line 573-579: Update the stale help string for the parser.add_argument
call that defines the "--num-gpus" option: change the reference from
"--extra-visual-gen-options" to the new flag name "--visual-gen-args" so the
help text correctly matches the renamed argument (look for the
parser.add_argument(... "--num-gpus" ...) entry and edit its help parameter).

In `@tests/integration/defs/perf/README_test_visual_gen_perf_sanity.md`:
- Around line 141-145: The README references the old key server_config.parallel;
update those occurrences to server_config.parallel_config (including the block
mentioning visual_gen_args_path merging and the note about
hardware.gpus_per_node matching GPU counts derived from server_config.parallel),
and ensure any guidance that derives GPU counts or examples use
server_config.parallel_config; also confirm the note about
client_configs[].generation_mode remains accurate after the key rename.

In `@tests/unittest/_torch/visual_gen/test_attention_perf.py`:
- Around line 201-205: The helper _is_sage_attention_enabled currently checks
only for the presence of quant_attention_config on the attention object which
can be set even when runtime dispatch falls back to non-Sage code; change the
test to assert an observable execution signal instead: update
_is_sage_attention_enabled (and the similar checks at the other locations) to
verify a production-side instrumentation point or mockable dispatch hook (e.g.,
incremented counter, telemetry flag, or a mocked
TrtllmAttention.dispatch/choose_kernel call) that is set when SageAttention
actually runs; locate the runtime dispatch in TrtllmAttention (or the backend
dispatch function) and either read a runtime-executed counter/flag exposed by
that component or patch the dispatch to set a test-only marker, and have the
helper return True only if that runtime marker was observed.

In `@tests/unittest/_torch/visual_gen/test_wan21_i2v_pipeline.py`:
- Around line 269-275: Call the helper with the renamed keyword by replacing the
model= argument with checkpoint_path= when invoking _assert_pipeline_matches_hf;
specifically change the call that currently passes model=WAN21_I2V_480P_PATH to
checkpoint_path=WAN21_I2V_480P_PATH (keeping the other args height, width,
num_frames, guidance_scale, model_label unchanged) so the helper receives the
expected parameter name.

In `@tests/unittest/_torch/visual_gen/test_wan21_t2v_pipeline.py`:
- Around line 286-297: The autouse function-scoped fixture that sets the
TLLM_VG_SKIP_COMP env var is globally affecting tests (including
wan21_full_pipeline) and breaking full-pipeline caching; remove or disable the
global autouse behavior and instead apply the skip logic only to
transformer-only fixtures: delete autouse=True from the env-override fixture (or
change its scope to module/class and limit its import), and add explicit
skip/conditional checks (pytest.skip or pytest.mark.skipif tied to
TLLM_VG_SKIP_COMP) on the transformer-only fixtures or move those fixtures into
a separate module; ensure wan21_full_pipeline and other full-pipeline fixtures
(e.g., wan21_full_pipeline) are not subject to the env override so they load the
complete pipeline.

---

Nitpick comments:
In `@tensorrt_llm/_torch/visual_gen/attention_backend/trtllm.py`:
- Around line 289-292: The current guard uses an assert to check that k and v
are present when self.quant_attention_config is not None; replace the assert in
the SageAttention-related code with an explicit runtime exception (e.g., raise
ValueError or RuntimeError) that includes a clear message like "SageAttention
requires separate Q, K, V tensors" so the check still triggers in
optimized/production runs; update the block around self.quant_attention_config,
k, and v in trtllm.py to raise the exception instead of using assert.

In `@tests/integration/defs/visual_gen/test_visual_gen_benchmark.py`:
- Around line 193-325: The PR changed integration tests under
tests/integration/defs/visual_gen (functions test_online_benchmark and
test_offline_benchmark) but the reviewer noted QA list updates are unnecessary;
update the PR by adding a brief note to the commit message or PR description
stating that these edits only adjust existing benchmark wiring/flags and do not
add new integration tests so no QA scheduling-list changes are required
(alternatively add a single-line comment in the test file near
test_online_benchmark/test_offline_benchmark indicating "No QA list update
required — only wiring/flag changes").
🪄 Autofix (Beta)

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: f776491a-e627-41d0-b2a0-7bc01e223f72

📥 Commits

Reviewing files that changed from the base of the PR and between 0435722 and b8d8a6f.

📒 Files selected for processing (78)
  • docs/source/models/visual-generation.md
  • examples/visual_gen/configs/wan2.2-t2v-fp4-1gpu.yaml
  • examples/visual_gen/configs/wan2.2-t2v-fp4-4gpu.yaml
  • examples/visual_gen/configs/wan2.2-t2v-fp8-8gpu.yaml
  • examples/visual_gen/serve/benchmark_visual_gen_mgmn_distributed.sh
  • examples/visual_gen/serve/configs/flux1.yml
  • examples/visual_gen/serve/configs/flux2.yml
  • examples/visual_gen/serve/configs/ltx2.yml
  • examples/visual_gen/serve/configs/wan21.yml
  • examples/visual_gen/serve/configs/wan22.yml
  • examples/visual_gen/visual_gen_flux.py
  • examples/visual_gen/visual_gen_ltx2.py
  • examples/visual_gen/visual_gen_wan_i2v.py
  • examples/visual_gen/visual_gen_wan_t2v.py
  • tensorrt_llm/_torch/visual_gen/__init__.py
  • tensorrt_llm/_torch/visual_gen/attention_backend/trtllm.py
  • tensorrt_llm/_torch/visual_gen/attention_backend/utils.py
  • tensorrt_llm/_torch/visual_gen/cache/teacache.py
  • tensorrt_llm/_torch/visual_gen/checkpoints/weight_loader.py
  • tensorrt_llm/_torch/visual_gen/config.py
  • tensorrt_llm/_torch/visual_gen/executor.py
  • tensorrt_llm/_torch/visual_gen/mapping.py
  • tensorrt_llm/_torch/visual_gen/models/flux/pipeline_flux.py
  • tensorrt_llm/_torch/visual_gen/models/flux/pipeline_flux2.py
  • tensorrt_llm/_torch/visual_gen/models/ltx2/pipeline_ltx2.py
  • tensorrt_llm/_torch/visual_gen/models/ltx2/pipeline_ltx2_two_stages.py
  • tensorrt_llm/_torch/visual_gen/models/ltx2/transformer_ltx2.py
  • tensorrt_llm/_torch/visual_gen/models/wan/pipeline_wan.py
  • tensorrt_llm/_torch/visual_gen/models/wan/pipeline_wan_i2v.py
  • tensorrt_llm/_torch/visual_gen/pipeline.py
  • tensorrt_llm/_torch/visual_gen/pipeline_loader.py
  • tensorrt_llm/_torch/visual_gen/pipeline_registry.py
  • tensorrt_llm/bench/benchmark/visual_gen.py
  • tensorrt_llm/commands/serve.py
  • tensorrt_llm/commands/utils.py
  • tensorrt_llm/serve/scripts/benchmark_visual_gen.py
  • tensorrt_llm/visual_gen/__init__.py
  • tensorrt_llm/visual_gen/args.py
  • tensorrt_llm/visual_gen/visual_gen.py
  • tests/integration/defs/examples/test_visual_gen.py
  • tests/integration/defs/perf/README_test_visual_gen_perf_sanity.md
  • tests/integration/defs/perf/test_visual_gen_perf_sanity.py
  • tests/integration/defs/perf/visual_gen_perf_utils.py
  • tests/integration/defs/visual_gen/test_visual_gen_benchmark.py
  • tests/scripts/perf-sanity/visual_gen/flux2_blackwell.yaml
  • tests/scripts/perf-sanity/visual_gen/ltx2_blackwell.yaml
  • tests/scripts/perf-sanity/visual_gen/wan21_t2v_14b_blackwell.yaml
  • tests/scripts/perf-sanity/visual_gen/wan22_i2v_a14b_blackwell.yaml
  • tests/unittest/_torch/visual_gen/conftest.py
  • tests/unittest/_torch/visual_gen/multi_gpu/test_flux_ulysses.py
  • tests/unittest/_torch/visual_gen/multi_gpu/test_ulysses_sage_attention.py
  • tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_multinode.py
  • tests/unittest/_torch/visual_gen/multi_gpu/test_wan_attn2d.py
  • tests/unittest/_torch/visual_gen/multi_gpu/test_wan_pipeline_parallel.py
  • tests/unittest/_torch/visual_gen/test_attention_integration.py
  • tests/unittest/_torch/visual_gen/test_attention_perf.py
  • tests/unittest/_torch/visual_gen/test_cache_dit.py
  • tests/unittest/_torch/visual_gen/test_flux_attention.py
  • tests/unittest/_torch/visual_gen/test_flux_pipeline.py
  • tests/unittest/_torch/visual_gen/test_flux_transformer.py
  • tests/unittest/_torch/visual_gen/test_fused_qkv.py
  • tests/unittest/_torch/visual_gen/test_ltx2_attention.py
  • tests/unittest/_torch/visual_gen/test_ltx2_pipeline.py
  • tests/unittest/_torch/visual_gen/test_ltx2_transformer.py
  • tests/unittest/_torch/visual_gen/test_model_loader.py
  • tests/unittest/_torch/visual_gen/test_teacache.py
  • tests/unittest/_torch/visual_gen/test_trtllm_serve_e2e.py
  • tests/unittest/_torch/visual_gen/test_visual_gen_args.py
  • tests/unittest/_torch/visual_gen/test_wan21_i2v_pipeline.py
  • tests/unittest/_torch/visual_gen/test_wan21_i2v_teacache.py
  • tests/unittest/_torch/visual_gen/test_wan21_t2v_pipeline.py
  • tests/unittest/_torch/visual_gen/test_wan21_t2v_teacache.py
  • tests/unittest/_torch/visual_gen/test_wan22_i2v_pipeline.py
  • tests/unittest/_torch/visual_gen/test_wan22_t2v_pipeline.py
  • tests/unittest/_torch/visual_gen/test_wan22_ti2v_5b_pipeline.py
  • tests/unittest/_torch/visual_gen/test_wan_transformer.py
  • tests/unittest/_torch/visual_gen/test_warmup.py
  • tests/unittest/dynamo/test_imports.py
💤 Files with no reviewable changes (1)
  • tests/unittest/_torch/visual_gen/test_fused_qkv.py

@zhenhuaw-me

Copy link
Copy Markdown
Member Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49220 [ run ] triggered by Bot. Commit: b8d8a6f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49220 [ run ] completed with state SUCCESS. Commit: b8d8a6f
/LLM/main/L0_MergeRequest_PR pipeline #38893 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

@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". 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. 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.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--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".

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

Refactor the user-facing VisualGen configuration surface for clarity and
consistency. The public ``VisualGenArgs`` schema is renamed/regrouped so
each sub-config is named ``<area>_config`` and the field names match the
CLI flags users already type. The internal ``DiffusionModelConfig`` and
``PipelineLoader`` stay backward-compatible in spirit but are decoupled
from the user surface.

Public schema changes (``tensorrt_llm.visual_gen.args.VisualGenArgs``):

- ``checkpoint_path`` -> ``model``; revision/HF download flow unchanged.
- ``parallel`` -> ``parallel_config`` with renamed fields:
  ``dit_cfg_size`` -> ``cfg_size``, ``dit_ulysses_size`` -> ``ulysses_size``,
  ``dit_ring_size`` -> ``ring_size``, ``dit_attn2d_*`` -> ``attn2d_size``
  (a ``(rows, cols)`` tuple). ``parallel_vae_size`` retained.
- ``attention`` -> ``attention_config``; ``backend`` kept; SageAttention's
  per-block quant fields collapsed into a single
  ``QuantAttentionConfig`` (``qk_dtype``, ``v_dtype``, per-tensor block
  sizes), mirroring ``SkipSoftmaxAttentionConfig`` naming.
- ``cache`` -> ``cache_config`` (still ``Union[TeaCacheConfig,
  CacheDiTConfig]``).
- ``cuda_graph`` / ``torch_compile`` -> ``cuda_graph_config`` /
  ``torch_compile_config``; their ``enable_cuda_graph`` /
  ``enable_torch_compile`` flags collapse to ``enable``.
- ``pipeline`` -> ``pipeline_config`` (a strict ``Dict[str, Any]``
  validated against per-pipeline registry defaults; LTX-2 asset paths
  ``text_encoder_path`` / ``spatial_upsampler_path`` /
  ``distilled_lora_path`` live here instead of on the top-level args).
- ``skip_warmup`` moved from ``VisualGenArgs`` onto ``CompilationConfig``.
- ``skip_components`` removed from the public surface; kept as an
  internal escape hatch on ``PipelineLoader.load(skip_components=...)``
  (see below) for memory-constrained unit tests.

Internals:

- ``PipelineLoader.load(skip_warmup, skip_components)`` is now the
  single entry point that accepts skip_components, forwarded to
  ``BasePipeline.load_standard_components`` and gated per
  ``PipelineComponent`` in every pipeline subclass (Wan T2V/I2V, FLUX,
  FLUX.2, LTX-2 single + two-stage). LTX-2 native components still
  honor ``"audio_vae"`` / ``"vocoder"`` / ``"connectors"`` /
  ``"video_encoder"`` string tokens.
- ``PipelineComponent`` enum moved to ``_torch.visual_gen.pipeline_loader``;
  re-exported from ``_torch.visual_gen`` for tests.
- ``DiffusionModelConfig`` slimmed: drops the duplicated public fields
  that now live on ``VisualGenArgs``; ``from_pretrained`` accepts the
  pre-validated ``pipeline_config`` dict from ``PipelineLoader``.
- Wan / FLUX / LTX-2 pipeline files updated to read renamed config
  fields and to translate the new ``QuantAttentionConfig`` shape to the
  existing kernel ABI keywords.

Examples and tests:

- ``examples/visual_gen/*`` scripts updated to the new CLI surface
  (``--model``, ``--cfg_size``, ``--attn2d_row_size`` etc.) and to the
  renamed ``parallel_config`` / ``attention_config`` /
  ``torch_compile_config`` / ``pipeline_config`` payloads.
- All unit + integration tests under
  ``tests/unittest/_torch/visual_gen`` and
  ``tests/integration/defs/examples/test_visual_gen.py`` updated to
  the renamed schema. Tests that need to skip heavy components now
  pass ``skip_components=...`` to ``PipelineLoader.load()`` (the
  internal kwarg), preserving the pre-refactor memory budget so that
  ``test_fp8_vs_bf16_memory_comparison`` and the Wan2.2 batch /
  fp8_cache_dit tests stay within B200's 178 GB envelope.
- LPIPS helpers in ``tests/integration/defs/examples/test_visual_gen.py``
  ported to the renamed schema (drop ``device``/``dtype``/top-level
  ``skip_warmup``; move LTX-2 asset paths into ``pipeline_config``).
- ``tests/integration/defs/perf/`` perf-sanity driver + YAML serve
  configs updated to the renamed match keys (``parallel_config``,
  ``attention_config``, ``cache_config``, ``cuda_graph_config``,
  ``torch_compile_config``, ``pipeline_config``).

Signed-off-by: Zhenhua Wang <zhenhuaw@nvidia.com>
@zhenhuaw-me

Copy link
Copy Markdown
Member Author

/bot run --add-multi-gpu-test

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49718 [ run ] triggered by Bot. Commit: 5ad402f Link to invocation

@o-stoner o-stoner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wan LGTM

Comment thread tensorrt_llm/_torch/visual_gen/models/wan/pipeline_wan.py
Comment thread tensorrt_llm/_torch/visual_gen/models/wan/pipeline_wan_i2v.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49718 [ run ] completed with state SUCCESS. Commit: 5ad402f
/LLM/main/L0_MergeRequest_PR pipeline #39324 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

@zhenhuaw-me

Copy link
Copy Markdown
Member Author

/bot run --add-multi-gpu-test

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49761 [ run ] triggered by Bot. Commit: 5ad402f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49761 [ run ] completed with state SUCCESS. Commit: 5ad402f
/LLM/main/L0_MergeRequest_PR pipeline #39360 completed with status: 'SUCCESS'

CI Report

Link to invocation

@zhenhuaw-me
zhenhuaw-me requested a review from chang-l May 22, 2026 01:38
@zhenhuaw-me
zhenhuaw-me enabled auto-merge (squash) May 22, 2026 01:40

@brb-nv brb-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on behalf of dynamo-devs.

@yibinl-nvidia yibinl-nvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on the LTX-2, left a comment on the doc.

Comment thread tensorrt_llm/_torch/visual_gen/models/ltx2/pipeline_ltx2.py Outdated
@zhenhuaw-me

Copy link
Copy Markdown
Member Author

/bot reuse-pipeline --comment "last CI passed and the new commit is doc update and passing local UTs"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49836 [ reuse-pipeline ] triggered by Bot. Commit: 8c5bf22 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49836 [ reuse-pipeline ] completed with state SUCCESS. Commit: 8c5bf22
Reusing PR_Github #49761 for commit 8c5bf22

Link to invocation

Comment thread tensorrt_llm/visual_gen/args.py Outdated
Comment thread examples/visual_gen/configs/wan2.2-t2v-fp4-1gpu.yaml
Comment thread tensorrt_llm/_torch/visual_gen/pipeline.py Outdated
Comment thread tensorrt_llm/commands/serve.py
Comment thread docs/source/models/visual-generation.md
…back

LTX2Pipeline registry docstring now matches the one-stage/two-stage
auto-discovery in resolve_variant. VisualGen docs are realigned to the
refactored schema (cache_config.cache_backend, cache/ subpackage, the
unified _setup_cache_acceleration hook). PipelineComponent is relocated
to pipeline_registry so core modules no longer reach into
pipeline_loader; pipeline_loader still re-exports it for external
callers. Attention quant dtype literals are renamed e4m3 -> fp8 to
match the rest of TRT-LLM (kv_cache_config.dtype, indexer_k_dtype,
QuantAlgo.FP8); the kernel still uses torch.float8_e4m3fn and the
docstring spells that out.

Signed-off-by: Zhenhua Wang <zhenhuaw@nvidia.com>
@zhenhuaw-me

Copy link
Copy Markdown
Member Author

/bot run --add-multi-gpu-test

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49865 [ run ] triggered by Bot. Commit: ab5948d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49865 [ run ] completed with state SUCCESS. Commit: ab5948d
/LLM/main/L0_MergeRequest_PR pipeline #39448 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

@zhenhuaw-me

Copy link
Copy Markdown
Member Author

/bot run --add-multi-gpu-test

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49920 [ run ] triggered by Bot. Commit: ab5948d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49920 [ run ] completed with state SUCCESS. Commit: ab5948d
/LLM/main/L0_MergeRequest_PR pipeline #39498 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

@zhenhuaw-me

Copy link
Copy Markdown
Member Author

/bot run --add-multi-gpu-test

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49980 [ run ] triggered by Bot. Commit: ab5948d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49980 [ run ] completed with state SUCCESS. Commit: ab5948d
/LLM/main/L0_MergeRequest_PR pipeline #39546 completed with status: 'SUCCESS'

CI Report

Link to invocation

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.