Gradient descent-based programming of analog in-memory computing cores

Julian Büchel, Athanasios Vasilopoulos, Benedikt Kersting, Frédéric Odermatt, Kevin Brew, Injo Ok, Samuel Choi, Iqbal Saraf, Victor Chan, Timothy Philip, Nicole Saulnier, Vijay Narayanan, Manuel Le Gallo, Abu Sebastian2022 · DOI · OpenReview

Abstract

The precise programming of crossbar arrays of unit-cells is crucial for obtaining high matrix-vector-multiplication (MVM) accuracy in analog in-memory computing (AIMC) cores. We propose a radically different approach based on directly minimizing the MVM error using gradient descent with synthetic random input data. Our method significantly reduces the MVM error compared with conventional unit-cell by unit-cell iterative programming. It also eliminates the need for high-resolution analog-to-digital converters (ADCs) to read the small unit-cell conductance during programming. Our method improves the experimental inference accuracy of ResNet-9 implemented on two phase-change memory (PCM)-based AIMC cores by 1.26%.

Introduction

Analog In-Memory Computing (AIMC) is a promising frontier for AI hardware, enabling Matrix-Vector Multiplications (MVM)—the computational backbone of deep learning—to be performed in constant time and with high power efficiency. This is achieved using crossbar arrays of memristive devices like phase-change memory (PCM). However, achieving the necessary precision is challenging.

The standard "iterative programming" approach tunes each cell individually, which requires high-resolution Analog-to-Digital Converters (ADCs) to sense tiny currents and fails to account for systemic errors like IR-drop or peripheral circuit nonlinearities. Furthermore, conductance drift can cause early-programmed cells to deviate while later ones are being tuned. To address these limitations, researchers have developed Gradient Descent-based Programming (GDP). This method optimizes the performance of an entire crossbar array simultaneously by directly minimizing the MVM error, bypassing the need for high-resolution ADCs and naturally compensating for hardware imperfections.

Methods: Chip-in-the-Loop Optimization

Instead of local cell-by-cell tuning, GDP treats the crossbar as a single functional unit. The workflow involves a "chip-in-the-loop" approach where the entire array is optimized based on its aggregate output.

GDP workflow, algorithm pseudocode, and crossbar schematic for error minimization.

The GDP Workflow: 1. Initialization: Devices are roughly programmed to target weights using a quick single-shot pulse. 2. On-Chip MVM: The chip performs a batch of MVMs using synthetic, randomly generated input vectors ($x \sim U[-127, 127]$). 3. Loss Calculation: The hardware output is compared to the mathematically ideal result in software to calculate the MVM error. 4. Gradient Descent: Gradients are calculated from this loss to determine the next set of programming pulses sent to the chip. 5. Iteration: This loop repeats until the MVM error reaches a satisfactory floor.

By observing the actual output of the hardware, the gradient descent algorithm naturally compensates for nonlinearities and systemic errors that individual cell tuning ignores.

Key Results and Evaluation

The GDP method was evaluated using a ResNet-9 architecture mapped across two PCM cores and tested on the CIFAR-10 dataset.

Accuracy and Error Reduction

GDP consistently reached a lower MVM error floor compared to iterative methods. On the ResNet-9 model, GDP improved CIFAR-10 inference accuracy from 84.75% to 86.01%. This improvement is largely due to the algorithm's ability to adjust neighboring devices to compensate for local inaccuracies, leading to a lower total MVM error ($\epsilon_{total}$).

Comparison of total MVM error over iterations for different programming methods.

Robustness and Hardware Benefits

  • ADC Relaxation: GDP relies on aggregate column currents rather than individual cell currents, eliminating the need for specialized high-precision ADCs during the programming phase. This was particularly successful for low-conductance "Type II" PCM devices where standard methods often fail due to resolution limits.
  • Input Agnosticism: Weights optimized using random noise were found to be robust, performing well on real-world data with varying distributions or sparsity levels.
  • Drift Resilience: GDP-programmed arrays maintained their accuracy advantage over 24 hours, suggesting a more stable configuration against PCM conductance drift.

Discussion and Future Work

GDP represents a shift from local to global optimization in AIMC. While highly effective, the current implementation relies on digital gradient computation in software, which introduces some computational overhead. Future research will explore moving gradient calculations on-chip to further accelerate the programming cycle and scaling the method to larger, more complex architectures like transformers.

Summary updated

Abstract

The precise programming of crossbar arrays of unit-cells is crucial for obtaining high matrix-vector-multiplication (MVM) accuracy in analog in-memory computing (AIMC) cores. We propose a radically different approach based on directly minimizing the MVM error using gradient descent with synthetic random input data. Our method significantly reduces the MVM error compared with conventional unit-cell by unit-cell iterative programming. It also eliminates the need for high-resolution analog-to-digital converters (ADCs) to read the small unit-cell conductance during programming. Our method improves the experimental inference accuracy of ResNet-9 implemented on two phase-change memory (PCM)-based AIMC cores by 1.26%.
BibTeX
@inproceedings{buchel2022gradient,
  author = {Julian Büchel and Athanasios Vasilopoulos and Benedikt Kersting and Frédéric Odermatt and Kevin Brew and Injo Ok and Samuel Choi and Iqbal Saraf and Victor Chan and Timothy Philip and Nicole Saulnier and Vijay Narayanan and Manuel Le Gallo and Abu Sebastian},
  title = {{Gradient descent-based programming of analog in-memory computing cores}},
  booktitle = {2022},
  year = {2022},
  doi = {10.1109/iedm45625.2022.10019486},
}
Figure