Introduction
The field of video generation is currently undergoing a "Transformer revolution," transitioning from traditional U-Net architectures to 3D full-attention Video Diffusion Transformers (vDiTs). While these models produce stunning, temporally consistent videos, they face a significant challenge: quadratic complexity.
The Quadratic Bottleneck
In a vDiT, every token (a small patch of a video frame) attends to every other token across both space and time. For high-resolution, high-frame-rate videos, sequence lengths can exceed 120,000 tokens. As shown in Figure 1, the cost of attention grows quadratically with sequence length, making generation extremely slow on high-end hardware.
Sparse-vDiT Methodology
Sparse-vDiT addresses this bottleneck by identifying and exploiting predictable, input-invariant sparsity patterns in attention maps. The framework consists of three main components:
1. Sparsity Pattern Identification
Detailed analysis of models like CogVideoX and HunyuanVideo reveals that attention maps consistently exhibit specific structures rather than random noise. These patterns, visualized in Figure 5, include:
- Full Attention: Rare global interaction.
- Diagonal: Local spatial/temporal interaction.
- Multi-Diagonal: Interactions across specific frame intervals.
- Vertical-Stripe: "Global tokens" that many other tokens attend to.
2. Offline Sparse Diffusion Search
Because these patterns are largely independent of the specific text prompt and depend mostly on layer depth and head position, Sparse-vDiT uses an offline search. This one-time optimization finds the "best fit" sparse pattern for every head using a hardware-aware cost model that balances error against speedup.
3. Pattern-Optimized Kernels & Head Fusion
To translate theoretical FLOP reductions into real-world speedups, the authors developed specialized Triton and CUDA kernels for each pattern. They also "fuse" heads within the same layer that share patterns to reduce kernel launch overhead.
Key Results
Sparse-vDiT achieves significant acceleration with minimal impact on visual quality:
- Inference Speedups: Actual wall-clock speedups of 1.76× for CogVideoX, 1.85× for HunyuanVideo, and 1.58× for Wan2.1.
- Efficiency: Theoretical FLOPs were reduced by over 2× in several cases.
- Quality Preservation: High visual fidelity is maintained, with PSNR values between 24.13 and 27.09. In some instances, the sparse model even outperformed the dense baseline on quality metrics, likely by removing redundant attention noise.
Conclusion
Sparse-vDiT demonstrates that vDiT sparsity is structural and input-invariant, allowing for powerful offline optimizations. By bridging the gap between theoretical FLOP reductions and wall-clock speedups through custom kernels, it enables more efficient high-quality video generation. Future work may explore adaptive sparsity levels and more complex latent structural patterns.
Summary updated