In-memory computing

Also known as: compute-in-memory · processing-in-memory

On this page 7

In-memory computing, also called compute-in-memory or processing-in-memory, is a chip architecture that performs arithmetic inside or directly beside the memory arrays that store the data, instead of shuttling every operand to a separate processor. In AI hardware, it targets the dominant operation of neural networks, the matrix-vector multiplication, and attacks the memory wall: the fact that moving a weight from memory costs far more energy and time than multiplying it.

The term in this context refers to circuit-level and package-level designs for accelerators, not to in-memory databases that keep tables in server RAM. The approach spans analog crossbar arrays built from SRAM, flash, resistive or phase-change cells, as well as digital logic placed inside DRAM or HBM stacks, and it is a leading candidate for energy-efficient inference at the edge.

Why moving data dominates AI energy

In a conventional von Neumann design, the processor and memory are separate, so every multiply-accumulate requires fetching weights and activations across a bus. For large neural networks with low arithmetic intensity, this traffic, not the arithmetic, sets both the power budget and the throughput ceiling described by the roofline model.

The table gives commonly cited orders of magnitude for a mature CMOS process. Exact values vary with process node, voltage and memory size, but the ratio between access and arithmetic is the point that motivates in-memory computing.

OperationRelative energyComment
8-bit integer addAbout 1xBaseline arithmetic
8-bit integer multiplyAbout 5-10xStill cheap
Small on-chip SRAM readAbout 10-100xGrows with array size
Off-chip DRAM readAbout 1,000x or moreDominates large-model inference
Approximate energy per operation in a mature process

Because a single DRAM access can cost two to three orders of magnitude more than the multiplication it feeds, computing where the weights already sit removes most of the energy bill. This is the core argument for weight-stationary designs, in which parameters never leave the memory array during inference.

How analog compute-in-memory multiplies matrices

Analog compute-in-memory performs a full matrix-vector product in one parallel read of a crossbar array. Each memory cell stores a weight as a conductance value, input activations are applied as voltages on the rows, and each cell contributes a current proportional to voltage times conductance by Ohm’s law. The currents add up on each column by Kirchhoff’s current law, so every column current equals one dot product.

Digital-to-analog converters drive the inputs, and analog-to-digital converters (ADCs) read the column currents. In practice the ADC often consumes a large share of the energy and area, so designers trade output precision, ADC sharing and array size against efficiency. Signed weights are usually represented by differential pairs of cells, and multi-bit weights may be split across several cells.

Memory technologies and design variants

In-memory computing is not one technology but a family of designs that differ in storage cell, compute style and precision. The table compares the main variants used or prototyped for AI workloads.

VariantCompute styleStrengthsWeaknesses
SRAM-based compute-in-memoryDigital or charge-domain analogStandard CMOS, fast, preciseLow density, volatile weights
Flash-based analog arraysAnalog current summingVery dense, nonvolatileSlow writes, limited endurance
Resistive RAM (RRAM)Analog crossbarDense, nonvolatile, low read energyDevice variability, drift
Phase-change memory (PCM)Analog crossbarMulti-level storage, mature researchConductance drift over time
Processing-in-memory DRAMDigital logic in DRAM banksHigh bandwidth, exact arithmeticLimited logic per bank, cost
Near-memory compute in HBMDigital units in the logic dieFits existing acceleratorsSmaller energy savings
Main in-memory computing variants

A useful distinction separates true in-memory computing, where the array itself computes, from near-memory computing, where logic sits in the same package or die stack. Near-memory designs keep digital precision and integrate more easily with existing software, while analog arrays promise the highest efficiency per operation.

How it compares with conventional AI accelerators

In-memory computing competes with digital accelerators such as GPUs, TPUs and NPUs that use systolic arrays and large on-chip buffers. The comparison below shows where each approach fits best.

CriterionDigital acceleratorAnalog in-memory computing
Numerical precisionExact FP16, bfloat16, FP8 or INT8Effective 4-8 bits, noisy
Energy efficiencyHigh, limited by data movementPotentially many times higher
Training supportFull training and inferenceMostly inference only
Model updatesInstant weight reloadSlow, wears out some devices
Software maturityMature compilers and frameworksSpecialized toolchains
Best fitData-center training and servingEdge inference with fixed models
In-memory computing versus digital accelerators

Headline TOPS per watt figures for analog chips are often measured at low precision and high utilization, so they are not directly comparable with digital benchmarks such as MLPerf results. Fair comparisons report accuracy on a full model together with system-level energy, including converters and data movement outside the arrays.

Limitations and engineering challenges

The main obstacle for analog in-memory computing is non-ideal device behavior, which turns exact arithmetic into an approximation. Engineers address it with circuit techniques and with hardware-aware training, in which noise is injected during training so the model tolerates it at inference time.

  • Device variability and noise reduce effective precision and can lower model accuracy.
  • Conductance drift in PCM and RRAM changes stored weights over hours or days and requires calibration.
  • ADC overhead can erase much of the efficiency gain if converters are not shared carefully.
  • Limited array capacity means large language models do not fit, so weights must be partitioned or reloaded.
  • Endurance limits of nonvolatile cells make frequent weight updates and on-chip training difficult.

Explained without jargon

Imagine a cook who must walk to a distant pantry for every single ingredient. Most of the time goes into walking, not cooking. Ordinary computer chips work in a similar way. They spend most of their energy moving data between memory and the processor.

In-memory computing moves the cooking into the pantry. The calculations happen right where the numbers are stored. For AI, this can save a great deal of power. The trade-off is that some versions use electrical currents instead of exact digits, so the answers are slightly less precise.

A typical use case

A manufacturer of battery-powered security cameras wants on-device person detection without sending video to the cloud. Its compact vision model has about 3 million weights, quantized to 8 bits, which fit entirely inside the analog compute-in-memory arrays of a small inference chip. The weights are programmed once at the factory and never leave the arrays during operation.

Before deployment, the engineering team retrains the model with simulated device noise so that accuracy drops by less than one percentage point on the analog hardware. In the field, each frame is processed in a few milliseconds while the vision workload draws only a few milliwatts. As a result, the camera runs months longer on one battery than an earlier version that used a conventional microcontroller and external DRAM.