MemTorch: An Open-source Simulation Framework for Memristive Deep Learning Systems
Corey Lammie, Wei Xiang, Bernabé Linares-Barranco, Mostafa Rahimi Azghadi
TL;DR
MemTorch addresses the challenge of simulating memristive deep learning systems with realistic device non-idealities by providing a configurable, open-source co-simulation framework that integrates with PyTorch. The approach combines modular memristor crossbar representations (1T1R/0T1R), tile-based mapping, and multiple device models (e.g., linear ion drift, VTEAM, PKU RRAM) with stochastic non-idealities to study accuracy and robustness. Key contributions include a C++/CUDA/Python implementation, crossbar peripheral modeling, and demonstration of CIFAR-10/classification performance under device variability and faults. The framework enables rapid exploration of device physics and circuit-level constraints, supporting research and hardware-aware ML development. This work advances the usability and accessibility of memristive DL simulations for both algorithm and hardware co-design.
Abstract
Memristive devices have shown great promise to facilitate the acceleration and improve the power efficiency of Deep Learning (DL) systems. Crossbar architectures constructed using these Resistive Random-Access Memory (RRAM) devices can be used to efficiently implement various in-memory computing operations, such as Multiply Accumulate (MAC) and unrolled-convolutions, which are used extensively in Deep Neural Networks (DNNs) and Convolutional Neural Networks (CNNs). However, memristive devices face concerns of aging and non-idealities, which limit the accuracy, reliability, and robustness of Memristive Deep Learning Systems (MDLSs), that should be considered prior to circuit-level realization. This Original Software Publication (OSP) presents MemTorch, an open-source framework for customized large-scale memristive DL simulations, with a refined focus on the co-simulation of device non-idealities. MemTorch also facilitates co-modelling of key crossbar peripheral circuitry. MemTorch adopts a modernized soft-ware engineering methodology and integrates directly with the well-known PyTorch Machine Learning (ML) library
