Fast Video Generation with Sliding Tile Attention

Peiyuan Zhang, Yongqi Chen, Runlong Su, Hangliang Ding, Ion Stoica, Zheng Liu, Hao Zhang

arXiv:2502.04507 · 2026-07-27 공개 · arXiv · PDF

video-generation video-diffusion diffusion-transformers latency-reduction flashattention hunyuanvideo attention-optimization dit-models

Abstract

Diffusion Transformers (DiTs) with 3D full attention power state-of-the-art video generation, but suffer from prohibitive compute cost -- when generating just a 5-second 720P video, attention alone takes 800 out of 945 seconds of total inference time. This paper introduces sliding tile attention (STA) to address this challenge. STA leverages the observation that attention scores in pretrained video diffusion models predominantly concentrate within localized 3D windows. By sliding and attending over the local spatial-temporal region, STA eliminates redundancy from full attention. Unlike traditional token-wise sliding window attention (SWA), STA operates tile-by-tile with a novel hardware-aware sliding window design, preserving expressiveness while being hardware-efficient. With careful kernel-level optimizations, STA offers the first efficient 2D/3D sliding-window-like attention implementation, achieving 58.79% MFU. Precisely, STA accelerates attention by 2.8-17x over FlashAttention-2 (FA2) and 1.6-10x over FlashAttention-3 (FA3). On the leading video DiT, HunyuanVideo, STA reduces end-to-end latency from 945s (FA3) to 685s without quality degradation, requiring no training. Enabling finetuning further lowers latency to 268s with only a 0.09% drop on VBench. We make our codebase public at https://github.com/hao-ai-lab/FastVideo.

한국어 요약

한 줄 요약

Sliding Tile Attention (STA)는 3D full attention 기반의 비디오 생성 모델에서 계산 비용을 2.8–17배 가속화하는 하드웨어 최적화된 어텐션 메커니즘입니다.

핵심 기여도

핵심 아이디어

기존 3D full attention은 모든 토큰 간의 관계를 고려하기 때문에 계산 비용이 매우 높습니다. 그러나 연구자들은 pre-trained 비디오 diffusion 모델에서 어텐션 점수가 대부분 **로컬 3D 윈도우** 내에 집중되어 있음을 관찰했습니다. 이는 **3D locality** 패턴으로, 전체 토큰 공간의 15.52%에 불과한 윈도우가 70%의 어텐션 점수를 차지한다는 수치로 입증되었습니다. 이 관찰을 바탕으로, 기존의 token-wise sliding window attention (SWA) 대신, **tile-by-tile 기반의 STA**를 제안합니다. STA는 하드웨어 최적화된 방식으로, **producer-warpgroup**과 **consumer-warpgroup**의 비동기 데이터 로딩과 계산을 통해 **explicit attention masking**을 제거하고, **58.79%의 MFU**를 달성합니다. 이는 기존 SWA 구현이 불규칙한 어텐션 마스크로 인해 GPU unfriendly한 문제를 해결한 것입니다.

기술적 접근법

주요 결과

의의 및 한계

실용적 활용