TL;DR
PSA (Parameterized Stripe Attention) significantly accelerates video generation by exploiting a newly discovered structural regularity in Diffusion Transformers: periodic diagonal stripes in attention maps. By formalizing these patterns into a six-parameter mask and deploying a hardware-optimized CUDA kernel, PSA achieves up to 1.57× end-to-end speedups over FlashAttention-3 with nearly lossless visual quality.
What Problem Does This Paper Address?
Diffusion Transformers (DiTs) have become the gold standard for high-quality video generation (powering models like Sora, Wan 2.1, and HunyuanVideo). However, they are notoriously slow. The primary bottleneck is the full spatio-temporal 3D attention, which accounts for over 60% of inference time.
Existing attempts to solve this via "sparse attention" (only calculating the most important token interactions) fall into two traps:
- Rigid Efficiency: Methods like STA use predefined, fixed masks. They are fast but can't capture the diverse, complex attention patterns across different model layers.
- Flexible Overhead: Methods like SVG2 determine masks dynamically at runtime. While flexible, the overhead of calculating the mask and the resulting irregular memory access often negate the speed gains from sparsity.
The authors identify a missing link: a unified structural characterization of DiT attention that is both flexible enough to be accurate and structured enough to be hardware-efficient.
Methods
The core of the paper is the PSA framework, which consists of three main components:
- Structural Analysis: The authors prove that attention in video DiTs isn't arbitrary. Instead, it manifests as periodic diagonal stripes. This arises from two factors: spatio-temporal redundancy (tokens attend to their neighbors) and RoPE-3D periodicity (rotary positional embeddings introduce a cosine-like repetition in attention scores).
- Parameterized Mask ($M$): They formalize these stripes using six integer parameters: width ($w$), offset ($o$), and stride ($s$) for both temporal ($T$) and spatial ($S$) dimensions. This single formulation can represent diverse patterns, including intra-frame, inter-frame, hybrid, and uniform attention. Visualization of the PSA parameterization
- PSA-Kernel: To make this practical, they developed a custom CUDA kernel using the ThunderKittens library. It uses a producer-consumer model to prefetch only the necessary data blocks into SRAM, achieving hardware utilization (MFU) close to the highly optimized FlashAttention-3.
- PSA-Search: Since attention patterns are remarkably stable across different prompts (a property called prompt invariance), the authors use an offline, training-free search algorithm. It finds the highest possible sparsity for each individual attention head that stays within a user-defined error tolerance.
Datasets
The authors evaluated PSA on two state-of-the-art open-source video generation models:
- Wan 2.1 (14B): 81-frame sequences at 720×1280.
- HunyuanVideo: Tested at both 720×1280 (129 frames) and 768×1280 (117 frames).
- VBench: A comprehensive benchmark for video generation quality (consistency, style, etc.) was used for holistic evaluation.
Key Insights and Ideas
- The "Aha" Moment for Stripes: The discovery that RoPE-3D actually causes the periodic stripes is a significant theoretical contribution. By decomposing the attention logit, they show that a dominant RoPE channel effectively turns the attention mechanism into a periodic signal. Heat maps showing periodic stripe structures
- Prompt Invariance: The finding that attention masks don't change much between "a cat flying" and "a car racing" allows for offline optimization. This eliminates the runtime overhead that plagues other dynamic sparse attention methods. Evaluation of similarity across prompts
- Block-wise Granularity: Instead of masking individual tokens, PSA operates on "PSABlocks." This aligns with how GPUs actually process data (Streaming Multiprocessors), ensuring that the hardware isn't left idling while waiting for sparse data.
Key Results
PSA demonstrates a superior trade-off between speed and quality compared to previous state-of-the-art methods like SVG2 and STA.
- Speedup: Achieved 1.57× end-to-end speedup on HunyuanVideo and 1.37× on Wan 2.1 compared to FlashAttention-3 baselines.
- Efficiency: The PSA-Kernel achieves 61% Model FLOPs Utilization (MFU), significantly higher than other sparse kernels (which often hover around 30-40%).
- Quality: Even at ~60% sparsity, the visual degradation is minimal. PSA maintained a PSNR > 30 on HunyuanVideo, outperforming all other sparse baselines in both frame-level fidelity (MSE, SSIM) and holistic video quality (VBench scores). Overview of the PSA framework and search process
Limitations and Future Work
- Domain Specificity: The current work is tailored for video DiTs. It remains to be seen if these periodic stripe patterns are as prevalent or exploitable in Large Language Models (LLMs).
- Search Cost: While the search is offline and only needs to be done once per model, it still requires significant compute (2.5 hours on 8 H100 GPUs). The authors suggest a future two-stage search (coarse-to-fine) to reduce this cost.
- Visual Artifacts: While quantitative metrics are high, extreme sparsity can still lead to minor quality loss, which might be sensitive in high-end production environments.
Summary updated