要約
拡散ベースの変圧器は印象的な生成機能を実証していますが、その高い計算コストは実用的な展開を妨げています。たとえば、8192ドルの8192 $の画像を生成すると、A100 GPUで1時間以上かかります。
この作業では、grat(\ textbf {gr} ouring first、\ textbf {at}はスマートに\ tending)を提案します。
重要な洞察は、前処理された拡散トランスの学習注意マップ(局所的に焦点を当てる傾向がある)に固有のスパース性を活用し、より良いGPU並列性を活用することです。
具体的には、GRATは、GPU実行パターンと、前処理された生成トランスで学習した局所的な注意構造に合わせて、重複しないグループに隣接するトークンを最初にパーティション化します。
次に、同じグループ内のすべてのクエリトークンを、参加可能なキーとバリュートークンの共通のセットを共有することにより、注意を加速します。
これらのキーと値のトークンは、周囲のブロックや交差点領域などの構造化された領域にさらに制限されており、計算オーバーヘッドを大幅に減らします(たとえば、\ textbf {35.8 $ \ times $} $ 8192 \ times 8192 $の画像を生成するときに完全に注意を払います)。
イメージとビデオ生成のために、それぞれ前処理されたフラックスとhunyuanvideoのGratを検証します。
どちらの場合も、GRATは、完全に注意のパフォーマンスを維持しながら、微調整なしで大幅に速い推論を達成します。
Gratが、スケーラブルな視覚生成のための拡散トランスの加速に関する将来の研究を促すことを願っています。
要約(オリジナル)
Diffusion-based Transformers have demonstrated impressive generative capabilities, but their high computational costs hinder practical deployment, for example, generating an $8192\times 8192$ image can take over an hour on an A100 GPU. In this work, we propose GRAT (\textbf{GR}ouping first, \textbf{AT}tending smartly), a training-free attention acceleration strategy for fast image and video generation without compromising output quality. The key insight is to exploit the inherent sparsity in learned attention maps (which tend to be locally focused) in pretrained Diffusion Transformers and leverage better GPU parallelism. Specifically, GRAT first partitions contiguous tokens into non-overlapping groups, aligning both with GPU execution patterns and the local attention structures learned in pretrained generative Transformers. It then accelerates attention by having all query tokens within the same group share a common set of attendable key and value tokens. These key and value tokens are further restricted to structured regions, such as surrounding blocks or criss-cross regions, significantly reducing computational overhead (e.g., attaining a \textbf{35.8$\times$} speedup over full attention when generating $8192\times 8192$ images) while preserving essential attention patterns and long-range context. We validate GRAT on pretrained Flux and HunyuanVideo for image and video generation, respectively. In both cases, GRAT achieves substantially faster inference without any fine-tuning, while maintaining the performance of full attention. We hope GRAT will inspire future research on accelerating Diffusion Transformers for scalable visual generation.
arxiv情報
著者 | Sucheng Ren,Qihang Yu,Ju He,Alan Yuille,Liang-Chieh Chen |
発行日 | 2025-05-20 17:59:59+00:00 |
arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google