Sparse-vDiT: 희소 주의 메커니즘의 힘을 발휘하여 비디오 확산 트랜스포머 가속화
Sparse-vDiT: Unleashing the Power of Sparse Attention to Accelerate Video Diffusion Transformers
June 3, 2025
저자: Pengtao Chen, Xianfang Zeng, Maosen Zhao, Peng Ye, Mingzhu Shen, Wei Cheng, Gang Yu, Tao Chen
cs.AI
초록
디퓨전 트랜스포머(DiTs)가 비디오 생성 분야에서 획기적인 성과를 거두었지만, 이러한 장기간 시퀀스 생성 작업은 여전히 어텐션 메커니즘의 2차 복잡성으로 인해 상당한 추론 지연이 발생합니다. 비디오 디퓨전 트랜스포머(vDiT)의 어텐션 맵을 상세히 분석한 결과, 우리는 세 가지 반복적인 희소성 패턴을 확인했습니다: 대각선, 다중 대각선, 그리고 수직 줄무늬 구조입니다. 또한 3-6%의 어텐션 헤드를 생략할 수도 있습니다. 중요한 점은 이러한 패턴이 레이어 깊이와 헤드 위치와 강한 상관관계를 보이지만, 입력 콘텐츠에 대한 의존성은 제한적이라는 것입니다. 이러한 발견을 바탕으로, 우리는 vDiT를 위한 희소성 가속 프레임워크인 Sparse-vDiT를 제안합니다. 이 프레임워크는 다음과 같이 구성됩니다: 1) 각각의 희소성 패턴에 대해 계산 효율적인 구현으로 밀집 어텐션을 대체하는 패턴 최적화 희소 커널. 2) 하드웨어 인식 비용 모델링을 통해 각 레이어와 헤드에 대해 최적의 희소 계산 전략을 선택하는 오프라인 희소 디퓨전 탐색 알고리즘. 최적의 구성을 결정한 후, 동일한 어텐션 전략을 공유하는 레이어 내의 헤드를 융합하여 추론 효율성을 향상시킵니다. 최신 vDiT 모델(CogVideoX1.5, HunyuanVideo, Wan2.1)에 통합된 Sparse-vDiT는 각각 2.09배, 2.38배, 1.67배의 이론적 FLOP 감소와 1.76배, 1.85배, 1.58배의 실제 추론 속도 향상을 달성하면서도 높은 시각적 충실도를 유지하며, PSNR 값은 각각 24.13, 27.09, 22.59에 도달했습니다. 우리의 연구는 vDiT의 잠재적 구조적 희소성이 장기간 비디오 합성을 위해 체계적으로 활용될 수 있음을 보여줍니다.
English
While Diffusion Transformers (DiTs) have achieved breakthroughs in video
generation, this long sequence generation task remains constrained by the
quadratic complexity of attention mechanisms, resulting in significant
inference latency. Through detailed analysis of attention maps in Video
Diffusion Transformer (vDiT), we identify three recurring sparsity patterns:
diagonal, multi-diagonal, and vertical-stripe structures. And even 3-6\%
attention heads can be skipped. Crucially, these patterns exhibit strong
layer-depth and head-position correlations but show limited dependence on the
input content. Leveraging these findings, we propose Sparse-vDiT, a sparsity
acceleration framework for vDiT comprising: 1) Pattern-optimized sparse kernels
that replace dense attention with computationally efficient implementations for
each identified sparsity pattern. 2) An offline sparse diffusion search
algorithm that selects the optimal sparse computation strategy per layer and
head via hardware-aware cost modeling. After determining the optimal
configuration, we fuse heads within the same layer that share the same
attention strategy, enhancing inference efficiency. Integrated into
state-of-the-art vDiT models (CogVideoX1.5, HunyuanVideo, and Wan2.1),
Sparse-vDiT achieves 2.09times, 2.38times, and 1.67times theoretical
FLOP reduction, and actual inference speedups of 1.76times, 1.85times,
and 1.58times, respectively, while maintaining high visual fidelity, with
PSNR values reaching 24.13, 27.09, and 22.59. Our work demonstrates that latent
structural sparsity in vDiTs can be systematically exploited for long video
synthesis.