DEV Community

gxqwb
gxqwb

Posted on

Compute-in-Memory vs the Von Neumann Bottleneck: Who Pays for Moving Data

Every faster processor has made the same bet more expensive. For half a century, the industry improved computers by shrinking transistors and raising clock rates, assuming that data would be waiting whenever the arithmetic unit asked for it. That assumption was never a law of physics; it was a property of a machine layout, and it has become the largest line item in the energy budget.

The Von Neumann architecture charges for every byte that crosses the gap between storage and logic, and compute-in-memory tries to stop paying that charge by deleting the gap itself.

What the wire actually costs

In the textbook picture, a processor fetches instructions and operands from a shared memory over a bus, computes, and writes the result back. The separation is elegant because one memory can hold both code and data. It is also the source of a tax that tends to zero as transistors shrink: a wire does not get cheaper at the rate a transistor does.

Consider the numbers at a modern node. Reading a bit from off-chip DRAM costs roughly 150 to 250 picojoules, dominated by charging the bitline and driving the off-chip link. Reading from on-chip SRAM costs on the order of 5 picojoules. An 8-bit integer multiply-accumulate, the bread and butter of modern inference, costs perhaps one to ten femtojoules in the logic itself. That is a gap of a hundred to a thousand times between moving an operand and using it. Caches narrow the distance but do not repeal the arithmetic: they trade a small expensive pool for a large cheap one, and a miss still pays the full crossing.

The metric that decides which side wins is arithmetic intensity, the number of operations performed per byte moved. A dense matrix multiplication with large tiles has high intensity and keeps the processor busy between fetches. A graph traversal, a sparse attention mask, or a recommendation lookup has low intensity and spends most of its time waiting. Prefetchers help when access is sequential; they are close to useless when the next address depends on the value just fetched. This is why a machine can be simultaneously fast on benchmarks and disappointing on production workloads that chase pointers.

How a memory array becomes a multiplier

Compute-in-memory attacks the problem by arranging for the memory to do part of the work. The most studied version uses a crossbar of resistive elements, such as ReRAM or phase-change cells. Each cell holds a conductance. Apply a voltage representing an input activation on a row, and Ohm's law turns conductance times voltage into a current; let the currents from many rows meet on a column, and Kirchhoff's law sums them. A matrix-vector product that would need thousands of clocked operations collapses into one analog settling step, with the physical properties of the array doing the arithmetic.

The digital alternative keeps the values discrete. SRAM-based in-memory computing stores weights in bitcells and performs bit-serial multiplication by activating wordlines and accumulating bitlines with sense amplifiers. The density benefit is smaller than with resistive cells, but the result is exact, the process is standard CMOS, and the device is far easier to manufacture at scale. DRAM-based designs sit between the two, offering high capacity but contending with refresh and with the destructive-read nature of the storage cell.

Both versions pay for conversion. Analog arrays need digital-to-analog converters at the inputs and analog-to-digital converters at the outputs, and those converters can consume more energy and area than the array they serve. Resistance drift, cell-to-cell variation, and thermal noise mean two nominally identical chips produce slightly different answers. Systems compensate with differential encoding, periodic recalibration, and error-aware training, each of which spends back some of the saved energy. The honest summary is that in-memory arithmetic is not free; it exchanges a data-movement tax for a precision tax.

A model holding 100 GB of weights is roughly 800 gigabits, and at 200 picojoules per bit that is about 160 joules spent merely moving the weights once, before a single multiply; for a service serving a billion such requests a day, cutting that traffic by 30 percent avoids close to five gigawatt-hours a year.

The kitchen and the garage

The distinction is easy to feel in ordinary life. Imagine cooking a complicated meal with the stove in the kitchen and every ingredient in a garage at the end of the driveway. Following the Von Neumann recipe, you walk to the garage for the salt, walk back, add it, walk out for the pepper, and so on. The walk takes longer than the cooking, and no amount of making the stove hotter helps. You could install a wider driveway, which is the equivalent of a wider bus, but the trip remains.

A chef who does mise en place has discovered compute-in-memory: bring the ingredients to the cutting board, prepare everything in place, and let the work happen where the materials already are. The trade is visible too. Your garage holds far more than your counter can, so not everything fits; the counter is noisy and cramped, so precision suffers. Engineers building these chips face the same compromise between capacity and accuracy, and they solve it with the same trick of staging only what the current task needs.

Why neither design wins outright

Programmability remains the strongest argument for the conventional architecture. A general-purpose processor runs any algorithm, and its software stack assumes operations happen in registers at exact values. In-memory systems need the compiler to place data in specific arrays, to tile matrices to the crossbar size, and to accept approximate results where the application tolerates them. That is a manageable burden for a fixed inference accelerator and an unbearable one for an operating system.

The practical dividing line is arithmetic intensity and tolerance for error. Always-on microcontrollers listening for a wake word, sensors in a field, and tiny recommendation models all have small weights, tight power budgets, and modest accuracy demands, which is exactly the niche where in-memory computing shines. Large language models in a data center are a harder target: the weights are enormous, the accelerator must be reprogrammed for new operators, and accuracy is a product requirement. There, the technique is most likely to appear as a specialized unit beside a conventional engine rather than as a replacement for it.

Compute-in-memory and the Von Neumann architecture are not competing answers to the same question; they are two ways of spending a fixed energy budget, and the right choice follows how often your data must be fetched relative to how often it is used.

The memory wall was never a wall so much as a price. As long as the price of moving data keeps rising, designers will keep looking for ways to bring the arithmetic to the bytes instead of the bytes to the arithmetic.

SOL: HCqPmPJM3NVtS6YrmVaTZYnuP8XZ2PFgQZKT94VK1LkS
Creating this takes real effort — thank you for the support.

Top comments (0)