TL;DR
HyperVAttention (HVA) is a training-free sparse attention framework designed to accelerate Video Diffusion Transformers (VDiTs). By exploiting the spatio-temporal locality of video tokens and aligning sparse attention blocks with GPU hardware constraints, HVA achieves up to a $2.23\times$ end-to-end speedup on state-of-the-art models like HunyuanVideo and Wan2.2 while fully preserving visual fidelity.
What Problem Does This Paper Address?
Video Diffusion Transformers (VDiTs) excel at generating high-fidelity videos, but their computational appetite scales quadratically with video duration due to the self-attention mechanism. To mitigate this, recent methods group semantically similar tokens using clustering (like $k$-means) to form sparse attention blocks.
However, existing clustering-based sparse attention methods hit two major efficiency bottlenecks:
- High Clustering Overhead: Standard global clustering algorithms compare every token against every centroid, creating a massive computational bottleneck that negates the savings from attention sparsity.
- Hardware Misalignment: Clustered token groups vary in size and shape. When mapped to fixed GPU execution blocks—specifically Cooperative Thread Arrays (CTAs) or tiles—they require heavy padding. This results in low thread utilization, meaning theoretical token sparsity does not translate into actual wall-clock speedups.
Methods
HyperVAttention introduces three core components to tackle these bottlenecks without requiring any model retraining:
- 3D Local-Window Clustering: Instead of performing an expensive global centroid search, HVA restricts the search space to a fixed 3D local neighborhood (time, height, width). This leverages the natural spatio-temporal coherence of video data. To make this highly efficient, the authors implemented a custom Triton kernel that computes these local assignments on the fly using index arithmetic, avoiding high memory overhead.
- Hybrid Clustering Strategy: Rather than re-clustering all tokens at every single denoising step, HVA performs full clustering only at designated "anchor steps." For intermediate steps, it uses Lowe's ratio (the distance ratio between the nearest and second-nearest centroids) to identify and update only the most "unstable" tokens near cluster boundaries, drastically reducing redundant updates.
- Hardware-Aware Cluster Merging: To fix the tile misalignment problem, HVA formulates execution costs as a hardware minimization problem. It uses a parallel agglomerative merging algorithm to combine query clusters with similar key selections. This fills up underutilized GPU tiles, effectively gaining higher approximation accuracy for "free" within the already-padded tile capacity.
Datasets
The authors evaluated HyperVAttention on two prominent large-scale open-source video generation models:
- Wan2.2 (14B) for both Image-to-Video (I2V) and Text-to-Video (T2V) tasks.
- HunyuanVideo (13B) for Text-to-Video generation.
For evaluation benchmarks, they utilized:
- VBench: A comprehensive evaluation suite for video generative models.
- Penguin Benchmark: A dataset providing optimized prompts derived from VBench for text-to-video evaluation.
Key Insights and Ideas
- Spatio-Temporal Redundancy is Local: Visualizing video latent features via PCA reveals that adjacent tokens naturally fall into identical or highly similar clusters. Global search is simply overkill for video tokens.
- Temporal Stability of Clusters: Token cluster assignments remain remarkably stable across adjacent denoising steps. Beyond the initial steps, fewer than 30% of token assignments change, meaning full re-clustering at every step is a waste of compute.
- Theoretical Sparsity $\neq$ Hardware Speed: A sparse mask with 39.7% theoretical density can still demand 50.4% CTA density on a GPU due to padding. Designing algorithms around the fixed tile structures of modern GPU kernels (like FlashAttention) is mandatory for real-world acceleration.
Key Results
HyperVAttention establishes a new Pareto frontier for training-free sparse attention in video diffusion:
- Inference Speedup: HVA achieves up to a $2.13\times$ speedup on HunyuanVideo and $1.80\times$ on Wan2.2. An aggressive variant, HVA-Flash, pushes these speedups to $2.23\times$ and $1.86\times$, respectively.
- Fidelity Preservation: On HunyuanVideo T2V, HVA achieves a PSNR of 33.97 and an LPIPS of 0.046, significantly outperforming the previous state-of-the-art clustering baseline, SVG2 (32.66 PSNR / 0.056 LPIPS).
- Kernel Efficiency: The custom Triton kernel for 3D local-window clustering achieves up to a $411\times$ speedup over a naive PyTorch implementation, reducing the clustering phase latency by over $3.1\times$ compared to SVG2.
Limitations and Future Work
The authors note that the benefits of HyperVAttention are most pronounced in scenarios involving long-duration videos, where the self-attention mechanism dominates the total runtime. For standard image generation or very short video clips, the overhead of clustering and merging might diminish the relative latency gains. Future work could explore extending these hardware-aligned clustering mechanics to training-time architectures or optimizing them for short-context scenarios.
Summary updated