Repository navigation
[Fix] diffusion/ltx: Keep tiled VAE decode off the sharded convs under parallel decode - #45942
Merged
Merged
Conversation
…r parallel decode With more than one decode rank (CFG parallel, TP or SP), the LTX VAE swaps its convs for spatially sharded ones that exchange halo rows with the neighbouring rank. The tiled decode, on by default, fed each whole tile to those convs unsplit, so every rank stitched its neighbour's rows into its own tile edges: rank 0's saved video was wrong in the bottom rows of every tile, and the halo traffic made the tiled decode slower than on one rank. Every decoder call now either runs on this rank's height split or bypasses the sharded convs: - the height split replaces tiling when each rank's rows fit in a tile, so a rank still decodes at most one tile's area at once; - otherwise every rank tiles the whole clip, exactly as on one rank; - framewise decoding and the streaming decode_chunk follow the same rule. Drop the "vae_sp requires vae_tiling" check: vae_sp gates nothing at runtime and the height split never uses tiles, so --vae-tiling false is valid on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mickqian
requested review from
AgainstEntropy,
BBuf,
HaiShaw,
kevin-mii,
niehen6174,
ping1jing2 and
yichiche
as code owners
October 23, 2026 02:23
Collaborator
Author
|
/tag-and-rerun-ci |
This was referenced Oct 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
With more than one decode rank (CFG parallel, TP or SP), the LTX VAE installs spatially sharded convs that exchange halo rows with the neighbouring rank. Those convs expect each rank to hold its own height split. But:
_decodechecked tiling before the sharded path;tiled_decode,_temporal_tiled_decodeanddecode_chunkcalled the decoder on whole tensors while the sharded convs were installed.So each rank blended its neighbour's copy of the same tile into its own edge rows.
Decoding a real LTX-2 latent (768x512x121) on 2xH200, with 2 decode ranks compared against 1:
This affects the LTX-2, LTX-2.3 and LTX-2.5 conv VAE on multiple GPUs with default flags, and SANA-WM's streaming
decode_chunk. The Wan and Hunyuan VAEs are not affected.Modifications
ltx_2_vae.py: every decoder call now either runs on this rank's height split or bypasses the sharded convs (new_decode_spatial).disable_spatial_parallel_decode(), exactly as on one rank. Large frames keep per-rank tiling because at 1920x1088 the untiled sharded path costs 28–38 GB more per rank.decode_chunkbypasses the sharded convs.pipeline_configs/base.py: drop the "vae_sp requires vae_tiling" check.vae_spgates nothing at runtime, and the height split never uses tiles, so--vae-tiling falsenow works on its own.New test
test/unit/test_ltx_vae_parallel_decode.py: two gloo ranks on CPU decode a tiny LTX-2 VAE with sharded convs and compare against one rank on 5 paths:spatial_shard;decode_chunk.Follow-up, not fixed here: the diffusers 2D VAE has the same ordering bug, but only with tiling plus the opt-in
--vae-config.parallel-decode-mode spatial_shard.Accuracy Tests
test_ltx_vae_parallel_decode.py: main fails on all 5 paths, with max abs error 1.00–1.24 across the two ranks. This PR matches one rank exactly (0.0).Speed Tests and Profiling
LTX-2 on 2xH200. On main, the halo traffic on whole tiles made the tiled decode slower than on one rank.
At 768x512, e2e is −4.7% / −2.8% over two interleaved rounds, and memory is 1.7 GB lower per rank.
Checklist
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ✅ Run #39889302861
Latest PR Test (Extra): ❌ Run #39889302814
Latest PR Test (AMD ROCm 10): ❌ Run #39889302907