適用記憶體運算模型設計與最佳化研究

Computing In-Memory Aware Model Design and Optimization

檔案

全文未公開。

日期

2020

類型

語言

英文

摘要

卷積神經網路在在電腦視覺以及自然語言處理上達到了最先進的成果。然而其大量的運算與資料吞吐使其難以執行在資源有限的終端裝置。因此,基於可以同時儲存權重,並利用累加位元線之電流,在類比域進行點積運算的交錯式記憶體陣列的記憶體運算,在神經網路加速上受到了許多關注。
然而多位元的權重和激發值需要高精確度的周邊電路。這些周邊電路,尤其是多位元類比數位轉換器,主宰整個記憶體運算加速器的功率和面積成本。為了解決這個議題,二值化神經網路是個有吸引力的方案。由於二值化神經網路的權重和激發值只有兩種可能的值(-1與1或是0與1),我們可以在記憶體運算巨集中使用有著較小的功率和面積成本的感測放大器來取代多位元類比數位轉換器。
儘管如此我們依然面對著兩個主要的問題。首先是需要決定使用什麼類型的模型。由於批次正規化需要高精確度輸入且卷積層中有著過大的過濾器大小,直接使用二值化神經網路在僅有感測放大器的記憶體運算加速器是不現實的。因此我們提出了記憶體運算感知二值化神經網路基礎塊,結合記憶體內批次正規化來符合記憶體運算巨集。另一方面,基於提出的基礎塊,我們也提供了模型轉換准則以及自動模型生成方法以助於決定網路架構。最終,如果想要高性能模型,我們也建議使用二值化神經網路集成模型而不是使用需要多位元類比數位轉換器的量化模型。
另一個問題則是怎麼樣去佈署模型到非完美記憶體運算巨集。由於記憶體運算巨集運作在類比域,其非完美周邊電路導致佈署的模型發生災難性的性能下降。為了減輕這個問題,我們為了卷積權重及記憶體內批次正規化分別提出了分解校準及基於梯度下降之最佳化佈署方法。
為了驗證我們提出的記憶體運算感知二值化神經網路模型及最佳化佈署方法,我們在CIFAR-10、Tiny ImageNet及IVS 3cls上進行評估。我們的記憶體運算感知基礎塊配合交錯式記憶體陣列大小且有著4倍較少的運算量,但只分別在CIFAR-10、Tiny ImageNet的準確度及IVS 3cls的平均精度均值上出現0.3%、1.3%及0.98%的下降。當配合模型轉換准則以及自動模型生成方法,我們的模型能在保持適合於記憶體運算巨集的情況下達到比常規模型更佳的性能。使用集成模型甚至優於使用多位元激發值的模型。接下來,在沒有我們的最佳化時,不論是在卷積運算或是記憶體式批正則化考慮非線性,佈署的模型完全崩潰並在CIFAR-10上僅有10%的準確度。在使用我們的最佳化方法後,儘管在卷積運算及記憶體式批正則化同時考慮非線性,在CIFAR-10上能恢復到87.77%的準確度。
Convolutional neural networks (CNN) reach state-of-the-art performance in computer vision and natural language processing. However, its huge computation and high data I/O make it hard to execute on edge devices with limited resources. Therefore, computing-in-memory (CIM) based acceleration of neural networks has attracted a lot of attention in recent years because the memory crossbar array can store the weights and perform highly parallel dot-product operations in the analog domain by summing up the bitline currents.
However, neural networks with multi-bit weights and activations require high-precision peripheral circuits. These peripheral circuits dominate the power and area cost of CIM based accelerator, especially the multi-bit ADC. To address this issue, the binary neural network (BNN) is an attractive solution. Since the weights and activations of BNN have only two possible values (-1&1 or 0&1), we can use 1-bit SA, which has much smaller power and area cost, instead of multi-bit ADC in CIM macro.
For CIM based accelerator with the BNN model, we still face two main problems. The first problem is what kinds of BNN models to map. Because of the requirement of high-precision input in batch normalization (BN) and large filter size in the convolution layer, directly employing BNN to CIM accelerator with 1-bit SA is not realistic. Therefore, we propose a CIM-aware BNN basic block to reduce the filter size. Then, we combine our basic block with in-memory BN to satisfy the CIM macro. Besides, based on the proposed basic block, we also propose model conversion guidelines and the auto-generation method to help decide the model architecture. Finally, if a higher performance model is desired, we recommend applying the BNN ensemble model rather than the quantized model that requires multi-bit ADC.
Another problem is how to map the trained model to a non-perfect CIM macro. Since the CIM macro operates in the analog domain, the non-perfect peripheral circuit results in a catastrophic performance drop to the mapped model. Thus, to mitigate this problem, we propose the decomposed calibration for convolution weight and the gradient descent based optimization mapping scheme for in-memory BN.
To validate the proposed approach, we evaluate our proposed CIM-aware BNN model and optimized mapping scheme on CIFAR-10, Tiny ImageNet, and IVS 3cls. Our CIM-aware basic block fit the memory crossbar size and has 8x fewer parameters and 4x fewer FLOPs than their conventional counterparts, but only loses 0.3%, 1.3%, and 0.98% of accuracy or mAP on CIFAR-10, Tiny ImageNet, and IVS 3cls, respectively. With the model conversion guidelines and the auto-generation method, our models can achieve higher performance than the conventional model while keeping models suitable for CIM macros. The ensemble models that only need 1-bit SA even outperform the models with multi-bit activation. Furthermore, without our optimization for non-perfect peripherals, the mapped model will be a breakdown and gets about 10% of accuracy on CIFAR-10 no matter we apply the non-linear issue to convolution operation or in-memory BN. After using the proposed optimization, its accuracy on CIFAR-10 recovers to 87.77%, although the non-linearity in convolution operation and in-memory BN were considered at the same time.

所屬典藏

電子研究所
顯示完整詮釋資料 統計資料

引用此條目

Pan, T.-L. (2020). Computing In-Memory Aware Model Design and Optimization. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/76015

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享

永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/76015