Accuracy and Resiliency of Analog Compute-in-Memory Inference Engines

Zhe Wan, Tianyi Wang, Yiming Zhou, Subramanian S. Iyer, Vwani RoychowdhuryACM Journal on Emerging Technologies in Computing Systems 2020

Abstract

Analog compute-in-memory (CIM) architectures based on emerging analog non-volatile memory (NVM) technologies offer a promising path toward ultra-energy-efficient deep neural network (DNN) inference. However, these systems are inherently susceptible to device stochasticity and programming errors, which can lead to catastrophic accuracy loss in large-scale models. This paper presents a software-hardware co-design approach to address these challenges. We introduce an analog floating-point representation and the Hessian-Aware Stochastic Gradient Descent (HA-SGD) training algorithm. Our results demonstrate that these techniques significantly enhance the resiliency of DNNs, enabling high-accuracy inference on complex tasks like CIFAR-100 even in the presence of substantial hardware noise.

Introduction: The Challenge of Analog Noise

The "Von Neumann bottleneck"—the energy-intensive process of moving data between processors and memory—is the primary limit on AI performance today. Compute-in-Memory (CIM) solves this by performing calculations (specifically Vector-Matrix Multiplications) directly inside memory arrays. Analog CIM using non-volatile memory (NVM) like RRAM or Flash is particularly attractive because it leverages physical laws (Ohm’s Law and Kirchhoff’s Law) to perform math at a fraction of the power of digital circuits.

However, analog devices are stochastic; their resistance values shift due to programming errors, temperature, and wear. As shown in Figure 3, the actual programmed current often deviates from the target, creating a distribution of errors that can destroy the accuracy of large neural networks trained on "perfect" digital hardware.

Figure 3: Characterization of programming noise in analog NVM devices, showing (a) target vs. measured current and (b) the resulting error distribution.

Methods for Resilient Inference

To bridge the gap between noisy hardware and high-accuracy requirements, we propose a three-pronged approach:

1. Analog Floating-Point Representation

Instead of a fixed mapping of weights to device conductance, we use a per-filter scaling factor (controlled by discharging current). This ensures that the weights of every layer utilize the full dynamic range of the analog devices, maximizing the signal-to-noise ratio (SNR). Crucially, scaling bias terms relative to weights prevents them from drowning out the signal with noise. Figure 5 illustrates how this scaling aligns the distributions of weights and biases to optimize the hardware's dynamic range.

Figure 5: Weight (W) and bias (b) distributions before and after scaling, demonstrating the effect of the analog floating-point representation on data alignment.

2. Hessian-Aware SGD (HA-SGD)

Standard training looks for the lowest point (minimum) in the loss landscape. However, if this minimum is in a "sharp" valley, a tiny shift in weight due to noise causes a huge jump in error. HA-SGD optimizes for the flattest point (low Hessian norm). In a flat valley, the model remains accurate even if the weights shift slightly. We achieve this by injecting noise during the training process to "smoothen" the cost function.

3. Simulation Framework

Built on PyTorch, our simulation framework allows researchers to inject realistic hardware noise models (derived from physical device data) into the inference path. This enables the evaluation of model performance on noisy hardware before physical implementation.

Key Results and Discussion

Our methods were evaluated on the CIFAR-100 dataset using Wide ResNet-28 architectures, yielding several key insights:

  • Massive Accuracy Recovery: On a model with 6% device noise, standard training accuracy plummeted to ~71%. Using HA-SGD, accuracy was restored to 88.47%.
  • Extreme Noise Tolerance: Even at 10% noise, where standard models collapsed to near-random performance (~14%), HA-SGD maintained a respectable 61.67% accuracy.
  • ADC Savings: The method proved resilient even when using low-resolution (6-bit) Analog-to-Digital Converters (ADCs). Since ADCs are significant power and area consumers in CIM chips, this finding is a major win for hardware designers.

Conclusion

This work demonstrates that the inherent noise of analog CIM hardware is not an insurmountable barrier to large-scale AI. Through hardware-aware training (HA-SGD) and optimized data representation (analog floating-point), we can shift the burden of precision from expensive hardware fabrication to intelligent software design. Future research will explore the application of these techniques to on-chip training and more complex, non-linear device non-idealities.

Summary updated

BibTeX
@article{wan2020accuracy,
  author = {Zhe Wan and Tianyi Wang and Yiming Zhou and Subramanian S. Iyer and Vwani Roychowdhury},
  title = {{Accuracy and Resiliency of Analog Compute-in-Memory Inference Engines}},
  journal = {ACM Journal on Emerging Technologies in Computing Systems},
  year = {2020},
}
Figure