應用於人工智慧和傅立葉轉換運算邊緣裝置之高能效多位元記憶體內運算加速器
Energy-Efficient Multi-Bit CIM Accelerators for AI and DFT on Edge Devices
摘要
記憶體內運算(CIM) 架構在近年被廣泛研究用於部署卷積神經網路(CNN) 和
Transformer 模型,不同於傳統馮·諾依曼架構在部署神經網路模型需要存取頻繁記憶體
來大量搬運數據造成計算延遲和功耗大幅增加,CIM 透過將存儲與計算整合於同一電
路單元,並利用高度平行運算來提高能量效率,藉此大幅減少資料在記憶體和運算單
元間的頻繁傳輸,為馮·諾依曼架構的記憶體瓶頸提供一種高效率的解決方案。然而,
當前的CIM 在應用層面存在一些挑戰和未被重視之處: 第一,為了應對日益複雜的神經
網路模型和任務,現有的低精度CIM 已不足以滿足準確率需求,同時一般CNN 模型未
針對CIM 硬體約束進行參數壓縮導致硬體使用率過低,而多位元類比CIM 中大量高精
度DAC 和ADC 又造成功耗過高的問題;第二,CIM 內部的交叉陣列相當適用於離散
傅立葉轉換的矩陣向量運算,然而目前此議題僅有少數研究,現有的研究和傳統數位
設計相比在吞吐量和能效上也沒有突出的優勢。
首先為了解決低精度CIM 不足以應對複雜模型和任務,我們提出一種用於人工智慧
運算邊緣裝置的高能效多位元靜態隨機存取記憶體(SRAM-based) CIM 加速器,採用浮
點數× 整數的混合精度CNN 模型,藉此提升模型準確率表現以補足原先低精度CIM
的限制。而在CIM 適配壓縮模型之議題上,我們參考並使用記憶體運算感知模型的方
法,在模型訓練過程中模擬CIM 的真實運算流程,有效根據硬體約束來縮減參數量,
另外也對模型權重在CIM 上更新進行優化,增加硬體使用率的同時降低能耗和推論延
遲。而針對DAC 和ADC 高功耗的問題,我們透過內建於加速器的可編程指令集來離
線逐層地記錄待部署模型的DAC 和ADC 使用情況,在模型的各層運算開始前將未使
用到的DAC 和ADC 電源關閉,有效將DAC 和ADC 的功耗大幅縮減至原先的31.6%
和86.7%。所提出的硬體設計透過台積電16 奈米製程實現此高效能CIM 加速器,在
100 MHz 的工作頻率下達到1.64 TFLOPS 的算力和94.65 TFLOPS/W 的能效。
此外,針對第二項關於離散傅立葉轉換運算的議題,我們提出了一種用於邊緣裝置可擴展的多位元靜態隨機存取記憶體離散傅立葉轉換CIM 加速器,捨棄主流的快速
傅立葉轉換演算法帶來的多級運算和複雜控制,直接將離散傅立葉轉換(DFT) 運算映
射在CIM 交叉陣列上,透過CIM 高平行度的矩陣向量乘法加速,來達到更高的吞吐
量和更低的能量延遲積(EDP)。基於上述優勢之外,我們利用旋轉因子(Twiddle factor)
的週期性和對稱性來高效壓縮Twiddle factors,將其所需的儲存空間大幅縮減至原本
的0.003%,也同步壓縮DFT 矩陣向量乘法的運算量和輸出的儲存空間至原本的50%,
並且皆可部署於類比CIM 和數位CIM。此外,針對類比CIM 我們提出動態範圍分組
(Dynamic Range Grouping) 來緩解量化誤差帶來的運算品質損失。我們提出多個優化方
法來適配整個映射流程,且在類比CIM 和數位CIM 都給出可以滿足多數不同領域和應
用需求的信號-量化雜訊比(SQNR),亦可支援多種不同長度的離散傅立葉轉換運算。而
在長度為1024 點的離散傅立葉轉換運算下,我們使用台積電16 奈米製程的類比CIM
和台積電22 奈米製程的數位CIM,對比其他離散傅立葉轉換CIM 先進設計的性能可以
提升3.63 倍的吞吐量和降低7.59 倍的EDP;對比其他離散傅立葉轉換先進數位加速器
的性能可以提升6.42 倍的吞吐量和降低11.81 倍的EDP。
Transformer 模型,不同於傳統馮·諾依曼架構在部署神經網路模型需要存取頻繁記憶體
來大量搬運數據造成計算延遲和功耗大幅增加,CIM 透過將存儲與計算整合於同一電
路單元,並利用高度平行運算來提高能量效率,藉此大幅減少資料在記憶體和運算單
元間的頻繁傳輸,為馮·諾依曼架構的記憶體瓶頸提供一種高效率的解決方案。然而,
當前的CIM 在應用層面存在一些挑戰和未被重視之處: 第一,為了應對日益複雜的神經
網路模型和任務,現有的低精度CIM 已不足以滿足準確率需求,同時一般CNN 模型未
針對CIM 硬體約束進行參數壓縮導致硬體使用率過低,而多位元類比CIM 中大量高精
度DAC 和ADC 又造成功耗過高的問題;第二,CIM 內部的交叉陣列相當適用於離散
傅立葉轉換的矩陣向量運算,然而目前此議題僅有少數研究,現有的研究和傳統數位
設計相比在吞吐量和能效上也沒有突出的優勢。
首先為了解決低精度CIM 不足以應對複雜模型和任務,我們提出一種用於人工智慧
運算邊緣裝置的高能效多位元靜態隨機存取記憶體(SRAM-based) CIM 加速器,採用浮
點數× 整數的混合精度CNN 模型,藉此提升模型準確率表現以補足原先低精度CIM
的限制。而在CIM 適配壓縮模型之議題上,我們參考並使用記憶體運算感知模型的方
法,在模型訓練過程中模擬CIM 的真實運算流程,有效根據硬體約束來縮減參數量,
另外也對模型權重在CIM 上更新進行優化,增加硬體使用率的同時降低能耗和推論延
遲。而針對DAC 和ADC 高功耗的問題,我們透過內建於加速器的可編程指令集來離
線逐層地記錄待部署模型的DAC 和ADC 使用情況,在模型的各層運算開始前將未使
用到的DAC 和ADC 電源關閉,有效將DAC 和ADC 的功耗大幅縮減至原先的31.6%
和86.7%。所提出的硬體設計透過台積電16 奈米製程實現此高效能CIM 加速器,在
100 MHz 的工作頻率下達到1.64 TFLOPS 的算力和94.65 TFLOPS/W 的能效。
此外,針對第二項關於離散傅立葉轉換運算的議題,我們提出了一種用於邊緣裝置可擴展的多位元靜態隨機存取記憶體離散傅立葉轉換CIM 加速器,捨棄主流的快速
傅立葉轉換演算法帶來的多級運算和複雜控制,直接將離散傅立葉轉換(DFT) 運算映
射在CIM 交叉陣列上,透過CIM 高平行度的矩陣向量乘法加速,來達到更高的吞吐
量和更低的能量延遲積(EDP)。基於上述優勢之外,我們利用旋轉因子(Twiddle factor)
的週期性和對稱性來高效壓縮Twiddle factors,將其所需的儲存空間大幅縮減至原本
的0.003%,也同步壓縮DFT 矩陣向量乘法的運算量和輸出的儲存空間至原本的50%,
並且皆可部署於類比CIM 和數位CIM。此外,針對類比CIM 我們提出動態範圍分組
(Dynamic Range Grouping) 來緩解量化誤差帶來的運算品質損失。我們提出多個優化方
法來適配整個映射流程,且在類比CIM 和數位CIM 都給出可以滿足多數不同領域和應
用需求的信號-量化雜訊比(SQNR),亦可支援多種不同長度的離散傅立葉轉換運算。而
在長度為1024 點的離散傅立葉轉換運算下,我們使用台積電16 奈米製程的類比CIM
和台積電22 奈米製程的數位CIM,對比其他離散傅立葉轉換CIM 先進設計的性能可以
提升3.63 倍的吞吐量和降低7.59 倍的EDP;對比其他離散傅立葉轉換先進數位加速器
的性能可以提升6.42 倍的吞吐量和降低11.81 倍的EDP。
Compute-in-Memory (CIM) architectures have been extensively researched in recent years
for deploying Convolutional Neural Networks (CNNs) and Transformer models. Unlike traditional
von Neumann architectures that require frequent memory access and massive data movement
when deploying neural network models, leading to significant computational latency and
power consumption increases, CIM integrates storage and computation within the same circuit
unit and leverages highly parallel computing to improve energy efficiency. This approach substantially
reduces frequent data transmission between memory and processing units, providing
an efficient solution to the memory bottleneck in von Neumann architectures. However, current
CIM implementations face several challenges and overlooked aspects at the application level:
First, to address increasingly complex neural network models and tasks, existing low-precision
CIM is insufficient to meet accuracy requirements, while conventional CNN models without
CIM-aware parameter compression result in low hardware utilization, and the numerous highprecision
DACs and ADCs in multi-bit analog CIM cause excessive power consumption. Second,
the crossbar arrays within CIM are highly suitable for matrix-vector operations in Discrete
Fourier Transform (DFT), yet this topic has received limited research attention, and existing
CIM studies show no significant advantages in throughput and energy efficiency compared to
traditional digital designs. To address the limitation of low-precision CIM in handling complex models and tasks, we
propose a high-energy-efficiency multi-bit Static Random Access Memory (SRAM-based) CIM
accelerator for artificial intelligence edge devices. The accelerator employs a hybrid-precision
CNN model combining floating-point and integer arithmetic to enhance model accuracy performance
and compensate for the limitations of low-precision CIM. Regarding CIM-adaptive
model compression, we reference and utilize CIM-aware model adaptation methods that simulate the actual CIM computational flow during model training, effectively reducing parameter
count according to hardware constraints. Additionally, we optimize model weight updates on
CIM, increasing hardware utilization while reducing energy consumption and inference latency.
To address the high power consumption of DACs and ADCs, we implement a programmable
instruction set built into the accelerator to offline record the DAC and ADC usage patterns of
models to be deployed layer by layer. Before computation begins for each model layer, unused
DACs and ADCs are powered off, effectively reducing DAC and ADC power consumption to
31.6% and 86.7% of their original levels, respectively. The proposed hardware design implements
this high-performance CIM accelerator using TSMC 16nm CMOS technology, achieving
1.64 TFLOPS computational performance and 94.65 TFLOPS/W energy efficiency at 100 MHz
operating frequency.
Furthermore, addressing the second challenge regarding DFT operations, we propose a scalable
multi-bit SRAM-based DFT CIM accelerator for edge devices. Rather than using mainstream
Fast Fourier Transform algorithms with their multi-stage operations and complex control,
we directly map DFT operations onto CIM crossbar arrays. Through CIM’s high-parallelism
matrix-vector multiplication acceleration, we achieve higher throughput and lower Energy Delay
Product (EDP). Beyond these advantages, we exploit the periodicity and symmetry properties
of twiddle factors to achieve efficient compression, drastically reducing their storage
requirements to 0.003% of the original size. We simultaneously compress the computational
complexity of DFT matrix-vector multiplications and output storage requirements to 50% of
the original, with both optimizations deployable on both analog and digital CIM architectures.
Additionally, for analog CIM, we propose Dynamic Range Grouping to mitigate computational
quality degradation caused by quantization errors. We propose multiple optimization methods
to adapt the entire mapping process, providing Signal-to-Quantization-Noise Ratio (SQNR) performance
that satisfies requirements across various domains and applications for both analog and
digital CIM, while supporting DFT operations of various lengths. For 1024-point DFT operations,
using TSMC 16nm process analog CIM and TSMC 22nm process digital CIM, our design
demonstrates 3.63× throughput improvement and 7.59× EDP reduction compared to other advanced
DFT CIM designs. Compared to other advanced digital DFT accelerators, our design demonstrates 6.42× throughput improvement and 11.81× EDP reduction.
for deploying Convolutional Neural Networks (CNNs) and Transformer models. Unlike traditional
von Neumann architectures that require frequent memory access and massive data movement
when deploying neural network models, leading to significant computational latency and
power consumption increases, CIM integrates storage and computation within the same circuit
unit and leverages highly parallel computing to improve energy efficiency. This approach substantially
reduces frequent data transmission between memory and processing units, providing
an efficient solution to the memory bottleneck in von Neumann architectures. However, current
CIM implementations face several challenges and overlooked aspects at the application level:
First, to address increasingly complex neural network models and tasks, existing low-precision
CIM is insufficient to meet accuracy requirements, while conventional CNN models without
CIM-aware parameter compression result in low hardware utilization, and the numerous highprecision
DACs and ADCs in multi-bit analog CIM cause excessive power consumption. Second,
the crossbar arrays within CIM are highly suitable for matrix-vector operations in Discrete
Fourier Transform (DFT), yet this topic has received limited research attention, and existing
CIM studies show no significant advantages in throughput and energy efficiency compared to
traditional digital designs. To address the limitation of low-precision CIM in handling complex models and tasks, we
propose a high-energy-efficiency multi-bit Static Random Access Memory (SRAM-based) CIM
accelerator for artificial intelligence edge devices. The accelerator employs a hybrid-precision
CNN model combining floating-point and integer arithmetic to enhance model accuracy performance
and compensate for the limitations of low-precision CIM. Regarding CIM-adaptive
model compression, we reference and utilize CIM-aware model adaptation methods that simulate the actual CIM computational flow during model training, effectively reducing parameter
count according to hardware constraints. Additionally, we optimize model weight updates on
CIM, increasing hardware utilization while reducing energy consumption and inference latency.
To address the high power consumption of DACs and ADCs, we implement a programmable
instruction set built into the accelerator to offline record the DAC and ADC usage patterns of
models to be deployed layer by layer. Before computation begins for each model layer, unused
DACs and ADCs are powered off, effectively reducing DAC and ADC power consumption to
31.6% and 86.7% of their original levels, respectively. The proposed hardware design implements
this high-performance CIM accelerator using TSMC 16nm CMOS technology, achieving
1.64 TFLOPS computational performance and 94.65 TFLOPS/W energy efficiency at 100 MHz
operating frequency.
Furthermore, addressing the second challenge regarding DFT operations, we propose a scalable
multi-bit SRAM-based DFT CIM accelerator for edge devices. Rather than using mainstream
Fast Fourier Transform algorithms with their multi-stage operations and complex control,
we directly map DFT operations onto CIM crossbar arrays. Through CIM’s high-parallelism
matrix-vector multiplication acceleration, we achieve higher throughput and lower Energy Delay
Product (EDP). Beyond these advantages, we exploit the periodicity and symmetry properties
of twiddle factors to achieve efficient compression, drastically reducing their storage
requirements to 0.003% of the original size. We simultaneously compress the computational
complexity of DFT matrix-vector multiplications and output storage requirements to 50% of
the original, with both optimizations deployable on both analog and digital CIM architectures.
Additionally, for analog CIM, we propose Dynamic Range Grouping to mitigate computational
quality degradation caused by quantization errors. We propose multiple optimization methods
to adapt the entire mapping process, providing Signal-to-Quantization-Noise Ratio (SQNR) performance
that satisfies requirements across various domains and applications for both analog and
digital CIM, while supporting DFT operations of various lengths. For 1024-point DFT operations,
using TSMC 16nm process analog CIM and TSMC 22nm process digital CIM, our design
demonstrates 3.63× throughput improvement and 7.59× EDP reduction compared to other advanced
DFT CIM designs. Compared to other advanced digital DFT accelerators, our design demonstrates 6.42× throughput improvement and 11.81× EDP reduction.