arXiv:2509.24006cs.LGcs.AI2025-09被引 47

通过稀疏与低秩结合,让扩散模型注意力提速20倍且不丢质量

SLA: Beyond Sparsity in Diffusion Transformers via Fine-Tunable Sparse-Linear Attention

  • 将注意力权重分为关键、边缘、可忽略三类,分别用不同计算方式处理
  • 注意力计算量减少95%,视频生成端到端速度提升2.2倍,质量无损
  • 支持梯度回传,仅需少量微调即可部署,适合视频生成场景

在扩散变换器(DiT)模型中,尤其是视频生成任务中,注意力机制因序列过长和二次复杂度成为主要瓶颈。我们发现注意力权重可划分为两部分:少量高秩的大权重和大量低秩的其余权重。基于此,提出可微调的稀疏-线性注意力(SLA),融合稀疏与线性注意力以加速扩散模型。SLA将权重分为关键、边际和可忽略三类,对关键项使用O(N²)计算,边际项使用O(N),忽略可忽略项。三类计算整合为单个GPU核函数,支持前向与反向传播。仅需少量微调,即可实现20倍的注意力计算降低,显著加速模型,且生成质量无损。实验表明,SLA将注意力计算减少95%以上,优于基线方法。我们还实现了高效GPU内核,在Wan2.1-1.3B上带来13.7倍注意力加速和2.2倍端到端视频生成加速。代码已开源。

原文摘要 · Abstract (English)

In Diffusion Transformer (DiT) models, particularly for video generation, attention latency is a major bottleneck due to the long sequence length and the quadratic complexity. We find that attention weights can be separated into two parts: a small fraction of large weights with high rank and the remaining weights with very low rank. This naturally suggests applying sparse acceleration to the first part and low-rank acceleration to the second. Based on this finding, we propose SLA (Sparse-Linear Attention), a trainable attention method that fuses sparse and linear attention to accelerate diffusion models. SLA classifies attention weights into critical, marginal, and negligible categories, applying O(N^2) attention to critical weights, O(N) attention to marginal weights, and skipping negligible ones. SLA combines these computations into a single GPU kernel and supports both forward and backward passes. With only a few fine-tuning steps using SLA, DiT models achieve a 20x reduction in attention computation, resulting in significant acceleration without loss of generation quality. Experiments show that SLA reduces attention computation by 95% without degrading end-to-end generation quality, outperforming baseline methods. In addition, we implement an efficient GPU kernel for SLA, which yields a 13.7x speedup in attention computation and a 2.2x end-to-end speedup in video generation on Wan2.1-1.3B. The code is available at https://github.com/thu-ml/SLA.

扩散模型注意力加速稀疏计算视频生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。