支援八位元彈性浮點數格式之乘加器設計
A Multiply-Accumulate (MAC) Unit Design Supporting 8-Bit Flexible Floating-Point (FFP8) Format
摘要
浮點數乘加運算為神經網路應用中最基本之運算,常見的神經網路模型例如多層感知機(MLP)、卷積神經網路(CNN)、遞迴神經網路(RNN)等皆會大量的使用到浮點數乘加運算。因此減少運算時的記憶體存取量以及浮點數乘加運算單元(Floating-point MAC)的功耗及面積為節省電路以及系統成本重要關鍵之一。在本論文中,我們提出了一個高度彈性化之浮點數格式,此浮點數格式特色為其符號位元(Sign Bit)、指數欄位(Exponent Field)長度、小數欄位(Fraction Field)長度以及指數偏移值(Exponent Bias)都可以根據不同的神經網路參數分布進行調整,藉此尋找出最適合該神經網路的浮點數格式參數。藉由選定適合的浮點數格式參數,我們在許多神經網路模型中以極低精度的計算條件下達到與高精度浮點數同等級之準確率(Accuracy)。而利用此浮點數格式低精度以及高度可彈性化之特性,可以大量的減少記憶體的存取量,並且進一步設計出一個極低功耗以及面積之浮點數乘加運算單元。我們使用台積電40奈米製程實作所提出之低精度浮點數乘加器,在500MHz的頻率下其面積以及功耗分別僅為IEEE-754 FP32浮點數格式乘加運算單元之8.2%以及8.1%。
The floating-point multiply-accumulate (MAC) operation is a fundamental operation in virtually all neural network models. Huge amounts of floating-point MAC operations are used in various neural network models, such as multi-layer perceptron (MLP), convolutional neural network (CNN), and recurrent neural network (RNN). Therefore, reducing the memory access and minimizing area and power consumption of a floating-point MAC unit are the keys to decrease the overall cost of a circuit or a system. In this thesis, we first introduced a highly flexible floating-point format. The feature of this format is that the sign bit, the length of exponent and fraction fields, and the exponent bias, are all adjustable based on different parameter distributions of a neural network model. Through selecting appropriate parameters for a floating-point format, it achieves the same level of accuracy as a high-precision floating-point format does. Moreover, the flexible floating-point format features short bit-width and high flexibility so that it reduces the memory accesses greatly and further enables a low-power and small-area floating-point MAC unit design. The proposed floating-point MAC unit design is implemented using TSMC 40nm process. At the frequency of 500MHz, its area and power consumption are only 8.2% and 8.1% as compared to those of the IEEE-754 FP32 MAC, respectively.