優化Transformer於Bare-Metal裝置: 基於RISC-V向量指令集之模型最佳化設計流程
Efficient Inference of Transformers on Bare-Metal Devices: A Design Flow for Optimizing Models Using RISC-V Vector Intrinsic
摘要
目前主流的神經網絡框架對於裸金屬(bare-metal)環境下的邊緣裝置支援度大多有
限。此外,為了實現模型在目標裝置上的最佳效能,需要考慮硬體特性來進行優化。
然而,為每個神經網絡框架和特定裝置進行個別最佳化將帶來巨大的開發成本。
本論文以PyTorch Transformer 模型和RISC-V bare-metal 裝置為例子,提出了一個
有效率的優化流程,能夠快速優化不同神經網絡框架導出的模型。對於模型的瓶頸部
分則將其進行分割,並結合目標裝置的硬件原語(RISC-V 向量指令)來進行客製化調
整,以實現優化效果。本論文的目標在於降低開發成本,同時有效的提高模型在bare-metal
邊緣裝置上的運算效能。
限。此外,為了實現模型在目標裝置上的最佳效能,需要考慮硬體特性來進行優化。
然而,為每個神經網絡框架和特定裝置進行個別最佳化將帶來巨大的開發成本。
本論文以PyTorch Transformer 模型和RISC-V bare-metal 裝置為例子,提出了一個
有效率的優化流程,能夠快速優化不同神經網絡框架導出的模型。對於模型的瓶頸部
分則將其進行分割,並結合目標裝置的硬件原語(RISC-V 向量指令)來進行客製化調
整,以實現優化效果。本論文的目標在於降低開發成本,同時有效的提高模型在bare-metal
邊緣裝置上的運算效能。
Most of the current mainstream neural network frameworks have limited support for
bare-metal environments. Furthermore, optimizing the models to achieve optimal
performance requires consideration of hardware primitives. However, individually optimizing
each neural network framework for a specific device would incur substantial development
costs.
This paper presents an efficient optimization workflow using the PyTorch Transformer
and the RISC-V bare-metal device as examples. It can efficiently optimize models derived
from different neural network frameworks. The bottleneck parts of the model are segmented,
and customized optimization is performed by leveraging the hardware primitives of the target
device (RISC-V vector intrinsic). The objective of this paper is to reduce development costs
while effectively improving the computational efficiency of models on bare-metal devices.
bare-metal environments. Furthermore, optimizing the models to achieve optimal
performance requires consideration of hardware primitives. However, individually optimizing
each neural network framework for a specific device would incur substantial development
costs.
This paper presents an efficient optimization workflow using the PyTorch Transformer
and the RISC-V bare-metal device as examples. It can efficiently optimize models derived
from different neural network frameworks. The bottleneck parts of the model are segmented,
and customized optimization is performed by leveraging the hardware primitives of the target
device (RISC-V vector intrinsic). The objective of this paper is to reduce development costs
while effectively improving the computational efficiency of models on bare-metal devices.
所屬典藏
資訊科學與工程研究所引用此條目
Huang, Y.-X. (2023). Efficient Inference of Transformers on Bare-Metal Devices: A Design Flow for Optimizing Models Using RISC-V Vector Intrinsic. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/248
引用文字依 APA 第 7 版格式自動產生,使用前請再核對。
分享
永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/248