A fast algorithm to simulate nonlinear resistive networks

Benjamin Scellier

Abstract

Simulating large-scale nonlinear resistive networks (NRNs) has traditionally been a computationally expensive task, creating a bottleneck in the development of neuromorphic hardware. This paper presents a novel approach that frames the steady-state behavior of NRNs as a convex Quadratic Programming (QP) problem. By exploiting the bipartite structure of Deep Resistive Networks (DRNs), we introduce an exact block coordinate descent algorithm optimized for GPU acceleration. Our method achieves a 160x speedup over standard SPICE simulators and enables the training of networks with over 50 million parameters, representing a significant leap in the scale and efficiency of analog-inspired AI simulation.

Introduction

Neuromorphic computing aims to achieve the energy efficiency of biological brains by utilizing analog hardware. However, the development of these systems is hindered by a "simulation bottleneck." Researchers must currently choose between linear networks, which are easy to simulate but lack the expressive power of nonlinear activations, and general-purpose circuit simulators like SPICE. While SPICE can model nonlinear components such as diodes, it is not optimized for the massive, repetitive architectures found in machine learning, often requiring weeks to train even small networks.

This work bridges this gap by providing a high-performance simulation framework for large-scale, nonlinear analog networks, achieving speeds comparable to modern deep learning frameworks.

Theoretical Framework: Circuits as Optimization

The core contribution of this work is the theoretical demonstration that, under the assumption of ideal circuit elements (resistors, diodes, and voltage/current sources), the steady state of a resistive network—defined by the voltages at every node—is the unique solution to a convex Quadratic Programming (QP) problem with linear inequality constraints.

In this framework, the network's steady state corresponds to the configuration that minimizes a specific energy function representing power dissipation. Crucially, ideal diodes are modeled not as complex nonlinear equations, but as linear inequality constraints (e.g., $v \ge 0$). This allows the simulation to treat diode behavior as a "clipping" operation, analogous to the Rectified Linear Unit (ReLU) activation function used in digital neural networks.

The Deep Resistive Network (DRN) Architecture

To maximize computational efficiency, we focus on Deep Resistive Networks (DRNs), which utilize a layered architecture. This structure forms a bipartite graph, where nodes in one layer are only connected to nodes in adjacent layers.

This bipartite arrangement is critical for parallelization. It allows for the implementation of a Block Coordinate Descent algorithm, where all nodes in even-numbered layers can be updated simultaneously, followed by all nodes in odd-numbered layers. This "checkerboard" update pattern is highly compatible with GPU architectures, removing the sequential processing bottlenecks inherent in standard coordinate descent methods.

Learning via Equilibrium Propagation

The networks are trained using Equilibrium Propagation (EP), a biologically plausible learning rule. EP extracts gradients directly from the physical states of the network during two phases of operation. A key theoretical contribution of this paper is the proof that EP remains mathematically valid even when the system state is restricted by the inequality constraints imposed by diodes—a question that was previously unresolved in the literature.

Experimental Results and Scaling

The proposed algorithm was evaluated primarily on the MNIST dataset, with comparisons to previous SPICE-based benchmarks. The results demonstrate a transformative shift in simulation capability:

  • Massive Scaling: We successfully trained a "DRN-XL" model featuring 51.7 million parameters. This is a 327-fold increase over the previous state-of-the-art SPICE baseline, which was limited to 0.16 million parameters.
  • Superior Speed: Simulations performed on an NVIDIA A100 GPU were 160x faster than SPICE simulations. When accounting for the increase in network size, the "network-size-to-epoch-duration" ratio improved by a factor of 50,000.
  • Improved Accuracy: The ability to simulate larger networks led to a significant reduction in error. The DRN-XL achieved a 1.33% test error on MNIST, compared to the 3.43% error reported for smaller, SPICE-simulated models.
  • Rapid Convergence: DRNs reached steady-state equilibrium in significantly fewer iterations (approximately 6) compared to other energy-based models like Deep Hopfield Networks, which typically require 100 or more iterations.

Limitations and Future Work

While this algorithm provides a powerful "north star" for large-scale neuromorphic design, it currently relies on the assumption of ideal components. Real-world analog circuits involve parasitic effects, such as leakage currents and non-zero forward voltage drops in diodes. Future research will focus on adapting the algorithm to accommodate piece-wise linear i-v curves and other non-ideal characteristics. Additionally, exploring the application of this fast simulation technique to unstructured or disordered networks could open new avenues for hardware-software co-design in AI.

Summary updated

BibTeX
@inproceedings{scellier2024fast,
  author = {Benjamin Scellier},
  title = {{A fast algorithm to simulate nonlinear resistive networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=nAbfF37H6t},
}
Figure