[論文レビュー] Full Stack Optimization of Transformer Inference: a Survey
本調査は、効率的な Transformer 推論へのフルスタック手法を分析し、Gemmini を用いたケーススタディで最大88.7×の高速化と最小限の性能劣化を実証します。
Recent advances in state-of-the-art DNN architecture design have been moving toward Transformer models. These models achieve superior accuracy across a wide range of applications. This trend has been consistent over the past several years since Transformer models were originally introduced. However, the amount of compute and bandwidth required for inference of recent Transformer models is growing at a significant rate, and this has made their deployment in latency-sensitive applications challenging. As such, there has been an increased focus on making Transformer models more efficient, with methods that range from changing the architecture design, all the way to developing dedicated domain-specific accelerators. In this work, we survey different approaches for efficient Transformer inference, including: (i) analysis and profiling of the bottlenecks in existing Transformer architectures and their similarities and differences with previous convolutional models; (ii) implications of Transformer architecture on hardware, including the impact of non-linear operations such as Layer Normalization, Softmax, and GELU, as well as linear operations, on hardware design; (iii) approaches for optimizing a fixed Transformer architecture; (iv) challenges in finding the right mapping and scheduling of operations for Transformer models; and (v) approaches for optimizing Transformer models by adapting the architecture using neural architecture search. Finally, we perform a case study by applying the surveyed optimizations on Gemmini, the open-source, full-stack DNN accelerator generator, and we show how each of these approaches can yield improvements, compared to previous benchmark results on Gemmini. Among other things, we find that a full-stack co-design approach with the aforementioned methods can result in up to 88.7x speedup with a minimal performance degradation for Transformer inference.
研究の動機と目的
- Transformer アーキテクチャの実行時ボトルネックとワークロード特性を分析する。
- 推論効率に対する非線形および線形 Transformer 演算のハードウェア影響を検討する。
- 固定された Transformer アーキテクチャの最適化手法(剪定、量子化など)を俯瞰する。
- ハードウェア全体での Transformer ワークロードのスケジューリング/マッピング課題を検討する。
- ハードウェア効率のために Transformer を適合させる neural architecture search を調査する。
提案手法
- Transformer の実行時特性とボトルネックのプロファイリングを行う(Sec. 2)。
- 非線形演算(LayerNorm、Softmax、GELU)および線形演算(matmul)がアクセラレータに与える影響を分析する(Sec. 3)。
- 固定アーキテクチャの最適化技術(剪定、量子化)をレビューする(Sec. 4)。
- 演算のマッピングとスケジューリングの課題を論じる(Sec. 5)。
- Transformer アーキテクチャをハードウェア効率に適合させるための neural architecture search アプローチを説明する(Sec. 6)。
- surveyed 最適化を Gemmini に適用したケーススタディを提示し、パフォーマンスへの影響を報告する(Sec. 3.4、Fig. 14、Sec. 5.5)。
実験結果
リサーチクエスチョン
- RQ1ハードウェア上での Transformer エンコーダ/デコーダの実行時ボトルネックは何か。
- RQ2Transformer の非線形演算はアクセラレータ設計と利用にどう影響するか。
- RQ3固定された Transformer アーキテクチャの性能を最大化する最適化戦略は何か。
- RQ4Transformer 推論の遅延に最も影響を与えるスケジューリング/マッピングの決定は何か。
- RQ5Neural Architecture Search はハードウェア効率の良い Transformer 変種を生み出せるか、トレードオフはどうか。
主な発見
- フルスタックの共設計アプローチにより、Gemmini での Transformer 推論を最大 88.7× の速度アップと最小限の性能劣化で実現できる。
- Gemmini の CNN 最適化アーキテクチャは、浮動小数点の非線形および量子化/非量子化演算に時間を要するため、Transformer 推論には適していない可能性があり、対処しないとハードウェア利用率が 1% 未満に陥る可能性がある。
- Transformer アクセラレータでは、より大きな accumulators、より小さな scratchpad が、CNN 最適化設計と比べて性能を向上させることが多い(報告ケースで約36% のレイテンシ改善)。
- Transformers の matmul をスケジューリングすることは CNN と同様に難しく、最適解と最悪解は最大で4桁の差になる(Sec. 5.5.1)。
- LayerNorm を直前の matmul と融合させるとタイルサイズ制約が生じ、場合によっては融合利得を打ち消すことがある(Sec. 5.5.2)。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。