適用於深度學習加速之混合CIM與數位設計及其映射最佳化

A Hybrid CIM and Digital Design and its Mapping Optimization for Deep Learning Acceleration

檔案

日期

2024

類型

語言

英文

摘要

記憶體內運算(CIM: computing in-memory)架構作為一種將存儲與計算功能整合於同一設備的創新解決方案,有效減少了資料在記憶體與運算單元之間的傳輸需求,並通過高度平行的計算方式顯著提升了能量效率。然而,現有CIM存在兩個問題,在CIM macro方面依賴高精度的類比數位轉換器,導致大量的面積和能耗消耗,而在在系統應用上,由於深度學習模型大小遠超過CIM大小,而更新權重一次更新一個字元線的權重,會造成大量延遲與硬體使用率低的問題。因此,針對以上兩個問題,我們提出模型與記憶體共同設計的方法來解決。

首先,為解決CIM macro方面方面問題,我們選擇使用脈衝神經網絡(SNN)作為硬體設計模型。SNN擁有1位元的激活函數,能有效降低ADC的面積與能耗。同時,SNN的時間步長(timestep)特性有助於改善因精度不足帶來的準確性問題。然而,SNN也存在其挑戰——多個timestep會成倍增加activation的存儲需求,且不同timestep的數據無法重用,進一步導致讀取延遲。為解決這些問題,我們針對每個timestep設計了獨立的硬體,允許各timestep之間的數據重用,減少延遲。我們還使用了「tick batching」方法,將小部分數據在所有timestep中運算後再進行stride,避免額外的數據存儲需求。 最終,我們在台積電28奈米製程下實現了一款高效能的CIM加速器。在50 MHz的工作頻率下,該加速器達到了20.97 TOPS的運算性能,並實現了1331.18 TOPS/W的能效表現,顯著超越現有的先進設計。我們的設計展示了其在高效能與低功耗領域的潛力,特別適用於人工智慧邊緣運算設備的應用場景。

接著針對系統層更新CIM中權重的挑戰。為了減少因頻繁更新權重所引起的延遲,我們首先採用了大型宏單元來儲存更多的權重,從而減少更新次數並提升計算量以增加能效。然而,使用大型macro會帶來更大的權重更新懲罰,部分運算也會受到memory bound的限制,即更新權重所需的延遲超過了實際計算所需的延遲,這是系統性能無法接受的瓶頸。為了解決memory bound所引發的高延遲問題,我們提出了一種模型映射最佳化方法,將容易產生memory bound的運算映射到數位處理單元上。通過映射方法,我們採用了群組映射(group mapping)技術,改變模型大小,從而減少參數量和計算量,進一步降低記憶體的負擔與延遲。利用這個方法,我們在VGG9的模型架構下,延遲減少了75.8\%,而在Resnet-18的模型架構下,延遲減少了98.8\%,大幅降低CIM在系統端所帶來的更新權重延遲問題。
Computing-in-memory (CIM), which integrates storage and computation within the same device, is regarded as an energy efficient implementation for AI models that can effectively reduce data transfer demands and significantly improving energy efficiency through highly parallel computation. However, current CIM designs face two severe problems. First, at the CIM macro level, CIMs rely heavily on high-precision analog-to-digital converters (ADCs), which result in substantial area and power consumption. On the system application side, the size of deep learning models far exceeds the capacity of CIM, and updating weights one wordline at a time leads to high latency and low hardware utilization. To address these issues, we propose a co-design approach for models and memory.

To resolve macro-level issues, we selected Spiking Neural Networks (SNNs) as the hardware design model. SNNs utilize 1-bit activation functions, which effectively reduce the area and power requirements of ADCs. Furthermore, the timestep characteristic of SNNs helps improve accuracy, compensating for situations where precision is limited. Despite these benefits, SNNs present their own challenges: multiple timesteps can exponentially increase activation storage requirements, and data from different timesteps cannot be reused, which further increases read latency. To address these issues, we designed dedicated hardware for each timestep, enabling data reuse across timesteps and reducing latency. Additionally, we implemented a “tick batching” method, where small data segments are processed across all timesteps before performing strides, thus avoiding extra storage requirements. Ultimately, we developed a high-performance CIM accelerator using TSMC's 28nm process. Operating at 50 MHz, this accelerator achieved 20.97 TOPS in computational performance and 1331.18 TOPS/W in energy efficiency, surpassing existing advanced designs. Our solution demonstrates considerable potential in high-performance and low-power domains, making it particularly suitable for AI edge computing applications.

At the system level, we addressed the challenge of frequent weight updates in CIM. To reduce latency, we first employed large macro units to store more weights, thereby reducing update frequency and enhancing computational throughput to improve energy efficiency. However, using larger macros also incurs a greater penalty for weight updates, and some computations become memory-bound, where the latency from updating weights exceeds the actual computation time, resulting in performance bottlenecks. To address this, we developed an optimized model mapping method that allocates memory-bound operations to digital processing units. Using this mapping strategy, we employed group mapping techniques, adjusting model size to reduce parameter counts and computational load, thus further decreasing memory demands and latency. With this approach, latency was reduced by 75.8\% in the VGG9 architecture and by 98.8\% in the ResNet-18 architecture, effectively mitigating the weight update latency issue at the system level in CIM designs.

所屬典藏

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

引用此條目

Hung, Y.-C. (2024). A Hybrid CIM and Digital Design and its Mapping Optimization for Deep Learning Acceleration. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/4518

BibTeX RIS

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

分享

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