NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

Haocheng Xi, Shuo Yang, Yilong Zhao, Chenfeng Xu, Muyang Li, Xiuyu Li, Yujun Lin, Han Cai, Jintao Zhang, Dacheng Li, Jianfei Chen, Ion Stoica, Kurt Keutzer, Song Han · DOI

TL;DR

This paper introduces Sparse VideoGen (SVG), a training-free framework that significantly accelerates video diffusion transformers by exploiting inherent spatial and temporal sparsity in their attention mechanisms. By dynamically classifying attention heads and optimizing their computation, SVG achieves up to 2.33x speedup without sacrificing generation quality, making high-fidelity video generation more practical.

What Problem Does This Paper Address?

Diffusion Transformers (DiTs) have revolutionized video generation, producing impressive results. However, their computational cost, particularly the 3D full attention mechanism, is a major bottleneck, requiring tens of minutes to generate just a few seconds of video even on powerful GPUs. This quadratic complexity with respect to context length severely limits their real-world applicability. The paper aims to address this inefficiency by making video generation faster without requiring retraining or compromising the quality of the generated videos.

Methods

The core of Sparse VideoGen (SVG) lies in its ability to leverage the inherent sparsity within the 3D full attention mechanism of video diffusion models. The authors observe that attention heads can be broadly categorized into two types:

  • Spatial Heads: These heads primarily focus on tokens within the same frame, contributing to the spatial coherence of the generated video.
  • Temporal Heads: These heads attend to tokens at the same spatial location across different frames, crucial for temporal consistency.

SVG employs a training-free framework that includes:

  1. Online Profiling Strategy: To identify the type of each attention head dynamically and efficiently, SVG uses an online profiling strategy. It samples a small percentage of tokens and computes attention using both full attention and two sparse attention patterns (spatial and temporal). The pattern with the lowest Mean Squared Error (MSE) compared to full attention is selected for that head. This process incurs minimal overhead (around 3%).
  2. Hardware-Efficient Layout Transformation: Temporal heads often exhibit a non-contiguous sparsity pattern that is inefficient for hardware accelerators like Tensor Cores. SVG introduces a novel layout transformation that reorders these non-contiguous elements into a contiguous format, enabling efficient hardware utilization.
  3. Customized Kernel Implementations: The framework leverages customized kernels implemented using Triton and FlashInfer to optimize the sparse attention computations and the layout transformation.
  4. FP8 Quantization Compatibility: SVG is shown to be compatible with FP8 quantization, allowing for further efficiency gains without significant quality degradation.

Datasets

The paper evaluates SVG on representative open-sourced video generative models. The specific datasets used for evaluation are:

  • CogVideoX-v1.5-I2V and CogVideoX-v1.5-T2V: These models were evaluated using the VBench dataset, with prompt optimization as suggested by the CogVideoX authors.
  • HunyuanVideo-T2V: This model was benchmarked using prompts from the Penguin Video Benchmark released by HunyuanVideo.

Key Insights and Ideas

  • Inherent Sparsity in Video Attention: The most significant insight is the discovery of distinct, inherent spatial and temporal sparsity patterns within attention heads of video diffusion models. This is a crucial observation that differentiates video data from text data, where previous sparse attention methods were primarily token-focused.
  • Dynamic Head Classification: The realization that attention head types are not fixed but can be dynamic across different denoising steps and input prompts necessitates an online, adaptive approach to sparsity identification.
  • Hardware-Aware Sparsity Optimization: Simply identifying sparsity isn't enough; making it computationally efficient on hardware requires specific optimizations like the proposed layout transformation for temporal heads.
  • Training-Free Efficiency: The ability to achieve significant speedups without any additional training or fine-tuning is a major advantage, making the method broadly applicable to existing pre-trained models.

Key Results

SVG demonstrates substantial improvements in inference speed while maintaining high generation quality:

  • Speedup:
    • Up to 2.28x end-to-end speedup on CogVideoX-v1.5 (Image-to-Video and Text-to-Video).
  • Up to 2.33x end-to-end speedup on HunyuanVideo (Text-to-Video).
  • A detailed breakdown shows that sparse attention itself contributes a significant portion of this speedup (e.g., 1.81x on HunyuanVideo).
  • Quality:
    • Maintains high PSNR (e.g., exceeding 29.55 on HunyuanVideo and 29.99 on CogVideoX-v1.5-T2V).
  • Consistently outperforms baselines in PSNR, SSIM, and LPIPS.
  • Qualitative results (Figures 6, 9, 10, 11) show that SVG preserves high pixel-level fidelity and temporal consistency, matching or exceeding dense attention outputs.
  • Efficiency Optimizations:
    • Customized QK-norm and ROPE kernels achieve an average speedup of 7.4x and 15.5x, respectively.
  • FP8 quantization further boosts throughput by up to 1.3x with a minimal PSNR drop.

Limitations and Future Work

  • Adaptive Sparsity Control: While the paper demonstrates that SVG maintains good quality across various sparsity ratios, it suggests that adaptive sparsity control for different scenarios could be a direction for future work.
  • Hardware-Specific Optimizations: The paper mentions that the effectiveness of certain optimizations (like FP8 quantization) can be hardware-dependent (e.g., limited arithmetic intensity on smaller head dimensions).
  • Theoretical vs. Practical Speedup: The paper notes that while temporal heads offer theoretical speedup, achieving practical speedup requires hardware-efficient implementations like the proposed layout transformation. The authors aim to bridge this gap.

Summary updated

BibTeX
@inproceedings{xi2025sparse,
  author = {Haocheng Xi and Shuo Yang and Yilong Zhao and Chenfeng Xu and Muyang Li and Xiuyu Li and Yujun Lin and Han Cai and Jintao Zhang and Dacheng Li and Jianfei Chen and Ion Stoica and Kurt Keutzer and Song Han},
  title = {{Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=u8CA3qIS0V},
}
Figure