論文の概要: FlashAttention: Fast and Memory-Efficient Exact Attention with
IO-Awareness
- arxiv url: http://arxiv.org/abs/2205.14135v1
- Date: Fri, 27 May 2022 17:53:09 GMT
- ステータス: 処理完了
- システム内更新日: 2022-05-30 14:42:32.965135
- Title: FlashAttention: Fast and Memory-Efficient Exact Attention with
IO-Awareness
- Title(参考訳): FlashAttention: IO認識による高速かつメモリ効率の良い実行注意
- Authors: Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, Christopher R\'e
- Abstract要約: FlashAttentionは、トランスフォーマーのためのIO対応の正確な注意アルゴリズムである。
これにより、GPU高帯域メモリ(HBM)とGPUオンチップ間のメモリ読み込み/書き込み数を削減できる。
FlashAttentionとブロックスパース FlashAttentionは、トランスフォーマーのコンテキストを長くすることを可能にする。
- 参考スコア(独自算出の注目度): 80.3586155104237
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Transformers are slow and memory-hungry on long sequences, since the time and
memory complexity of self-attention are quadratic in sequence length.
Approximate attention methods have attempted to address this problem by trading
off model quality to reduce the compute complexity, but often do not achieve
wall-clock speedup. We argue that a missing principle is making attention
algorithms IO-aware -- accounting for reads and writes between levels of GPU
memory. We propose FlashAttention, an IO-aware exact attention algorithm that
uses tiling to reduce the number of memory reads/writes between GPU high
bandwidth memory (HBM) and GPU on-chip SRAM. We analyze the IO complexity of
FlashAttention, showing that it requires fewer HBM accesses than standard
attention, and is optimal for a range of SRAM sizes. We also extend
FlashAttention to block-sparse attention, yielding an approximate attention
algorithm that is faster than any existing approximate attention method.
FlashAttention trains Transformers faster than existing baselines: 15%
end-to-end wall-clock speedup on BERT-large (seq. length 512) compared to the
MLPerf 1.1 training speed record, 3$\times$ speedup on GPT-2 (seq. length 1K),
and 2.4$\times$ speedup on long-range arena (seq. length 1K-4K). FlashAttention
and block-sparse FlashAttention enable longer context in Transformers, yielding
higher quality models (0.7 better perplexity on GPT-2 and 6.4 points of lift on
long-document classification) and entirely new capabilities: the first
Transformers to achieve better-than-chance performance on the Path-X challenge
(seq. length 16K, 61.4% accuracy) and Path-256 (seq. length 64K, 63.1%
accuracy).
- Abstract(参考訳): トランスフォーマーは長いシーケンスでは時間とメモリの複雑さが2倍になるため、遅いしメモリも長い。
近似注意手法は、計算の複雑さを減らすためにモデル品質をトレードオフすることでこの問題に対処しようとしたが、しばしばウォールクロックのスピードアップを達成しなかった。
欠けている原則は注意アルゴリズムをio-awareにすることです -- gpuメモリのレベル間での読み込みと書き込みを考慮に入れます。
我々は,GPU高帯域メモリ(HBM)とGPUオンチップSRAM間のメモリ読み込み/書き込み回数を削減するため,タイリングを用いたIO対応の正確な注意アルゴリズムであるFlashAttentionを提案する。
我々は、FlashAttentionのIO複雑さを分析し、標準の注意よりもHBMアクセスを少なくし、様々なSRAMサイズに最適であることを示した。
また,flashattentionをブロック分散注意に拡張することで,既存の近似注意法よりも高速な近似注意アルゴリズムを実現する。
flashattentionは、既存のベースラインよりも高速にトランスフォーマーをトレーニングする: bert-large (seq. length 512) では、mlperf 1.1のトレーニング速度記録と比較して15%、gpt-2では3$\times$ speedup (seq. length 1k)、長距離アリーナでは2.4$\times$ speedup (seq. length 1k-4k)。
FlashAttentionとブロックスパース FlashAttentionはトランスフォーマーのコンテキストを長くし、より高品質なモデル(GPT-2では0.7、長期文書分類では6.4ポイント)と全く新しい機能、パスXチャレンジ(シークエンス16K、61.4%の精度)とパス256(シークエンス64K、63.1%の精度)を実現した最初のトランスフォーマーである。
関連論文リスト
- HyperAttention: Long-context Attention in Near-Linear Time [78.33061530066185]
本稿では,長期的文脈の複雑さの増大に伴う計算課題に対処するため,HyperAttentionという近似的な注意機構を提案する。
実証的には、大規模なエントリを特定するためにLocality Sensitive Hashing(LSH)を使用して、HyperAttentionは既存のメソッドよりも優れています。
各種長文長データセットにおけるHyperAttentionの実証的性能を検証した。
論文 参考訳(メタデータ) (2023-10-09T17:05:25Z) - FlashAttention-2: Faster Attention with Better Parallelism and Work
Partitioning [11.508362885430133]
非対称なGPUメモリ階層を利用して、メモリの大幅な節約と実行時の高速化を実現しています。
FlashAttentionはまだGEMM(Optimized matrix-multiply)操作ほど高速ではなく、理論上の最大FLOP/sの25-40%にしか達していない。
これらの問題に対処するために、より優れた作業パーティショニングを備えたFlashAttention-2を提案する。
論文 参考訳(メタデータ) (2023-07-17T17:50:36Z) - Faster Causal Attention Over Large Sequences Through Sparse Flash
Attention [45.18552512844457]
FlashAttentionを拡張して、大量の注目空間パターンに対応します。
変換言語モデルのトレーニング速度を、それぞれ$2.0times$と$3.3times$で、それぞれ$8k$と$16k$のシーケンスで増加します。
論文 参考訳(メタデータ) (2023-06-01T21:33:59Z) - Simple Hardware-Efficient Long Convolutions for Sequence Modeling [18.3719016967593]
状態空間モデル(SSM)は、長いシーケンスモデリングにおいて高い性能を持つ。
単純な代替手段が性能と効率においてSSMと一致するかどうかを考察する。
我々は、長い畳み込みのランタイム性能を改善するためのIO対応アルゴリズムであるFlashButterflyを開発した。
論文 参考訳(メタデータ) (2023-02-13T19:19:23Z) - Adaptable Butterfly Accelerator for Attention-based NNs via Hardware and
Algorithm Co-design [66.39546326221176]
多くのAIタスクにおいて、注意に基づくニューラルネットワークが普及している。
注意機構とフィードフォワードネットワーク(FFN)の使用は、過剰な計算とメモリ資源を必要とする。
本稿では,注目機構とFFNの両方を近似するために,バタフライの分散パターンを統一したハードウェアフレンドリーな変種を提案する。
論文 参考訳(メタデータ) (2022-09-20T09:28:26Z) - Revisiting Multi-Scale Feature Fusion for Semantic Segmentation [90.32746095413447]
本稿では,高精度なセマンティックセグメンテーションには高い内部分解能もアトラス畳み込みも不要であることを示す。
我々は,内部分解能が高く,高コストなアトラス畳み込みをもたない,ESegと呼ばれる簡易なセグメンテーションモデルを開発した。
我々の単純な手法は、複数のデータセットにまたがる先行技術よりも高速で精度を向上できる。
論文 参考訳(メタデータ) (2022-03-23T19:14:11Z) - Self-attention Does Not Need $O(n^2)$ Memory [6.929312022493406]
我々は,シーケンス長に対して$O(1)$のメモリを必要とする,非常に単純な注意アルゴリズムを提案する。
これは、自己注意には$O(log n)$メモリが必要であるという頻繁に述べられている信念とは対照的である。
シーケンス長16384では、自己アテンションのメモリオーバーヘッドを推論の59倍、微分の32倍に削減する。
論文 参考訳(メタデータ) (2021-12-10T17:25:07Z) - EL-Attention: Memory Efficient Lossless Attention for Generation [27.59275177303199]
この問題に対処するために,メモリ効率の低い注意(ELアテンション)を提案する。
キャッシュを使用する必要がなく、マルチヘッドキーと値を構築するための重い操作を避ける。
要約タスクと質問生成タスクのためのTransformer, BART, GPT-2について広範な実験を行った。
論文 参考訳(メタデータ) (2021-05-11T04:37:52Z) - Memformer: A Memory-Augmented Transformer for Sequence Modeling [55.780849185884996]
本稿では、シーケンスモデリングのための効率的なニューラルネットワークであるMemformerを紹介する。
我々のモデルは長いシーケンスを処理する際に線形時間複雑性と一定メモリ空間複雑性を実現する。
論文 参考訳(メタデータ) (2020-10-14T09:03:36Z)
関連論文リストは本サイト内にある論文のタイトル・アブストラクトから自動的に作成しています。
指定された論文の情報です。
本サイトの運営者は本サイト(すべての情報・翻訳含む)の品質を保証せず、本サイト(すべての情報・翻訳含む)を使用して発生したあらゆる結果について一切の責任を負いません。