슬라이딩 타일 어텐션을 이용한 빠른 비디오 생성
Fast Video Generation with Sliding Tile Attention
February 6, 2025
저자: Peiyuan Zhang, Yongqi Chen, Runlong Su, Hangliang Ding, Ion Stoica, Zhenghong Liu, Hao Zhang
cs.AI
초록
3D 전체 주의력을 갖는 확산 트랜스포머(DiTs)는 최첨단 비디오 생성 기술을 제공하지만, 계산 비용이 지나치게 높습니다. 720P 5초 비디오를 생성할 때, 주의력만이 총 추론 시간 중 945초 중 800초를 차지합니다. 본 논문은 이러한 도전에 대처하기 위해 슬라이딩 타일 주의력(STA)을 소개합니다. STA는 사전 학습된 비디오 확산 모델에서 주의 점수가 주로 지역화된 3D 창 내에 집중되는 것을 활용합니다. 지역 공간-시간 영역을 슬라이딩하고 주의를 기울이는 STA는 전체 주의력의 중복을 제거합니다. 전통적인 토큰별 슬라이딩 윈도우 주의력(SWA)와는 달리, STA는 하드웨어에 대한 인식을 고려한 새로운 슬라이딩 윈도우 디자인으로 타일 단위로 작동하여 표현력을 유지하면서 하드웨어 효율성을 확보합니다. 세심한 커널 수준의 최적화를 통해, STA는 58.79%의 MFU를 달성하며, 효율적인 2D/3D 슬라이딩 윈도우와 유사한 주의력 구현을 제공합니다. 구체적으로, STA는 FlashAttention-2(FA2)보다 2.8-17배, FlashAttention-3(FA3)보다 1.6-10배 주의력을 가속화합니다. 주요 비디오 DiT인 HunyuanVideo에서, STA는 품질 저하 없이 FA3의 945초의 종단 간지연을 685초로 줄이며, 추가 훈련이 필요하지 않습니다. 세밀한 조정을 허용하여 간단한 VBench 하락만으로 268초의 감소된 지연 시간을 달성합니다.
English
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.Summary
AI-Generated Summary