TensorX
返回文献探索

Paper · arXiv 2406.08552

DiTFastAttn: Attention Compression for Diffusion Transformer Models

Zhihang Yuan, Pu Lu, Hanling Zhang, Xuefei Ning, Linfeng Zhang, Tianchen Zhao, Shengen Yan, Guohao Dai, Yu Wang

25 upvotesJune 12, 2024arXiv 预印本
AI 摘要

DiTFastAttn reduces computational complexity in Diffusion Transformers by addressing spatial, temporal, and conditional redundancies.

Diffusion TransformersDiTself-attentionquadratic complexitypost-training compressionWindow Attention with Residual CachingTemporal Similarity ReductionConditional Redundancy EliminationFLOPsspeeduphigh resolution generationPixArt-SigmaOpenSora

Abstract

Diffusion Transformers (DiT) excel at image and video generation but face computational challenges due to self-attention's quadratic complexity. We propose DiTFastAttn, a novel post-training compression method to alleviate DiT's computational bottleneck. We identify three key redundancies in the attention computation during DiT inference: 1. spatial redundancy, where many attention heads focus on local information; 2. temporal redundancy, with high similarity between neighboring steps' attention outputs; 3. conditional redundancy, where conditional and unconditional inferences exhibit significant similarity. To tackle these redundancies, we propose three techniques: 1. Window Attention with Residual Caching to reduce spatial redundancy; 2. Temporal Similarity Reduction to exploit the similarity between steps; 3. Conditional Redundancy Elimination to skip redundant computations during conditional generation. To demonstrate the effectiveness of DiTFastAttn, we apply it to DiT, PixArt-Sigma for image generation tasks, and OpenSora for video generation tasks. Evaluation results show that for image generation, our method reduces up to 88\% of the FLOPs and achieves up to 1.6x speedup at high resolution generation.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号
DiTFastAttn: Attention Compression for Diffusion Transformer Models | TensorX