論文の概要: S2-Attention: Hardware-Aware Context Sharding Among Attention Heads
- arxiv url: http://arxiv.org/abs/2407.17678v5
- Date: Tue, 22 Oct 2024 18:26:51 GMT
- ステータス: 処理完了
- システム内更新日: 2024-11-08 15:12:19.851157
- Title: S2-Attention: Hardware-Aware Context Sharding Among Attention Heads
- Title(参考訳): S2-Attention: ハードウェア対応のコンテキストシャーディング
- Authors: Xihui Lin, Yunan Zhang, Suyu Ge, Liliang Ren, Barun Patra, Vishrav Chaudhary, Hao Peng, Xia Song,
- Abstract要約: スパースアテンションは、コンテキスト内のトークンのサブセットに選択的に出席する。
スパース・アテンションが今日の大規模言語モデルでモデルの品質を維持することができるかどうかは不明だ。
本稿では,Sparsely-Sharded(S2) attention, a Triton library that provide kernel optimization for sparse attention for sparse attention to customizable per-head and per-context-range levels。
- 参考スコア(独自算出の注目度): 49.1454481007861
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Sparse attention, which selectively attends to a subset of tokens in the context was supposed to be efficient. However, its theoretical reduction in FLOPs has rarely translated into wall-clock speed-up over its dense attention counterparts due to the lack of hardware-aware optimizations like FlashAttention. Meanwhile, it remains unclear whether sparse attention can maintain the model's quality at a scale of today's large language models (LLMs) and how. This paper presents Sparsely-Sharded(S2) Attention, a Triton library that provides kernel optimization for sparse attention customizable at both per-head and per-context-range levels. S2-Attention enables the exploration of novel and high-performance sparse attention techniques, which we demonstrate through extensive ablations across a wide range of sparse attention designs at various model scales. From these insights, we present several basic guidelines to design sparse attention that can achieve not only practical efficiency improvements, but also strong downstream performance. To achieve high parallelization and optimized memory IO, sparse attention should shard the context heterogeneously across attention heads, where each head attends to a different subset of tokens while collectively covering the full context. Meanwhile, we find hybrid architectures combining sparse and dense attention particularly beneficial in practice. S2-Attention achieves wall-clock speedup of 8.79X, 15.87X, 25.3X compared to the strong FlashAttention-2 baseline with strong downstream performance on-par with full attention and perfect retrieval performance at a 128k context length. At inference, for 7B models, our model, with the help of our S2-Attention kernel, achieves 4.5x speed-up compared to dense counterparts. S2-Attention is released with easy-to-customize APIs for direct usage in Megatron and vLLM.
- Abstract(参考訳): コンテキスト内のトークンのサブセットに選択的に出席するスパースアテンションは効率的であるはずだった。
しかし、FLOPの理論的削減は、FlashAttentionのようなハードウェアを意識した最適化が欠如しているため、その注目度よりもウォールクロックのスピードアップにはほとんど変換されていない。
一方、現在の大規模言語モデル(LLM)の規模でモデルの品質を維持することができるのか、どのようにして、疎い注意が維持できるのかは、まだ不明である。
本稿では,Sparsely-Sharded(S2) attention, a Triton library that provide kernel optimization for sparse attention for sparse attention to customizable per-head and per-context-range levels。
S2-Attention は新規かつ高性能なスパースアテンション手法の探索を可能にする。
これらの知見から,本研究は,実用的な効率向上だけでなく,下流の性能向上にも寄与する疎度な注意を設計するための基本的なガイドラインを提示する。
高い並列化と最適化されたメモリIOを実現するために、スパースアテンションは、各ヘッドが全コンテキストを包含しながら異なるトークンのサブセットに出席する、アテンションヘッド間でコンテキストを均一に共有するべきである。
一方、疎度と密集度を組み合わせたハイブリッドアーキテクチャは、実際は特に有益である。
S2-Attentionは、強いFlashAttention-2ベースラインと比較して8.79X、15.87X、25.3Xのウォールクロックスピードアップを達成する。
7Bモデルでは,S2-Attentionカーネルの助けを借りて,密度の高いカーネルに比べて4.5倍の高速化を実現している。
S2-AttentionはMegatronとvLLMで直接使用するために、容易にカスタマイズできるAPIでリリースされている。
関連論文リスト
- Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention [32.48360534726024]
我々は、アルゴリズムのイノベーションとハードウェアの最適化を統合する、ネイティブにトレーニング可能なスパースアテンションメカニズムであるNSAを紹介する。
NSAは動的な階層的なスパース戦略を採用し、粗粒のトークン圧縮と細粒のトークン選択を組み合わせて、グローバルなコンテキスト認識と局所的精度の両方を維持する。
論文 参考訳(メタデータ) (2025-02-16T11:53:44Z) - Core Context Aware Attention for Long Context Language Modeling [50.774702091154204]
本稿では,CCA(Core Context Aware)アテンションを効果的に長距離コンテキストモデリングのためのプラグイン・アンド・プレイとして提案する。
CCA-Attentionは、計算効率と長文モデリング能力の観点から、最先端モデルよりも大幅に優れています。
論文 参考訳(メタデータ) (2024-12-17T01:54:08Z) - SparseAccelerate: Efficient Long-Context Inference for Mid-Range GPUs [0.0]
SparseAccelerateは動的スパースアテンション手法であり、入力特性に基づいてその疎度パターンを適応する。
実験結果から,SparseAccelerateは最大1.04倍のTTTF遅延を32Kトークンで達成した。
論文 参考訳(メタデータ) (2024-12-09T04:27:03Z) - Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformers [58.5711048151424]
SPARSEK Attention(SPARSEK Attention)は、計算およびメモリ障害を克服するために設計された、新しいスパースアテンション機構である。
提案手法では,各クエリに対して一定数のKVペアを選択するために,スコアリングネットワークと差別化可能なトップkマスク演算子であるSPARSEKを統合する。
実験結果から,SPARSEK注意は従来のスパースアテンション法よりも優れていた。
論文 参考訳(メタデータ) (2024-06-24T15:55:59Z) - Short-Long Convolutions Help Hardware-Efficient Linear Attention to Focus on Long Sequences [60.489682735061415]
本稿では,状態空間モデルを短時間の畳み込みに置き換えたCHELAを提案する。
提案手法の有効性を示すために,Long Range Arenaベンチマークと言語モデリングタスクについて実験を行った。
論文 参考訳(メタデータ) (2024-06-12T12:12:38Z) - Bifurcated Attention: Accelerating Massively Parallel Decoding with Shared Prefixes in LLMs [39.16152482491236]
Bifurcated attentionは、共有コンテキストバッチデコードシナリオにおける言語モデル推論を強化するために設計された手法である。
提案手法は,高バッチサイズおよび拡張コンテキスト長のレイテンシに寄与する重要な要因である冗長メモリIOコストの課題に対処する。
論文 参考訳(メタデータ) (2024-03-13T16:30:57Z) - Faster Neighborhood Attention: Reducing the O(n^2) Cost of Self Attention at the Threadblock Level [30.681204292813998]
近隣の注意は、それぞれのトークンの注意を隣人に限定することで、自己注意のコストを減少させる。
我々は,近隣の注意を,標準的な注意と同様のバッチGEMM問題として表すことができることを示した。
我々は、異なる空間軸をまたいだ注意をきめ細かく制御できる、融合したドット積アテンションカーネルを適応した、融合した近隣アテンションを開発する。
論文 参考訳(メタデータ) (2024-03-07T17:35:58Z) - Efficient Streaming Language Models with Attention Sinks [72.20260088848987]
StreamingLLMは、大規模言語モデルが微調整なしで無限のシーケンス長に一般化できる効率的なフレームワークである。
StreamingLLMはLlama-2, MPT, Falcon, Pythiaを最大400万のトークンで安定かつ効率的な言語モデリングを実現できることを示す。
論文 参考訳(メタデータ) (2023-09-29T17:59:56Z) - Faster Causal Attention Over Large Sequences Through Sparse Flash
Attention [45.18552512844457]
FlashAttentionを拡張して、大量の注目空間パターンに対応します。
変換言語モデルのトレーニング速度を、それぞれ$2.0times$と$3.3times$で、それぞれ$8k$と$16k$のシーケンスで増加します。
論文 参考訳(メタデータ) (2023-06-01T21:33:59Z) - Faster Attention Is What You Need: A Fast Self-Attention Neural Network
Backbone Architecture for the Edge via Double-Condensing Attention Condensers [71.40595908386477]
本稿では,2重対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向対向
結果のバックボーン(AttendNeXtと呼ぶ)は、組み込みARMプロセッサ上で大幅に高い推論スループットを実現する。
これらの有望な結果は、さまざまな効率的なアーキテクチャ設計と自己アテンション機構の探索が、TinyMLアプリケーションのための興味深い新しいビルディングブロックにつながることを実証している。
論文 参考訳(メタデータ) (2022-08-15T02:47:33Z)
関連論文リストは本サイト内にある論文のタイトル・アブストラクトから自動的に作成しています。
指定された論文の情報です。
本サイトの運営者は本サイト(すべての情報・翻訳含む)の品質を保証せず、本サイト(すべての情報・翻訳含む)を使用して発生したあらゆる結果について一切の責任を負いません。