A Cost-Efficient FPGA Implementation of Tiny Transformer Model using Neural ODE

要約

Transformer は、アテンション メカニズムを備えた新しいニューラル ネットワーク モデルです。
さまざまなタスクに採用されており、CNNやRNNと比較して良好な精度を実現しています。
アテンション メカニズムは汎用コンポーネントとして認識されていますが、Transformer モデルの多くは CNN ベースのモデルと比較して非常に多くのパラメーターを必要とします。
計算の複雑さを軽減するために、最近、バックボーン アーキテクチャとして ResNet を使用し、その畳み込み層の一部を MHSA (マルチヘッド セルフ アテンション) メカニズムに置き換えるハイブリッド アプローチが提案されています。
この論文では、ResNet の代わりに Neural ODE (常微分方程式) をバックボーン アーキテクチャとして使用することにより、このようなモデルのパラメータ サイズを大幅に削減します。
提案されたハイブリッド モデルは、精度を低下させることなく、CNN ベースのモデルと比較してパラメータ サイズを 94.6% 削減します。
次に、提案されたモデルをエッジ コンピューティング用の適度なサイズの FPGA デバイスにデプロイします。
FPGA リソースの使用率をさらに削減するために、PTQ (ポスト トレーニング量子化) ではなく QAT (量子化認識トレーニング) スキームに従ってモデルを量子化し、精度の損失を抑制します。
その結果、非常に軽量な Transformer ベースのモデルをリソースが限られた FPGA に実装できます。
特徴抽出ネットワークの重みはオンチップに保存されるため、メモリ転送のオーバーヘッドが最小限に抑えられ、より高速な推論が可能になります。
メモリ転送のオーバーヘッドを排除することで、シームレスに推論を実行でき、推論の高速化につながります。
提案された FPGA 実装は、ARM Cortex-A53 CPU と比較して 12.8 倍の速度向上と 9.21 倍のエネルギー効率を達成します。

要約(オリジナル)

Transformer is an emerging neural network model with attention mechanism. It has been adopted to various tasks and achieved a favorable accuracy compared to CNNs and RNNs. While the attention mechanism is recognized as a general-purpose component, many of the Transformer models require a significant number of parameters compared to the CNN-based ones. To mitigate the computational complexity, recently, a hybrid approach has been proposed, which uses ResNet as a backbone architecture and replaces a part of its convolution layers with an MHSA (Multi-Head Self-Attention) mechanism. In this paper, we significantly reduce the parameter size of such models by using Neural ODE (Ordinary Differential Equation) as a backbone architecture instead of ResNet. The proposed hybrid model reduces the parameter size by 94.6% compared to the CNN-based ones without degrading the accuracy. We then deploy the proposed model on a modest-sized FPGA device for edge computing. To further reduce FPGA resource utilization, we quantize the model following QAT (Quantization Aware Training) scheme instead of PTQ (Post Training Quantization) to suppress the accuracy loss. As a result, an extremely lightweight Transformer-based model can be implemented on resource-limited FPGAs. The weights of the feature extraction network are stored on-chip to minimize the memory transfer overhead, allowing faster inference. By eliminating the overhead of memory transfers, inference can be executed seamlessly, leading to accelerated inference. The proposed FPGA implementation achieves 12.8x speedup and 9.21x energy efficiency compared to ARM Cortex-A53 CPU.

arxiv情報

著者 Ikumi Okubo,Keisuke Sugiura,Hiroki Matsutani
発行日 2024-01-05 09:32:39+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AR, cs.LG パーマリンク