Skip to content

LTX-2 quantization example: filter calibration extra-params, document supported LTX commit - #2869

Open
Edwardf0t1 wants to merge 1 commit into
mainfrom
fix/ltx2-example-extra-params
Open

Edwardf0t1 wants to merge 1 commit into
mainfrom
fix/ltx2-example-extra-params

Conversation

@Edwardf0t1

@Edwardf0t1 Edwardf0t1 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: Bug fix (partial; the port to the new LTX API is a follow-up). NVBug 6932665.

  • _create_ltx2_pipeline no longer forwards calibration-only --extra-param keys (height, width, num_frames, frame_rate, seed, images, tiling_config) to the TI2VidTwoStagesPipeline constructor, where they raised TypeError. calibration.py still reads them.
  • The LTX-2 README section now states the LTX-2 commit the example targets (28c3c73, which has QuantizationPolicy.fp8_cast() and checkpoint_path/gemma_root), with a pip install line, and says newer releases are unsupported.

Not fixed here (follow-up): the example still fails on current LTX-2 releases (QuantizationPolicy.fp8_cast removed; TI2VidTwoStagesPipeline now takes model_paths: ModelPaths). Porting pipeline_manager.py to the new API needs real LTX packages and model assets to validate. The pinned commit predates LTX's Transformers-v5 adaptation, so it may not install alongside ModelOpt's transformers>=5.5; the pin documents the API the example was written against, not a verified combination.

Usage

python quantize.py --model ltx-2 --format fp4 ... --extra-param height=512

Testing

Pre-commit passed. Not run: no LTX packages or assets were available, so neither the filter nor the pin has been exercised. No test added (it needs the LTX packages).

Before your PR is "Ready for review"

  • Is this change backward compatible?: ✅
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A
  • Did you write any new necessary tests?: ❌ needs LTX packages/assets
  • Did you update Changelog?: N/A
  • Did you get Claude approval on this PR?: ❌

Additional Information

NVBug 6932665.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • LTX-2 FP4 pipeline setup now avoids passing calibration-only settings into pipeline initialization.
  • Documentation

    • Updated the LTX-2 FP4 example with compatible package versions and required configuration details, including a warning that newer releases are incompatible.

…nt supported LTX commit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Zhiyu Cheng <zhiyuc@nvidia.com>
@Edwardf0t1
Edwardf0t1 requested a review from a team as a code owner October 19, 2026 05:40
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/Model-Optimizer/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 9e1285ac-fae4-42c7-9a2d-72ec6f00d182
📥 Commits

Reviewing files that changed from the base of the PR and between d7cbff3 and 35805cf.

📒 Files selected for processing: 2
  • examples/diffusers/README.md
  • examples/diffusers/quantization/pipeline_manager.py

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

📝 Walkthrough

The LTX-2 FP4 example now removes calibration-only parameters before pipeline construction. Its README documents compatible package versions, installation commands, and API requirements.

Changes: LTX-2 FP4 example

Layer / File(s) Summary
Pipeline parameter filtering and compatibility note
examples/diffusers/quantization/pipeline_manager.py, examples/diffusers/README.md
_create_ltx2_pipeline removes calibration-only parameters before constructing the pipeline. The README documents a compatible package revision, installation commands, and required APIs.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: kevalmorabia97

Merge Risk: ⚪ Minimal · up to 35805

The example filters calibration-only parameters and documents an install target matching its required API. No actionable merge risk is established by the supplied evidence.

Pre-merge checks: Passed 5 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 and concisely describes both main changes: filtering calibration extra parameters and documenting the supported LTX-2 commit.
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.
Security Anti-Patterns Passed The pull request changes only examples/diffusers/README.md and examples/diffusers/quantization/pipeline_manager.py. The Python addition only removes calibration parameters from a dictionary. It ad…
Full details: Security Anti-Patterns

Explanation

The pull request changes only examples/diffusers/README.md and examples/diffusers/quantization/pipeline_manager.py. The Python addition only removes calibration parameters from a dictionary. It adds no torch.load(..., weights_only=False), numpy.load(..., allow_pickle=True), hardcoded trust_remote_code=True, eval(), exec(), or # nosec. No pyproject.toml or requirements.txt file changed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.99%. Comparing base (d7cbff3) to head (35805cf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2869   +/-   ##
=======================================
  Coverage   76.99%   76.99%           
=======================================
  Files         658      658           
  Lines       73950    73950           
=======================================
  Hits        56939    56939           
  Misses      17011    17011           
Flag Coverage Δ
examples-diffusers 20.05% <ø> (ø)
unit 60.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cjluo-nv cjluo-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.

Bot review (bedrock-claude-opus-5-5) — DM the bot to share feedback.

Nudging: the filter is correct, but neither it nor the documented LTX-2 pin has been run, so an owner with an LTX setup should confirm both.

Needs action:

  • Confirm quantize.py --model ltx-2 ... --extra-param height=512 gets past TI2VidTwoStagesPipeline(...) construction on LTX-2 commit 28c3c73.
  • Confirm the README's pip install ...@28c3c73 line installs alongside ModelOpt's transformers>=5.5. If it doesn't, say so in the note so users don't hit a dependency conflict.
  • Consider adding a small unit test that mocks ltx_core/ltx_pipelines in sys.modules. It would check that the calibration-only keys never reach the constructor kwargs.

No action needed:

  • The 7 removed keys (seed, height, width, num_frames, frame_rate, images, tiling_config) are exactly the ones _run_ltx2_calibration reads from extra_params. The keys are removed from a copy (dict(self.config.extra_params)), so calibration still sees them.
  • The README note is a version pin, not a licensing change. It sits next to the existing LTX license notice.

This branch has not been deployed

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

2 participants