Skip to content

Fix image calibration VAE decode crash - #2435

Open
mikemikimike wants to merge 1 commit into
NVIDIA:mainfrom
mikemikimike:fix/issue-2424-latent-calibration
Open

mikemikimike wants to merge 1 commit into
NVIDIA:mainfrom
mikemikimike:fix/issue-2424-latent-calibration

Conversation

@mikemikimike

@mikemikimike mikemikimike commented Sep 15, 2026

Copy link
Copy Markdown

Request latent outputs during image-model calibration so VAE decoding is skipped. Add an offline regression test for the calibration call contract. Testing: pytest tests/examples/diffusers/test_calibration.py; pytest tests/unit tests/examples/diffusers/test_calibration.py; pre-commit run --all-files. Issue: #2424. Fixes #2424

Summary by CodeRabbit

  • Bug Fixes

    • Calibration now requests latent outputs by default, avoiding unnecessary image decoding and improving compatibility with latent-based workflows.
  • Tests

    • Added regression coverage to verify latent output requests, configured inference steps, and skipped VAE decoding.

Signed-off-by: mikemikimike <13286568797@163.com>
@mikemikimike
mikemikimike requested review from a team as code owners September 15, 2026 11:46
@mikemikimike
mikemikimike requested a review from mxinO September 15, 2026 11:46
@copy-pr-bot

copy-pr-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6ac3b8d7-444a-4784-ab65-15f4918f36e0

📥 Commits

Reviewing files that changed from the base of the PR and between 3c87751 and 98812e7.

📒 Files selected for processing (2)
  • examples/diffusers/quantization/calibration.py
  • tests/examples/diffusers/test_calibration.py

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


📝 Walkthrough

Walkthrough

The calibration pipeline now requests latent outputs. A regression test verifies the prompt, inference-step count, latent output type, and avoidance of VAE decoding.

Changes

Calibration latent output

Layer / File(s) Summary
Request latent calibration output
examples/diffusers/quantization/calibration.py
The calibration inference call sets output_type="latent".
Validate calibration request
tests/examples/diffusers/test_calibration.py
Isolated test helpers stub dependencies and verify the prompt, configured inference steps, latent output type, and no VAE decoding.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: jingyu-ml

Merge Risk: ⚪ Minimal · up to 98812

The calibration call uses latent output without a conflicting default argument, and focused regression coverage protects the request contract. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preventing the image calibration VAE decode crash. It is concise and specific.
Linked Issues check ✅ Passed Issue #2424 requires SDXL Turbo calibration to avoid the VAE decode path that sends a tuple to GroupNorm. The default image calibration call now sets output_type to "latent", so the pipeline ret…
Out of Scope Changes check ✅ Passed The pull request changes only the image calibration call in examples/diffusers/quantization/calibration.py and adds a focused regression test for that behavior. Both changes directly support issue #…
Security Anti-Patterns ✅ Passed No listed security anti-pattern was introduced. The only production change adds output_type: "latent" to the calibration call. The new test uses controlled importlib loading and does not call `eva…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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.

calling mtq.quantize causes AttributeError: 'tuple' object has no attribute 'dim'

1 participant