Skip to main content
QUICK REVIEW

[論文レビュー] EfficientViT: Memory Efficient Vision Transformer with Cascaded Group Attention

Xinyu Liu, Houwen Peng|arXiv (Cornell University)|May 11, 2023
Advanced Memory and Neural Computing被引用数 36
ひとこと要約

tldr: EfficientViTは、サンドイッチ型レイアウトとカスケード型グループアテンションを備えたメモリ効率の高いビジョントランスフォーマーを導入し、メモリアクセスと計算を削減して、従来の効率的モデルよりも速度と精度を向上させます。

ABSTRACT

Vision transformers have shown great success due to their high model capabilities. However, their remarkable performance is accompanied by heavy computation costs, which makes them unsuitable for real-time applications. In this paper, we propose a family of high-speed vision transformers named EfficientViT. We find that the speed of existing transformer models is commonly bounded by memory inefficient operations, especially the tensor reshaping and element-wise functions in MHSA. Therefore, we design a new building block with a sandwich layout, i.e., using a single memory-bound MHSA between efficient FFN layers, which improves memory efficiency while enhancing channel communication. Moreover, we discover that the attention maps share high similarities across heads, leading to computational redundancy. To address this, we present a cascaded group attention module feeding attention heads with different splits of the full feature, which not only saves computation cost but also improves attention diversity. Comprehensive experiments demonstrate EfficientViT outperforms existing efficient models, striking a good trade-off between speed and accuracy. For instance, our EfficientViT-M5 surpasses MobileNetV3-Large by 1.9% in accuracy, while getting 40.4% and 45.2% higher throughput on Nvidia V100 GPU and Intel Xeon CPU, respectively. Compared to the recent efficient model MobileViT-XXS, EfficientViT-M2 achieves 1.8% superior accuracy, while running 5.8x/3.7x faster on the GPU/CPU, and 7.4x faster when converted to ONNX format. Code and models are available at https://github.com/microsoft/Cream/tree/main/EfficientViT.

研究の動機と目的

  • Vision Transformer (ViT)の推論速度に影響を与える要因を分析し、メモリアクセス、計算の冗長性、パラメータの使用に焦点を当てる。
  • 精度を犠牲にせずスループットを向上させる、メモリ効率の良いViTビルディングブロックを設計する。
  • 冗長性を減らし、ヘッド間の特徴の多様性を高める新しいアテンション機構を開発する。
  • 重要なモジュールの効率を改善するためにパラメータを再配分し、重要度の低いコンポーネントを剪定する。
  • EfficientViTの下流の視覚タスクへの適用可能性を示す。

提案手法

  • メモリ境界の単一MHSAをFFN層の間に挟むサンドイッチ型レイアウトブロックを導入し、メモリ境界の演算を削減する。
  • 異なる特徴分割でアテンションヘッドへ入力を与え、ヘッド間で出力をカスケードさせるカスケード型グループアテンション(CGA)を提案し、多様性を高め、計算を削減する。
  • Taylor構造化剪定を適用して重要なチャネルを特定し、パラメータ再配分を導く。重要モジュールの幅を広げ、重要度の低い部分を縮小する。
  • 重なり合うパッチ埋め込みとBNを通じた3段階階層アーキテクチャを用い、ハードウェア上での速度と実用性を向上させる。
  • GPU/CPU/ONNXに跨るImageNet-1Kでスループットと精度を評価し、下流タスクへの転移可能性をテストする。
Figure 1 : Speed and accuracy comparisons between EfficientViT (Ours) and other efficient CNN and ViT models tested on an Nvidia V100 GPU with ImageNet-1K dataset [ 17 ] .
Figure 1 : Speed and accuracy comparisons between EfficientViT (Ours) and other efficient CNN and ViT models tested on an Nvidia V100 GPU with ImageNet-1K dataset [ 17 ] .

実験結果

リサーチクエスチョン

  • RQ1推論時のメモリ境界演算を最小限に抑えるようにViTを再設計するにはどうすればよいか?
  • RQ2分割特徴チャネルをヘッドに供給する(CGA)ことで、精度を犠牲にすることなく冗長性を減らし、アテンションの多様性を高めることができるか?
  • RQ3軽量ViTにおいて、どのようなパラメータ再配分戦略が速度と精度のトレードオフとして優れているか?
  • RQ4提案されたEfficientViTブロックは下流の視覚タスクや実機ハードウェア上でのデプロイメントに一般化できるか?

主な発見

  • EfficientViT-M5はNvidia V100でTop-1 accuracy 77.1%、スループット10,621画像/秒を達成し、MobileNetV3-Largeを精度で1.9%、スループットでGPU40.4% / CPU45.2%上回る。
  • EfficientViT-M2はTop-1精度70.8%、MobileViT-XXSを1.8%上回り、GPUで5.8倍、CPUで3.7倍のスピードアップを実現し、ONNX性能は7.4倍高速。
  • EfficientViT-M4はImageNetで幾つかの効率的モデルより高いスループットと競争的な精度を示す(例: EdgeViT-XXS に対してGPUで4.4倍、CPUで3.0倍高速)。
  • メモリ境界のMHSAをサンドイッチ型レイアウトに置換することで、FFNベースのチャネル通信を増やしつつ、メモリ時間の消費を削減する。
  • CGAは、ヘッドを特徴分割へ分配し出力をカスケードさせることで、アテンション計算を削減し、効率と精度を向上させる(アブレーションではMHSAに対して利得を示す)。
  • パラメータ再配分は、Vチャンネル幅を拡大し、Q/K次元とFFN拡張を縮小することで、測定可能な精度とスループットの利得を生む。
Figure 2 : Runtime profiling on two standard vision transformers Swin-T and DeiT-T. Red text denotes memory-bound operations, i.e. , the time taken by the operation is mainly determined by memory accesses, while time spent in computation is much smaller.
Figure 2 : Runtime profiling on two standard vision transformers Swin-T and DeiT-T. Red text denotes memory-bound operations, i.e. , the time taken by the operation is mainly determined by memory accesses, while time spent in computation is much smaller.

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。