Skip to content

Support LTX-Video-2B with NVFP4 on Blackwell - #57

Open
Uxito-Ada wants to merge 6 commits into
Tele-AI:mainfrom
Uxito-Ada:pan2-nvfp4
Open

Uxito-Ada wants to merge 6 commits into
Tele-AI:mainfrom
Uxito-Ada:pan2-nvfp4

Conversation

@Uxito-Ada

@Uxito-Ada Uxito-Ada commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Support Ltx-video-2B with LTXVideo2BPipeline(BasePipeline) and LTXVideo2BGenerationStage(BaseStage).
  • Add a TeleFuser NVFP4 op that selects transformer Linear layers, applies dynamic-activation W4A4, and enables the Blackwell Triton dispatch after GPU placement.
  • Keep T5, temporal/cross-attention, conditioning, and output projections in BF16.
  • Add RTX 5090 example, documentation and unit tests.

Workload

  • Inputs match the official Diffusers LTX-Video example: official two-woman close-up prompt and negative prompt, 768x512, 161 frames, 24 FPS, 50 steps, seed 123, CFG 3.0, decode_timestep=0.03, and decode_noise_scale=0.025.

  • Hardware: NVIDIA GeForce RTX 5090 Laptop GPU, 24 GiB, SM120; PyTorch 2.14.0+cu132; CUDA 13.2; TorchAO 0.17.0. Time includes prompt encoding, denoising, and VAE decode, and excludes model loading and MP4 encoding.

RTX 5090 Results

RTX 5090 TeleFuser NVFP4 vs BF16

NVFP4 is 1.23x faster end to end. BF16 has lower peak allocated VRAM because the official baseline moves complete model stages between CPU and GPU. NVFP4 keeps the quantized transformer and VAE resident to avoid PCIe transfers in every denoising step. Neither configuration is real-time.

Video Quality

Full-DiT W4A4 quantized 287 Linear layers and produced visible frame-to-frame illumination instability. The default quality profile applies real dynamic W4A4 to the 56 FFN Linear layers, which contain most DiT GEMM work, while retaining the temporal and conditioning paths in BF16.

Quality is measured against the aligned BF16 output, not from each video's standalone brightness. All comparisons use the same prompt, negative prompt, seed, sampler, geometry, frame count, and decode settings.

Candidate vs BF16 Normalized RMSE PSNR SSIM Mean VIF, 4 scales
Full-DiT W4A4 0.1144 18.83 dB 0.8580 0.2271
FFN W4A4 quality 0.0676 23.40 dB 0.9080 0.4040

Lower RMSE is better; higher PSNR, SSIM, and VIF are better. Relative to full-DiT W4A4, the quality profile reduces normalized RMSE to BF16 by 40.9%, adds 4.56 dB PSNR, and improves both structural and perceptual similarity.

  • TeleFuser NVFP4:
ltx-telefuser-nvfp4.mp4
  • BF16 baseline:
ltx-official-bf16.mp4

Both files decode as 768x512, 161 frames at 24 FPS.

Usage

from telefuser.pipelines.ltx_video_2b import LTXVideo2BPipeline

pipe = LTXVideo2BPipeline.from_pretrained(
    "/path/to/ltx-video-2b",
    quantization="nvfp4",
    nvfp4_profile="quality",
)
frames = pipe("A cinematic close-up of two women talking", seed=123)

The complete CLI example is examples/ltx_video_2b/ltx_video_2b_t2v_nvfp4_5090.py; its README is registered in docs/cookbook.yml.

Validation

  • Real RTX 5090 official workload: 161 frames, 50 steps, MP4 inspected at nine evenly spaced frames.
  • Public example CLI: real 256x256, 9-frame, 4-step W4A4 smoke generation.
  • pytest: 26 relevant pipeline/op/quality-comparison/Cookbook tests passed.
  • Ruff lint and format checks passed.

@Uxito-Ada
Uxito-Ada marked this pull request as draft November 24, 2026 01:38
@Uxito-Ada Uxito-Ada changed the title [NVFP4] Benchmark LTX-Video 2B on Blackwell Optimize LTX-Video-2B with NVFP4 on Blackwell Nov 26, 2026
@Uxito-Ada
Uxito-Ada marked this pull request as ready for review November 26, 2026 02:19
@Uxito-Ada
Uxito-Ada requested a review from lzx1413 November 26, 2026 02:19
@Uxito-Ada Uxito-Ada changed the title Optimize LTX-Video-2B with NVFP4 on Blackwell Support LTX-Video-2B with NVFP4 on Blackwell Nov 26, 2026

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.

1 participant