Skip to content

[TRTLLM-14557][test] Add single-device visual-gen feature accuracy regression tests#16683

Open
zhaoyuanh-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
zhaoyuanh-nvidia:dev/accuracy-feat-test
Open

[TRTLLM-14557][test] Add single-device visual-gen feature accuracy regression tests#16683
zhaoyuanh-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
zhaoyuanh-nvidia:dev/accuracy-feat-test

Conversation

@zhaoyuanh-nvidia

@zhaoyuanh-nvidia zhaoyuanh-nvidia commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR introduces a unified single-device accuracy regression framework for TensorRT-LLM VisualGen features.

It replaces the monolithic test_visual_gen.py with model-specific test modules and adds isolated accuracy coverage for:

  • FP8 blockwise
  • NVFP4
  • CUDA graph

Each feature test enables exactly one feature and compares the generated output against a fixed golden produced with that same feature configuration. This detects changes in feature behavior across future code revisions instead of measuring the expected difference between a feature and an eager baseline.

TeaCache, Cache-DiT, VSA, and explicit torch.compile profiles are intentionally left for follow-up PRs.

Motivation

VisualGen supports multiple model-specific optimizations, but previously lacked a consistent framework for detecting accuracy regressions caused by an individual feature.

The framework added by this PR provides:

  • A generic FeatureConfigState
  • Declarative model-specific feature profiles
  • Validation that exactly one tested feature is enabled
  • Runtime assertions that the requested feature reaches the resolved pipeline
  • Dedicated fixed golden outputs for every model/feature profile
  • Reusable deterministic LPIPS evaluation
  • Consistent golden metadata and SHA256 validation
  • B200 L0 registration and measured test durations

Test organization

The former monolithic test suite is split into:

  • test_visual_gen_flux.py
  • test_visual_gen_qwen_image.py
  • test_visual_gen_cosmos3.py
  • test_visual_gen_ltx2.py
  • test_visual_gen_wan.py

Shared functionality is consolidated in:

  • visual_gen_test_utils.py
  • conftest.py

The shared utilities cover feature configuration, runtime assertions, deterministic LPIPS evaluation, golden-media extraction, video handling, VBench support, and common WAN constants.

Existing multi-GPU test behavior is unchanged. Its imports are updated mechanically to use the shared utility module.

Accuracy-test design

For each feature profile, the test:

  1. Constructs VisualGenArgs from a normalized FeatureConfigState.
  2. Validates that exactly one scoped feature is enabled.
  3. Resolves and initializes the requested model pipeline.
  4. Verifies the resolved quantization or CUDA graph configuration.
  5. Confirms that the requested feature is installed and exercised.
  6. Generates output using deterministic inputs and seed.
  7. Compares the result against the dedicated golden for that exact feature profile.
  8. Fails when LPIPS exceeds the fixed threshold.

All new feature tests keep torch_compile=False, matching the existing upstream baseline test configuration.

Existing baseline tests continue to use the upstream baseline JSON and media artifacts. Baseline outputs are not duplicated or regenerated by this PR.

Golden-output policy

This PR adds one fixed golden output for every model/feature profile.

Each golden JSON records:

  • Model and checkpoint
  • Prompt and negative prompt
  • Resolution and frame count
  • Denoising steps and guidance scale
  • Seed and deterministic settings
  • Enabled feature configuration
  • LPIPS network and threshold
  • Media SHA256

The generation parameters match the corresponding existing upstream baseline. The only intentional configuration difference is the single feature under test.

Because the current implementation produced these fixed feature goldens, the validated LPIPS is 0.000000. Future numerical or behavioral changes will produce a nonzero LPIPS and fail if they exceed the 0.05 threshold.

Feature coverage

Model FP8 blockwise NVFP4 CUDA graph
FLUX.1 Yes Yes Yes
FLUX.2 Yes Yes Yes
Qwen-Image Yes Yes Yes
Cosmos3-Nano Yes Yes No
LTX-2 Yes Yes Yes
Wan 2.1 Yes Yes Yes
Wan 2.2 Yes Yes Yes

Cosmos3-Nano CUDA graph is not included because it is not currently supported as an isolated feature profile.

This results in 20 new feature accuracy cases.

CI integration

All 20 feature cases are registered in the B200 L0 suite.

Existing VisualGen test references in the other test lists and waivers are updated to point to the new model-specific modules. No multi-GPU feature-matrix expansion is included.

LTX-2 feature tests do not use an explicit per-test timeout. Their measured durations are recorded in .test_durations for CI scheduling.

Test Coverage

All 20 single-feature cases passed on B200 with LPIPS 0.000000.

Model Feature Duration
FLUX.1 FP8 blockwise 119.97s
FLUX.1 NVFP4 57.85s
FLUX.1 CUDA graph 12.84s
FLUX.2 FP8 blockwise 258.78s
FLUX.2 NVFP4 277.28s
FLUX.2 CUDA graph 24.02s
Qwen-Image FP8 blockwise 82.10s
Qwen-Image NVFP4 104.22s
Qwen-Image CUDA graph 141.80s
Cosmos3-Nano FP8 blockwise 55.09s
Cosmos3-Nano NVFP4 59.88s
LTX-2 FP8 blockwise 481.07s
LTX-2 NVFP4 496.24s
LTX-2 CUDA graph 461.68s
Wan 2.1 FP8 blockwise 65.48s
Wan 2.1 NVFP4 156.43s
Wan 2.1 CUDA graph 8.49s
Wan 2.2 FP8 blockwise 182.16s
Wan 2.2 NVFP4 161.28s
Wan 2.2 CUDA graph 31.14s

Additional validation:

  • Python syntax compilation: passed
  • JSON metadata validation: passed
  • L0 YAML validation: passed
  • Golden-media ZIP integrity: passed
  • 20 feature golden media references and SHA256 hashes: passed
  • L0 profile registration: 20 cases validated
  • git diff --check: passed
  • DCO sign-off: present

Out of scope

The following features are deferred to follow-up PRs so their accuracy policies and goldens can be reviewed independently:

  • TeaCache
  • Cache-DiT
  • VSA
  • Explicit torch.compile profiles
  • Multi-GPU feature combinations

PR Checklist

  • PR description clearly explains the change and motivation
  • Changes follow the TRT-LLM coding guidelines
  • Test cases are provided for the new feature paths
  • Fixed golden outputs and metadata are included
  • Supported cases are registered in B200 L0
  • Existing multi-GPU behavior is preserved
  • No public API changes are introduced

GitHub Bot Help

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

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

VisualGen integration coverage is reorganized into model-specific Cosmos3, FLUX, LTX-2, Qwen-Image, and WAN modules with shared LPIPS/VBench utilities, golden metadata, fixtures, and updated test-list ownership.

Changes

VisualGen integration coverage

Layer / File(s) Summary
Shared evaluation infrastructure
tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py, conftest.py, golden/visual_gen_lpips/*
Adds normalized feature configuration, reusable LPIPS scoring, VBench evaluation, WAN generation helpers, shared fixtures, and golden LPIPS metadata.
Image model accuracy and examples
tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py, test_visual_gen_flux.py, test_visual_gen_qwen_image.py
Adds model-specific LPIPS regression cases, feature-configuration checks, and end-to-end example tests for Cosmos3, FLUX, and Qwen-Image.
LTX-2 accuracy and VBench tests
tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py
Adds single-device feature tests, eager/CUDA-graph comparisons, TRT-LLM backend coverage, two-stage fixtures, VBench checks, and example execution.
WAN accuracy, VBench, and examples
tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py
Adds WAN 2.1/2.2 feature accuracy, LPIPS and VBench checks, cached generation fixtures, walkthroughs, and T2V/I2V examples.
Suite selection and ownership
.github/CODEOWNERS, tests/integration/defs/.test_durations, tests/integration/test_lists/**, tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
Redirects selectors, duration keys, waivers, imports, and ownership from the removed monolithic module to the model-specific modules.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TestModule
  participant PipelineLoader
  participant VisualGen
  participant GoldenMedia
  participant LPIPS
  TestModule->>PipelineLoader: load model with feature configuration
  PipelineLoader-->>TestModule: return configured pipeline
  TestModule->>VisualGen: generate image or video
  VisualGen-->>TestModule: return generated media
  TestModule->>GoldenMedia: load reference artifact
  TestModule->>LPIPS: compare generated media with reference
  LPIPS-->>TestModule: return regression score
Loading

Possibly related PRs

Suggested labels: VisualGen

Suggested reviewers: qijune, emmaqiaoch, zhanruisunch, larryxfly

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly states the main change: adding single-device visual-gen feature accuracy regression tests.
Description check ✅ Passed The description includes the required sections and gives clear details on motivation, design, test coverage, and checklist.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py (1)

201-257: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the shared single-device feature-pipeline lifecycle into visual_gen_test_utils. All three per-model "generate feature image" functions duplicate the same skip-warmup derivation, deterministic-algorithms context, resolved-config/feature assertions, forward call, and pipeline/cuda cleanup try/finally — only the model-specific prompt kwargs and frame-extraction line differ.

  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py#L201-L257: replace the pipeline build/assert/forward/cleanup boilerplate in _generate_cosmos3_feature_image with a shared context-manager/helper from visual_gen_test_utils.py that takes a model-specific forward(pipeline) callback.
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py#L207-L252: apply the same shared helper in _generate_flux_image.
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py#L155-L201: apply the same shared helper in _generate_qwenimage_feature_image.
🤖 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/examples/visual_gen/test_visual_gen_cosmos3.py` around
lines 201 - 257, Extract the duplicated single-device feature-pipeline lifecycle
into a shared helper or context manager in visual_gen_test_utils.py, accepting
the model-specific forward(pipeline) callback while preserving skip-warmup
derivation, deterministic-algorithm handling, configuration and feature
assertions, and pipeline/CUDA cleanup. Update _generate_cosmos3_feature_image in
tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py (lines
201-257), _generate_flux_image in
tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py (lines
207-252), and _generate_qwenimage_feature_image in
tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py (lines
155-201) to use the shared lifecycle, retaining each function’s model-specific
forward arguments and frame extraction.
tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py (1)

71-75: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Checkpoint subdirectory strings duplicated instead of reusing module constants.

"Wan2.1-T2V-1.3B-Diffusers" is hardcoded in WAN_MODEL_SPECS (Line 171) and again in the wan21_bf16_video_path fixture (Line 332), despite WAN_T2V_MODEL_SUBPATH (Line 71) already holding this value. Similarly, "Wan2.2-T2V-A14B-Diffusers" appears both in WAN_MODEL_SPECS (Line 184) and wan22_bf16_video_path (Line 355) with no shared constant. Consolidating these reduces the risk of the values drifting apart on future edits.

Also applies to: 168-195, 332-332, 355-355

🤖 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/examples/visual_gen/test_visual_gen_wan.py` around
lines 71 - 75, Replace the duplicated checkpoint subdirectory literals in
WAN_MODEL_SPECS and the wan21_bf16_video_path fixture with the existing
WAN_T2V_MODEL_SUBPATH constant. Add and reuse a shared constant for the Wan2.2
T2V A14B Diffusers subdirectory in WAN_MODEL_SPECS and wan22_bf16_video_path,
preserving the current values.
tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py (1)

151-160: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Stale "Initially None" comment.

The comment says scores are "Initially None — first CI run is a baseline that prints scores for capture," but both dicts already contain concrete calibrated values. This is misleading for future readers trying to determine whether these are placeholders still awaiting capture.

✏️ Proposed fix
-# Golden VBench scores for two-stage pipeline variants.
-# Initially None — first CI run is a baseline that prints scores for capture.
+# Golden VBench scores for two-stage pipeline variants, captured from an
+# initial baseline CI run.
🤖 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/examples/visual_gen/test_visual_gen_ltx2.py` around
lines 151 - 160, Update the comment above
VBENCH_LTX2_TWO_STAGE_BF16_GOLDEN_SCORES to describe these entries as calibrated
golden baseline scores, and remove the stale claim that they are initially None
or awaiting first-run capture. Apply the same clarification to any nearby
equivalent score dictionary comments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py`:
- Around line 472-544: Update _generate_ltx2_two_stage_video to resolve
text_encoder_path through the existing _ltx2_lpips_text_encoder_path() helper,
preserving its primary and gemma/ fallback lookup behavior before the
asset-existence checks and VisualGen configuration.

In `@tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py`:
- Around line 297-298: Confirm that VBENCH_WAN22_BF16_GOLDEN_SCORES contains
final calibrated values from bf16 baseline runs before merging; if not, replace
the interim values with the referenced baseline scores and remove the TODO, or
explicitly track the remaining calibration work instead of leaving it
unresolved.
- Around line 692-733: The model-availability check in test_wan_t2v_example
should skip rather than fail when the NVFP4 checkpoint is missing. Replace the
hard assertion on model_path with the same pytest.skip pattern used by
test_wan_i2v_example and the other model-lookup helpers, preserving the existing
path and guidance message.
- Around line 252-273: Update the Wan 2.1 VSA case in the test-case construction
to use the WAN21 prompt and negative-prompt constants, and replace the hardcoded
guidance_scale value with the shared guidance-scale constant used by the other
Wan cases. Keep the existing wan21-vsa identifiers, dimensions, thresholds, and
feature configuration unchanged.

---

Nitpick comments:
In `@tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py`:
- Around line 201-257: Extract the duplicated single-device feature-pipeline
lifecycle into a shared helper or context manager in visual_gen_test_utils.py,
accepting the model-specific forward(pipeline) callback while preserving
skip-warmup derivation, deterministic-algorithm handling, configuration and
feature assertions, and pipeline/CUDA cleanup. Update
_generate_cosmos3_feature_image in
tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py (lines
201-257), _generate_flux_image in
tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py (lines
207-252), and _generate_qwenimage_feature_image in
tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py (lines
155-201) to use the shared lifecycle, retaining each function’s model-specific
forward arguments and frame extraction.

In `@tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py`:
- Around line 151-160: Update the comment above
VBENCH_LTX2_TWO_STAGE_BF16_GOLDEN_SCORES to describe these entries as calibrated
golden baseline scores, and remove the stale claim that they are initially None
or awaiting first-run capture. Apply the same clarification to any nearby
equivalent score dictionary comments.

In `@tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py`:
- Around line 71-75: Replace the duplicated checkpoint subdirectory literals in
WAN_MODEL_SPECS and the wan21_bf16_video_path fixture with the existing
WAN_T2V_MODEL_SUBPATH constant. Add and reuse a shared constant for the Wan2.2
T2V A14B Diffusers subdirectory in WAN_MODEL_SPECS and wan22_bf16_video_path,
preserving the current values.
🪄 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: b7af6981-1dd8-41ba-bcc0-1cebd5453d3a

📥 Commits

Reviewing files that changed from the base of the PR and between a75e333 and 455c544.

⛔ Files ignored due to path filters (1)
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/visual_gen_lpips_golden_media.zip is excluded by !**/*.zip
📒 Files selected for processing (25)
  • .github/CODEOWNERS
  • tests/integration/defs/.test_durations
  • tests/integration/defs/examples/visual_gen/conftest.py
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/cosmos3_nano_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_feature_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_vsa_dense_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py
  • tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_gh200.yml
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_l40s.yml
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py

Comment thread tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py
Comment thread tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py Outdated
Comment thread tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py
Comment thread tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py

@BowenFu BowenFu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — test-only refactor. Splits the monolithic test_visual_gen.py into per-model modules (+shared utils); no product code touched (all 26 files under tests/ + CODEOWNERS). New .py files carry SPDX/Apache 2026 headers; waiver NVBug refs preserved through the path renames. The new B200 accuracy-vs-golden tests are the visual-gen owner's domain and gated by the PR's own pre-merge run before it can land — not a product regression.

@zhaoyuanh-nvidia
zhaoyuanh-nvidia force-pushed the dev/accuracy-feat-test branch from 92af6ba to f3fa199 Compare July 22, 2026 16:36
@zhaoyuanh-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py (1)

613-629: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer narrower exception scope in the LPIPS eval wrappers.

Both wrappers catch bare Exception only to re-raise via pytest.fail. Consider narrowing to the concrete failure types (e.g. RuntimeError, ValueError, OSError) so genuinely unexpected errors aren't masked into a generic failure message.

As per coding guidelines: "Catch the narrowest possible exceptions, keep duck-typing try blocks minimal."

🤖 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/examples/visual_gen/visual_gen_test_utils.py` around
lines 613 - 629, In the LPIPS evaluation wrappers around
_lpips_deterministic_algorithms(), scorer.score(), and scorer.score_video(),
replace the broad Exception handlers with the narrowest concrete exceptions
these operations can raise, such as RuntimeError, ValueError, and OSError. Keep
the try blocks limited to the scoring operation and preserve the existing
pytest.fail messages for those expected failures, allowing unexpected exceptions
to propagate.

Source: Coding guidelines

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

Nitpick comments:
In `@tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py`:
- Around line 613-629: In the LPIPS evaluation wrappers around
_lpips_deterministic_algorithms(), scorer.score(), and scorer.score_video(),
replace the broad Exception handlers with the narrowest concrete exceptions
these operations can raise, such as RuntimeError, ValueError, and OSError. Keep
the try blocks limited to the scoring operation and preserve the existing
pytest.fail messages for those expected failures, allowing unexpected exceptions
to propagate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9a9c146e-7aaa-49ad-95a7-da8ef37e4ef0

📥 Commits

Reviewing files that changed from the base of the PR and between 92af6ba and f3fa199.

⛔ Files ignored due to path filters (1)
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/visual_gen_lpips_golden_media.zip is excluded by !**/*.zip
📒 Files selected for processing (25)
  • .github/CODEOWNERS
  • tests/integration/defs/.test_durations
  • tests/integration/defs/examples/visual_gen/conftest.py
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/cosmos3_nano_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_feature_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_vsa_dense_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py
  • tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_gh200.yml
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_l40s.yml
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py
🚧 Files skipped from review as they are similar to previous changes (20)
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_feature_eager_lpips_golden_video.json
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/cosmos3_nano_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_vsa_dense_lpips_golden_video.json
  • .github/CODEOWNERS
  • tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_50step_eager_lpips_golden.json
  • tests/integration/test_lists/waives.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py
  • tests/integration/defs/examples/visual_gen/conftest.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py

@zhaoyuanh-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot help

@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 broad patterns "*" and "*Post-Merge*", 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. 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. 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 broad patterns "*" and "*Post-Merge*", 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.

@zhaoyuanh-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61053 [ run ] triggered by Bot. Commit: f3fa199 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61053 [ run ] completed with state FAILURE. Commit: f3fa199

Link to invocation

@zhaoyuanh-nvidia
zhaoyuanh-nvidia force-pushed the dev/accuracy-feat-test branch from f3fa199 to 57140d0 Compare July 22, 2026 19:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py (1)

136-166: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

WanModelSpec and WanAccuracyCase duplicate nearly all fields.

Both dataclasses carry checkpoint_subdir/golden_file, prompt, negative_prompt, height, width, num_frames, num_inference_steps, guidance_scale. Composing WanAccuracyCase from a WanModelSpec (or reusing it directly plus the feature/threshold-specific fields) would remove this duplication and reduce the risk of the two structs drifting.

🤖 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/examples/visual_gen/test_visual_gen_wan.py` around
lines 136 - 166, Refactor WanAccuracyCase and WanModelSpec to share their common
fields instead of duplicating them, preferably by composing WanAccuracyCase with
a WanModelSpec and retaining only features, lpips_threshold, and
vsa_sparsity-specific data in the accuracy case. Update construction and access
sites accordingly while preserving existing behavior and field values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py`:
- Around line 440-446: Update score_video to validate that generated and
reference contain the same number of frames before invoking _get_model; reject
mismatched lengths explicitly instead of truncating with paired_frame_count.
Preserve the existing scoring path for equal-length videos.

---

Nitpick comments:
In `@tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py`:
- Around line 136-166: Refactor WanAccuracyCase and WanModelSpec to share their
common fields instead of duplicating them, preferably by composing
WanAccuracyCase with a WanModelSpec and retaining only features,
lpips_threshold, and vsa_sparsity-specific data in the accuracy case. Update
construction and access sites accordingly while preserving existing behavior and
field values.
🪄 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: 1d5dd43b-e292-442d-aaad-5a9c30e93907

📥 Commits

Reviewing files that changed from the base of the PR and between f3fa199 and 57140d0.

⛔ Files ignored due to path filters (1)
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/visual_gen_lpips_golden_media.zip is excluded by !**/*.zip
📒 Files selected for processing (25)
  • .github/CODEOWNERS
  • tests/integration/defs/.test_durations
  • tests/integration/defs/examples/visual_gen/conftest.py
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/cosmos3_nano_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_feature_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_vsa_dense_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py
  • tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_gh200.yml
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_l40s.yml
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py
🚧 Files skipped from review as they are similar to previous changes (21)
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_12step_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/cosmos3_nano_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_50step_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_50step_eager_lpips_golden.json
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_l40s.yml
  • .github/CODEOWNERS
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_12step_eager_lpips_golden_video.json
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_vsa_dense_lpips_golden_video.json
  • tests/integration/test_lists/waives.txt
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_feature_eager_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_feature_eager_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py
  • tests/integration/defs/.test_durations
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/defs/examples/visual_gen/conftest.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py

Comment thread tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py
@yibinl-nvidia

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61075 [ run ] triggered by Bot. Commit: 57140d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61075 [ run ] completed with state FAILURE. Commit: 57140d0
/LLM/main/L0_MergeRequest_PR pipeline #49330 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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61079 [ run ] triggered by Bot. Commit: 57140d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61079 [ run ] completed with state FAILURE. Commit: 57140d0
/LLM/main/L0_MergeRequest_PR pipeline #49334 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

@yibinl-nvidia yibinl-nvidia changed the title [None][test] Add single-device visual-gen feature accuracy regression tests [TRTLLM-14557][test] Add single-device visual-gen feature accuracy regression tests Jul 22, 2026
Comment thread tests/integration/defs/examples/visual_gen/conftest.py Outdated


@pytest.fixture(scope="session")
def vbench_repo_root(llm_venv):

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.

We can remove VBench tests

- examples/visual_gen/test_visual_gen.py::test_cosmos3_example
- examples/visual_gen/test_visual_gen.py::test_qwen_image_example
# - examples/visual_gen/test_visual_gen.py
- examples/visual_gen/test_visual_gen_wan.py::test_wan_t2v_example

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.

do we need to add these tests into qa test list?

Comment thread tests/integration/test_lists/test-db/l0_b200.yml

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

🧹 Nitpick comments (4)
tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py (3)

512-522: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Bound the child join so a hung teardown fails the test instead of the job.

The status has already been received at this point, so an unbounded join() only ever waits on child teardown (CUDA context destruction, inductor workers, atexit). If that wedges, the pytest worker hangs until the whole CI job times out with no attribution.

♻️ Suggested bounded join with escalation
-    process.join()
-    exitcode = process.exitcode
-    process.close()
+    process.join(timeout=300)
+    if process.is_alive():
+        process.terminate()
+        process.join(timeout=30)
+        if process.is_alive():
+            process.kill()
+            process.join()
+    exitcode = process.exitcode
+    process.close()
🤖 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/examples/visual_gen/visual_gen_test_utils.py` around
lines 512 - 522, Update the child-process cleanup around process.join() in the
visual generation test utility to use a bounded join timeout. If the process
remains alive, escalate by terminating it, wait again with a bounded timeout,
and force-kill if necessary before closing it, then fail the test with the
existing status and exit-code handling.

717-727: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the DINO clone like VBench is pinned.

VBench is fetched at a fixed commit, but DINO tracks main. Since DINO backs the subject/background-consistency dimensions, upstream drift can move scores against fixed goldens and reintroduce the non-reproducibility the VBench pin was added to avoid.

🤖 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/examples/visual_gen/visual_gen_test_utils.py` around
lines 717 - 727, Update _precache_dino_for_torch_hub so the git clone checks out
a fixed DINO commit or tag instead of tracking the moving main branch. Define or
reuse a pinned revision consistent with the repository’s existing
dependency-pinning pattern, and pass that revision to the clone operation while
preserving the current cache directory behavior.

618-625: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Gate the base64 dump behind an opt-in flag.

The artifact is already copied into --output-dir; additionally streaming up to ~11 MB of base64 (thousands of printed lines) into the test log on every LPIPS failure makes CI logs hard to use. Suggest requiring an explicit env opt-in.

♻️ Suggested opt-in gate
-    size = os.path.getsize(dest)
-    if size <= 8 * 1024 * 1024:
+    if os.environ.get("TRTLLM_LPIPS_DUMP_BASE64") != "1":
+        return
+    size = os.path.getsize(dest)
+    if size <= 8 * 1024 * 1024:
🤖 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/examples/visual_gen/visual_gen_test_utils.py` around
lines 618 - 625, Gate the base64 encoding and printing block near the artifact
size check behind an explicit environment-variable opt-in, such as a clearly
named LPIPS dump flag. Preserve the existing 8 MiB size limit and output format
when the flag is enabled, while skipping all base64 log output by default;
continue copying the artifact to the output directory.
tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py (1)

529-571: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate model-symlink setup between test_visual_gen_quickstart and test_visual_gen_api_walkthrough.

Both tests repeat the same scratch-space lookup, skip-if-missing check, and symlink creation for WAN_T2V_MODEL_SUBPATH. Extracting a small helper (e.g., _ensure_wan_t2v_model_symlink(llm_venv)) would remove this duplication.

♻️ Proposed helper extraction
+def _ensure_wan_t2v_symlink(llm_venv):
+    scratch_space = conftest.llm_models_root()
+    model_src = os.path.join(scratch_space, WAN_T2V_MODEL_SUBPATH)
+    if not os.path.isdir(model_src):
+        pytest.skip(
+            f"Model not found: {model_src} "
+            f"(set LLM_MODELS_ROOT or place {WAN_T2V_MODEL_SUBPATH} under scratch)"
+        )
+    model_dst = os.path.join(llm_venv.get_working_directory(), "Wan-AI", WAN_T2V_MODEL_SUBPATH)
+    if not os.path.islink(model_dst):
+        os.makedirs(os.path.dirname(model_dst), exist_ok=True)
+        os.symlink(model_src, model_dst, target_is_directory=True)
+
+
 def test_visual_gen_quickstart(_visual_gen_deps, llm_root, llm_venv):
     """Run examples/visual_gen/quickstart_example.py end-to-end."""
-    scratch_space = conftest.llm_models_root()
-    model_src = os.path.join(scratch_space, WAN_T2V_MODEL_SUBPATH)
-    if not os.path.isdir(model_src):
-        pytest.skip(
-            f"Model not found: {model_src} "
-            f"(set LLM_MODELS_ROOT or place {WAN_T2V_MODEL_SUBPATH} under scratch)"
-        )
-
-    model_dst = os.path.join(llm_venv.get_working_directory(), "Wan-AI", WAN_T2V_MODEL_SUBPATH)
-    if not os.path.islink(model_dst):
-        os.makedirs(os.path.dirname(model_dst), exist_ok=True)
-        os.symlink(model_src, model_dst, target_is_directory=True)
+    _ensure_wan_t2v_symlink(llm_venv)
🤖 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/examples/visual_gen/test_visual_gen_wan.py` around
lines 529 - 571, Extract the repeated WAN model setup from
test_visual_gen_quickstart and test_visual_gen_api_walkthrough into a shared
helper such as _ensure_wan_t2v_model_symlink(llm_venv). Keep the scratch-space
lookup, missing-model skip message, destination creation, and symlink behavior
unchanged, then call the helper from both tests before running their respective
scripts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_fp8_blockwise_lpips_golden.json`:
- Line 2: Align all listed golden fixtures with the shared LPIPS schema by
renaming image to reference_image_path in
tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_fp8_blockwise_lpips_golden.json:2-2,
flux2_nvfp4_lpips_golden.json:2-2, qwenimage_cuda_graph_lpips_golden.json:2-2,
qwenimage_fp8_blockwise_lpips_golden.json:2-2, and
qwenimage_nvfp4_lpips_golden.json:2-2; rename video to reference_video_path in
ltx2_cuda_graph_lpips_golden_video.json:2-2,
ltx2_fp8_blockwise_lpips_golden_video.json:2-2, and
ltx2_nvfp4_lpips_golden_video.json:2-2, preserving each existing path value.

In `@tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py`:
- Around line 119-121: Reformat the golden_file assignments in
tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py:119-121,
tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py:100-102,
and
tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py:92-94
by removing the redundant parentheses and placing each f-string on one line,
preserving the existing filename expressions.

In `@tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py`:
- Around line 80-107: Add a seed field to WanModelSpec and WanAccuracyCase,
assign WAN21_LPIPS_SEED or WAN22_LPIPS_SEED in each WAN_MODEL_SPECS entry, and
propagate it when constructing WAN_ACCURACY_CASES. Update
_generate_wan_feature_video to use the case’s seed instead of hardcoding
WAN21_LPIPS_SEED, preserving the correct seed for both WAN 2.1 and WAN 2.2
cases.

---

Nitpick comments:
In `@tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py`:
- Around line 529-571: Extract the repeated WAN model setup from
test_visual_gen_quickstart and test_visual_gen_api_walkthrough into a shared
helper such as _ensure_wan_t2v_model_symlink(llm_venv). Keep the scratch-space
lookup, missing-model skip message, destination creation, and symlink behavior
unchanged, then call the helper from both tests before running their respective
scripts.

In `@tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py`:
- Around line 512-522: Update the child-process cleanup around process.join() in
the visual generation test utility to use a bounded join timeout. If the process
remains alive, escalate by terminating it, wait again with a bounded timeout,
and force-kill if necessary before closing it, then fail the test with the
existing status and exit-code handling.
- Around line 717-727: Update _precache_dino_for_torch_hub so the git clone
checks out a fixed DINO commit or tag instead of tracking the moving main
branch. Define or reuse a pinned revision consistent with the repository’s
existing dependency-pinning pattern, and pass that revision to the clone
operation while preserving the current cache directory behavior.
- Around line 618-625: Gate the base64 encoding and printing block near the
artifact size check behind an explicit environment-variable opt-in, such as a
clearly named LPIPS dump flag. Preserve the existing 8 MiB size limit and output
format when the flag is enabled, while skipping all base64 log output by
default; continue copying the artifact to the output directory.
🪄 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: cbc21b1d-4be1-4035-82b3-9d1a234a001b

📥 Commits

Reviewing files that changed from the base of the PR and between 57140d0 and 34fcdad.

⛔ Files ignored due to path filters (1)
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/visual_gen_lpips_golden_media.zip is excluded by !**/*.zip
📒 Files selected for processing (37)
  • .github/CODEOWNERS
  • tests/integration/defs/.test_durations
  • tests/integration/defs/examples/visual_gen/conftest.py
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/cosmos3_nano_fp8_blockwise_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/cosmos3_nano_nvfp4_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_cuda_graph_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_fp8_blockwise_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_nvfp4_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_cuda_graph_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_fp8_blockwise_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_nvfp4_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_cuda_graph_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_fp8_blockwise_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_nvfp4_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_cuda_graph_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_fp8_blockwise_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_nvfp4_lpips_golden.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_cuda_graph_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_fp8_blockwise_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_nvfp4_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_cuda_graph_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_fp8_blockwise_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_nvfp4_lpips_golden_video.json
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py
  • tests/integration/defs/examples/visual_gen/test_visual_gen_wan.py
  • tests/integration/defs/examples/visual_gen/visual_gen_test_utils.py
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_gh200.yml
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_l40s.yml
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/defs/examples/visual_gen/test_visual_gen.py
🚧 Files skipped from review as they are similar to previous changes (9)
  • .github/CODEOWNERS
  • tests/integration/test_lists/test-db/l0_gh200.yml
  • tests/integration/defs/examples/visual_gen/test_visual_gen_multi_gpu.py
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/waives.txt
  • tests/integration/defs/examples/visual_gen/conftest.py
  • tests/integration/defs/.test_durations
  • tests/integration/defs/examples/visual_gen/test_visual_gen_ltx2.py

@@ -0,0 +1,21 @@
{
"image": "flux2_fp8_blockwise_lpips_golden.png",

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Align all golden fixtures with the shared LPIPS dataset schema.

The loader expects reference_image_path or reference_video_path, but these fixtures use image or video, causing direct loading to fail before scoring.

  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_fp8_blockwise_lpips_golden.json#L2-L2: rename image to reference_image_path.
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_nvfp4_lpips_golden.json#L2-L2: rename image to reference_image_path.
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_cuda_graph_lpips_golden_video.json#L2-L2: rename video to reference_video_path.
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_fp8_blockwise_lpips_golden_video.json#L2-L2: rename video to reference_video_path.
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_nvfp4_lpips_golden_video.json#L2-L2: rename video to reference_video_path.
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_cuda_graph_lpips_golden.json#L2-L2: rename image to reference_image_path.
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_fp8_blockwise_lpips_golden.json#L2-L2: rename image to reference_image_path.
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_nvfp4_lpips_golden.json#L2-L2: rename image to reference_image_path.
📍 Affects 8 files
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_fp8_blockwise_lpips_golden.json#L2-L2 (this comment)
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_nvfp4_lpips_golden.json#L2-L2
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_cuda_graph_lpips_golden_video.json#L2-L2
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_fp8_blockwise_lpips_golden_video.json#L2-L2
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_nvfp4_lpips_golden_video.json#L2-L2
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_cuda_graph_lpips_golden.json#L2-L2
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_fp8_blockwise_lpips_golden.json#L2-L2
  • tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/qwenimage_nvfp4_lpips_golden.json#L2-L2
🤖 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/examples/visual_gen/golden/visual_gen_lpips/flux2_fp8_blockwise_lpips_golden.json`
at line 2, Align all listed golden fixtures with the shared LPIPS schema by
renaming image to reference_image_path in
tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_fp8_blockwise_lpips_golden.json:2-2,
flux2_nvfp4_lpips_golden.json:2-2, qwenimage_cuda_graph_lpips_golden.json:2-2,
qwenimage_fp8_blockwise_lpips_golden.json:2-2, and
qwenimage_nvfp4_lpips_golden.json:2-2; rename video to reference_video_path in
ltx2_cuda_graph_lpips_golden_video.json:2-2,
ltx2_fp8_blockwise_lpips_golden_video.json:2-2, and
ltx2_nvfp4_lpips_golden_video.json:2-2, preserving each existing path value.

Comment on lines +119 to +121
golden_file=(
f"{model.id}_{profile.id.replace('-', '_')}_lpips_golden.png"
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

ruff-format gate fails on the manually wrapped golden_file f-strings. All three accuracy-case builders wrap the golden_file= f-string in redundant parentheses that ruff-format collapses onto one line, which is why the pre-commit hook reports modified files and the Release Checks job fails.

  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py#L119-L121: collapse golden_file=(f"{model.id}_{profile.id.replace('-', '_')}_lpips_golden.png") to a single line.
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py#L100-L102: collapse the cosmos3_nano_... golden_file f-string to a single line.
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py#L92-L94: collapse the qwenimage_... golden_file f-string to a single line.

Running pre-commit run ruff-format --files <these files> fixes all three (and the other reported files) mechanically.

📍 Affects 3 files
  • tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py#L119-L121 (this comment)
  • tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py#L100-L102
  • tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py#L92-L94
🤖 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/examples/visual_gen/test_visual_gen_flux.py` around
lines 119 - 121, Reformat the golden_file assignments in
tests/integration/defs/examples/visual_gen/test_visual_gen_flux.py:119-121,
tests/integration/defs/examples/visual_gen/test_visual_gen_cosmos3.py:100-102,
and
tests/integration/defs/examples/visual_gen/test_visual_gen_qwen_image.py:92-94
by removing the redundant parentheses and placing each f-string on one line,
preserving the existing filename expressions.

Source: Pipeline failures

Comment on lines +80 to +107
@dataclass(frozen=True)
class WanModelSpec:
id: str
checkpoint_subdir: str
prompt: str
negative_prompt: str | None
height: int
width: int
num_frames: int
num_inference_steps: int
guidance_scale: float


@dataclass(frozen=True)
class WanAccuracyCase:
id: str
model_id: str
checkpoint_subdir: str
golden_file: str
prompt: str
negative_prompt: str | None
height: int
width: int
num_frames: int
num_inference_steps: int
guidance_scale: float
features: FeatureConfigState
lpips_threshold: float

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Feature-accuracy videos always use the WAN 2.1 seed, even for WAN 2.2 cases.

WanModelSpec/WanAccuracyCase carry no seed field, and _generate_wan_feature_video hardcodes seed=WAN21_LPIPS_SEED (Line 353) for every case in WAN_ACCURACY_CASES, which includes both wan21-* and wan22-* combinations built from WAN_MODEL_SPECS. If the WAN 2.2 goldens were captured with WAN22_LPIPS_SEED (as the wan22_bf16_video_path fixture uses at Line 266), the WAN 2.2 feature-accuracy tests generate candidates with the wrong seed relative to their golden, risking spurious LPIPS mismatches or, if it happens to pass, a check that isn't validating what it claims.

🐛 Proposed fix: add per-model seed and thread it through
 `@dataclass`(frozen=True)
 class WanModelSpec:
     id: str
     checkpoint_subdir: str
     prompt: str
     negative_prompt: str | None
     height: int
     width: int
     num_frames: int
     num_inference_steps: int
     guidance_scale: float
+    seed: int
 
 
 `@dataclass`(frozen=True)
 class WanAccuracyCase:
     id: str
     model_id: str
     checkpoint_subdir: str
     golden_file: str
     prompt: str
     negative_prompt: str | None
     height: int
     width: int
     num_frames: int
     num_inference_steps: int
     guidance_scale: float
+    seed: int
     features: FeatureConfigState
     lpips_threshold: float
     WanModelSpec(
         id="wan21",
         ...
         guidance_scale=WAN21_LPIPS_GUIDANCE_SCALE,
+        seed=WAN21_LPIPS_SEED,
     ),
     WanModelSpec(
         id="wan22",
         ...
         guidance_scale=WAN22_LPIPS_GUIDANCE_SCALE,
+        seed=WAN22_LPIPS_SEED,
     ),
                         guidance_scale=model.guidance_scale,
+                        seed=model.seed,
                         features=features,
             result = pipeline.forward(
                 ...
                 guidance_scale=case.guidance_scale,
-                seed=WAN21_LPIPS_SEED,
+                seed=case.seed,
             )

Also applies to: 318-366

🤖 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/examples/visual_gen/test_visual_gen_wan.py` around
lines 80 - 107, Add a seed field to WanModelSpec and WanAccuracyCase, assign
WAN21_LPIPS_SEED or WAN22_LPIPS_SEED in each WAN_MODEL_SPECS entry, and
propagate it when constructing WAN_ACCURACY_CASES. Update
_generate_wan_feature_video to use the case’s seed instead of hardcoding
WAN21_LPIPS_SEED, preserving the correct seed for both WAN 2.1 and WAN 2.2
cases.

@zhaoyuanh-nvidia
zhaoyuanh-nvidia force-pushed the dev/accuracy-feat-test branch 2 times, most recently from 3f348bc to ef82fa2 Compare July 24, 2026 22:08
- split single-device accuracy tests into model-specific modules
- add fixed goldens for FP8 blockwise, NVFP4, and CUDA graph
- register supported feature cases in B200 L0
- record measured test durations

Signed-off-by: Zhaoyuan He <zhaoyuanh@nvidia.com>
@zhaoyuanh-nvidia
zhaoyuanh-nvidia force-pushed the dev/accuracy-feat-test branch from ef82fa2 to a9459ed Compare July 24, 2026 22:19
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