Optimizing for In-Memory Deep Learning With Emerging Memory Technology

Zhehui Wang, Tao Luo, Rick Siow Mong Goh, Wei Zhang, Weng-Fai Wong

TL;DR

This paper tackles the accuracy loss problem in in-memory deep learning caused by the inherent instability of emerging memory technologies (EMTs). They introduce three novel optimization techniques—device-enhanced datasets, energy regularization, and low-fluctuation decomposition—that significantly improve model accuracy and energy efficiency, achieving an order of magnitude better performance than existing methods.

What Problem Does This Paper Address?

Deep learning models are computationally intensive, demanding significant energy and time. In-memory deep learning offers a promising solution by performing computations directly within memory units, drastically reducing data movement. Emerging memory technologies (EMTs) like PCRAM and RRAM are particularly attractive for this due to their high density and energy efficiency. However, a major hurdle is the inherent instability of EMT cells, which leads to random fluctuations in read data. This instability can cause significant accuracy degradation in deep learning models, potentially negating the benefits of in-memory computing. Traditional optimization techniques like pruning and quantization are also less effective with EMTs. This paper aims to bridge this gap by developing methods to overcome EMT instability and achieve high accuracy and energy efficiency in in-memory deep learning.

Methods

The authors propose three key optimization techniques integrated into the training process:

  • Device-Enhanced Dataset: This method augments the standard training dataset with device-specific information, particularly data reflecting the fluctuation patterns of the memory cells. This allows the model to learn to be more robust to these fluctuations, improving accuracy and preventing overfitting.
  • Energy Regularization: A new term is added to the loss function that explicitly penalizes energy consumption. This encourages the optimizer to find model parameters and memory cell energy coefficients that minimize both loss and energy usage simultaneously.
  • Low-Fluctuation Decomposition: This technique decomposes complex computations into multiple smaller time steps. By strategically processing these steps, the method aims to average out the random fluctuations from memory cell reads, leading to a more stable and accurate output.

Datasets

  • CIFAR-10: Used for training and evaluating models like VGG-16, ResNet-18, and MobileNet.
  • ImageNet: Used for evaluating models like ResNet-18 and ResNet-34, particularly under varying fluctuation intensities.
  • Device-Specific Fluctuation Data: This is a novel aspect, where data representing the random states of memory cells is incorporated into the training dataset.

Key Insights and Ideas

  • EMT Instability is the Bottleneck: The core challenge isn't just making in-memory computing efficient, but making it accurate despite the inherent noise in EMTs.
  • Training Data Needs to Reflect Reality: Simply training on ideal data won't work for noisy hardware. Incorporating device-specific fluctuation data is crucial for robustness.
  • Energy and Accuracy are Intertwined: The paper demonstrates that optimizing for energy efficiency can be directly linked to improving accuracy by carefully tuning parameters like the energy coefficient of memory cells.
  • Decomposition as a Noise Reduction Strategy: Breaking down computations into smaller, sequential steps can effectively average out random errors, a clever way to combat analog noise.
  • Holistic Optimization is Key: Combining multiple techniques (device-enhanced data, energy regularization, and decomposition) yields the best results, outperforming individual approaches.

Key Results

  • The proposed solutions (A+B and A+B+C) achieve significantly higher accuracy compared to traditional optimizers, especially as energy budgets decrease.
  • Solution A+B+C can fully recover state-of-the-art accuracy on datasets like CIFAR-10 and ImageNet, even under tight energy constraints.
  • The methods achieve at least an order of magnitude improvement in energy efficiency compared to state-of-the-art solutions.
  • The proposed solutions demonstrate robustness across different fluctuation intensities (weak, normal, strong).
  • For the ImageNet dataset, the proposed solutions achieve the same accuracy as baseline GPU models, while state-of-the-art methods show accuracy loss.

Limitations and Future Work

  • Latency Trade-off: While solution A+B+C excels in energy efficiency and accuracy, it incurs higher latency due to the decomposition process. The authors suggest that developers can choose between solution A+B (lower latency) and A+B+C based on their specific application's needs.
  • Bias Fluctuation: The paper mentions that bias terms can also fluctuate, and while they can be handled similarly to weights, it's an area for further exploration.
  • Generalizability to Other EMTs: While the paper focuses on general EMT principles, further validation across a wider range of specific EMT technologies might be beneficial.

Summary updated

BibTeX
@article{wang2024optimizing,
  author = {Zhehui Wang and Tao Luo and Rick Siow Mong Goh and Wei Zhang and Weng-Fai Wong},
  title = {{Optimizing for In-Memory Deep Learning With Emerging Memory Technology}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2024},
  doi = {10.1109/tnnls.2023.3285488},
}
Figure