TL;DR
This paper introduces MC-CIM, a novel compute-in-memory (CIM) framework that enables efficient and low-power Bayesian inference on edge devices. By integrating Monte Carlo Dropout (MC-Dropout) directly into the CIM hardware, MC-CIM can provide not only predictions but also crucial uncertainty estimates, vital for risk-aware decision-making in dynamic environments.
What Problem Does This Paper Address?
Edge devices, such as drones and AR/VR glasses, often operate in highly dynamic and unpredictable environments. For critical applications on these devices, simply making a prediction isn't enough; understanding the confidence in that prediction is paramount. Traditional deep neural networks (DNNs) with deterministic weights struggle to provide this uncertainty information, leading to potential risks when mispredictions have severe consequences. Bayesian inference offers a solution by quantifying uncertainty, but it's notoriously computationally expensive, making it unsuitable for resource-constrained edge hardware. While Monte Carlo Dropout (MC-Dropout) offers a computationally efficient approximation to Bayesian inference, its implementation still poses challenges for low-power edge deployment. This paper addresses this gap by proposing a CIM architecture specifically designed to accelerate MC-Dropout, making robust, uncertainty-aware AI feasible at the edge.
Methods
The core innovation is the MC-CIM framework, which combines compute-in-memory (CIM) principles with MC-Dropout. Key techniques include:
- SRAM-based CIM Macro: The framework utilizes an 8T SRAM cell architecture designed for in-memory computation. This avoids costly data movement between memory and processing units.
- In-Memory Probabilistic Dropout: MC-CIM integrates a random dropout bit generator directly within the SRAM macro. This allows for probabilistic neuron dropping during inference without external hardware.
- Multiplication-Free (MF) Operator: The paper leverages a novel compute-in-memory operator that performs a bitplane-wise processing of inputs and weights. This significantly reduces computational complexity and eliminates the need for digital-to-analog converters (DACs).
- Compute Reuse: To further optimize workload, MC-CIM implements a "compute reuse" strategy. This allows successive MC-Dropout iterations to share computations from previous iterations, effectively reducing redundant calculations.
- Optimal Sample Ordering: The authors propose using combinatorial optimization, specifically a Traveling Salesman Problem (TSP) formulation, to order the MC-Dropout iterations. This ordering maximizes compute reuse opportunities, minimizing the overall computational burden.
- Asymmetric Successive Approximation (SA) ADC: For analog-to-digital conversion, an asymmetric SA approach is used. This leverages the statistics of the multiply-average (MAV) signal to reduce conversion cycles and improve energy efficiency.
- SRAM-Embedded RNG Calibration: The random number generators (RNGs) for dropout bits are calibrated using SRAM's inherent parasitic leakage currents. This provides a lightweight calibration mechanism.
Datasets
The paper evaluates the proposed MC-CIM framework on the following datasets:
- MNIST: Used for character recognition tasks.
- RGB-D Scenes v2 dataset: Used for visual odometry (VO) and drone localization.
Key Insights and Ideas
- Synergy of MC-Dropout and CIM: The paper demonstrates a powerful synergy between MC-Dropout and CIM. MC-Dropout's probabilistic nature benefits from CIM's in-memory processing to reduce data movement, while CIM's efficiency allows for the multiple iterations required by MC-Dropout.
- RNG Tolerance: A significant finding is the framework's robustness to non-idealities in the embedded RNGs. Even with biased dropout probabilities, the MC-Dropout inference maintains a high degree of tolerance, simplifying the RNG design.
- Precision Scalability: MC-CIM shows better accuracy at lower precision (e.g., 4-bit) compared to deterministic inference, which is crucial for edge devices with limited memory.
- Confidence as a Feature: The work highlights that predictive uncertainty (confidence) is not just a byproduct but a valuable feature that can be directly used for risk-aware decision-making in applications like drone control.
- Energy Efficiency Gains: The combination of compute reuse, optimal sample ordering, and asymmetric ADC leads to substantial energy savings compared to typical CIM implementations.
Key Results
- Energy Savings: MC-CIM with compute reuse and optimal sample ordering consumes 27.8 pJ for 30 MC-Dropout instances, achieving approximately 43% energy savings compared to typical execution.
- Accuracy: The framework maintains state-of-the-art accuracy on MNIST (98.4%) and demonstrates competitive performance in visual odometry, even at lower precision.
- Error-Uncertainty Correlation: A strong correlation (0.31 Pearson correlation coefficient) was observed between pose error and predictive uncertainty in visual odometry, indicating the practical utility of the confidence estimates.
- Robustness to Non-idealities: The framework shows good error-uncertainty correlation even with significant dropout probability perturbations and at lower input/weight precisions (down to 4-bit).
- TOPS/W: The MC-CIM macro achieves ~3.5 TOPS/W (4-bit precision) and ~2.23 TOPS/W (6-bit precision) for 30 MC-Dropout iterations, which is competitive for Bayesian inference accelerators.
Limitations and Future Work
- Storage Overhead for Schedules: The optimal sample ordering strategy requires storing dropout schedules, which introduces an additional storage overhead. However, the authors note that extracting sufficient statistics from a small number of iterations (10-30) makes this a viable trade-off for many applications.
- Hardware Complexity: While optimized, the CIM architecture with integrated RNGs and specialized operators is more complex than standard CIM designs.
- Future Work: The paper suggests further exploration of fine-grained calibration for RNGs and investigating the impact of process variations on a wider range of applications. The authors also implicitly point towards the broader applicability of this approach for other Bayesian inference techniques on edge devices.
Summary updated