arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2602.12271cs.CVcs.LG
收藏

MonarchRT:实时视频生成中的高效注意力机制

MonarchRT: Efficient Attention for Real-Time Video Generation

Carnegie Mellon University(卡内基梅隆大学);University at Buffalo(布法罗大学);Morpheus AI

Krish Agarwal, Zhuoming Chen, Cheng Luo, Yongqi Chen, Haizhong Zheng, Xun Huang, Atri Rudra, Beidi Chen

AI总结:

MonarchRT通过结构化注意力参数化方法,实现高效实时视频生成,达到95%的注意力稀疏性,优于现有内核性能。

摘要:

实时视频生成受到扩散变换器中三次方自注意力成本的瓶颈限制,尤其是在实时领域,这种领域既需要少量步骤又需要自回归,其中误差会随时间累积,每个去噪步骤必须携带大量信息。在这一设定中,我们发现先前的稀疏注意力近似方法失效,尽管它们在双向、多步骤扩散中表现良好。具体来说,我们观察到视频注意力并不总是稀疏,而是结合了由时空位置驱动的明显周期性结构以及动态、稀疏的语义对应关系和密集混合,超过了即使oracle top-k注意力的表示能力。基于这一见解,我们提出了Monarch-RT,一种针对视频扩散模型的结构化注意力参数化方法,利用Monarch矩阵来分解注意力。通过适当对齐的块结构和我们扩展的 tiled Monarch 参数化方法,我们实现了高表达性的同时保持计算效率。我们进一步通过微调克服参数化的开销,使用自定义的Triton内核。我们首先验证了Monarch-RT在现有稀疏基线上的高有效性,这些基线仅适用于双向模型。我们进一步发现,当应用于最先进的Self-Forcing模型时,Monarch-RT可以达到95%的注意力稀疏性,而不损失质量,使Monarch-RT成为实时视频生成中高能力稀疏注意力参数化方法的开创性工作。我们的优化实现分别在Nvidia RTX 5090、H100和B200 GPU上优于FlashAttention-2、FlashAttention-3和FlashAttention-4内核,提供了1.4-11.8倍的内核加速。这使我们首次能够在单个RTX 5090上以16 FPS实现真正的实时视频生成。

英文摘要:

Real-time video generation with Diffusion Transformers is bottlenecked by the quadratic cost of 3D self-attention, especially in real-time regimes that are both few-step and autoregressive, where errors compound across time and each denoising step must carry substantially more information. In this setting, we find that prior sparse-attention approximations break down, despite showing strong results for bidirectional, many-step diffusion. Specifically, we observe that video attention is not reliably sparse, but instead combines pronounced periodic structure driven by spatiotemporal position with dynamic, sparse semantic correspondences and dense mixing, exceeding the representational capacity of even oracle top-k attention. Building on this insight, we propose Monarch-RT, a structured attention parameterization for video diffusion models that factorizes attention using Monarch matrices. Through appropriately aligned block structure and our extended tiled Monarch parameterization, we achieve high expressivity while preserving computational efficiency. We further overcome the overhead of parameterization through finetuning, with custom Triton kernels. We first validate the high efficacy of Monarch-RT over existing sparse baselines designed only for bidirectional models. We further observe that Monarch-RT attains up to 95% attention sparsity with no loss in quality when applied to the state-of-the-art model Self-Forcing, making Monarch-RT a pioneering work on highly-capable sparse attention parameterization for real-time video generation. Our optimized implementation outperforms FlashAttention-2, FlashAttention-3, and FlashAttention-4 kernels on Nvidia RTX 5090, H100, and B200 GPUs respectively, providing kernel speedups in the range of 1.4-11.8X. This enables us, for the first time, to achieve true real-time video generation with Self-Forcing at 16 FPS on a single RTX 5090.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑