arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.29360cs.CV
收藏

SAFE-DiT:面向高分辨率扩散Transformer的语义感知快速路径执行

SAFE-DiT: Semantics-Aware Fast-path Execution for High-Resolution Diffusion Transformers

School of Computer Science, The University of Sydney(悉尼大学计算机科学学院)

Xuanhua Yin, Yuxuan Jia, Chuanzhi Xu, Weidong Cai

AI总结:

针对高分辨率扩散Transformer推理中的空间冗余导致注意力掩码引发性能瓶颈(MIDT),提出无训练框架SAFE-DiT,通过分离精确掩码消除与近似空间调度,实现2.69-5.09倍加速并降低内存占用,同时保持视觉质量。

摘要:

高分辨率扩散Transformer(DiT)推理包含大量空间冗余,但许多空间自适应实现将区域计算编码为注意力掩码,这可能会无意中将缩放点积注意力(SDPA)移出FlashAttention快速路径。我们将这一可避免的系统瓶颈识别为掩码引起的调度开销(MIDT),并表明它随潜在序列长度增长。我们引入SAFE-DiT,一个无训练的语义感知快速路径执行框架,将精确掩码消除与基于近似的空间调度分离。SAFE-DiT仅移除那些在注意力对数中引起逐行常数偏移的经来源认证的图像自注意力掩码,保留语义承载掩码(如文本填充掩码),并通过提示条件化的令牌分区、带全局上下文的选择性状态更新以及周期性上下文刷新实现空间自适应。我们将这种仅加速配置称为SAFE-Core,并单独报告灵敏度加权无分类器引导作为SAFE-DiT+SW。在评估的PyTorch SDPA堆栈上,冗余掩码使长序列注意力比无掩码路径慢4.1倍至5.8倍。在Lumina-Next上,SAFE-DiT在1024^2分辨率下实现2.69倍端到端加速,在2560^2分辨率下实现5.09倍加速,将2560^2下的峰值内存从94.1 GB降至27.9 GB,并在密集推理内存不足时支持3072^2生成。配对指标、组件消融和盲人研究支持SAFE-Core在视觉上不劣于密集快速路径基线,而SAFE-DiT+SW提供了单独的提示对齐操作点,无需重新引入空间自注意力掩码。代码见 https://github.com/xuanhuayin/SAFE-DiT。

英文摘要:

High-resolution Diffusion Transformer (DiT) inference contains substantial spatial redundancy, but many spatially adaptive implementations encode regional computation as attention masks, which can inadvertently move scaled dot-product attention (SDPA) away from FlashAttention fast paths. We identify this avoidable systems bottleneck as Mask-Induced Dispatch Tax (MIDT) and show that it grows with latent sequence length. We introduce SAFE-DiT, a training-free Semantics-Aware Fast-path Execution framework that separates exact mask elision from approximation-based spatial scheduling. SAFE-DiT removes only provenance-certified image self-attention masks that induce a row-wise constant shift in attention logits, preserves semantics-bearing masks such as text-padding masks, and realizes spatial adaptation through prompt-conditioned token partitioning, selective state updates with global context, and periodic context refresh. We call this acceleration-only configuration SAFE-Core and report sensitivity-weighted classifier-free guidance separately as SAFE-DiT+SW. On the evaluated PyTorch SDPA stack, redundant masks make long-sequence attention $4.1\times$ to $5.8\times$ slower than the mask-free path. On Lumina-Next, SAFE-DiT achieves $2.69\times$ end-to-end acceleration at $1024^2$ resolution and $5.09\times$ at $2560^2$, reduces peak memory at $2560^2$ from 94.1 to 27.9 GB, and enables $3072^2$ generation when dense inference runs out of memory. Paired metrics, component ablations, and a blinded human study support visual non-inferiority of SAFE-Core to the dense fast-path baseline, while SAFE-DiT+SW provides a separate prompt-alignment operating point without reintroducing spatial self-attention masks. Code is available at https://github.com/xuanhuayin/SAFE-DiT.

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

↑