Memory wall

On this page 7

The memory wall is the widening gap between how fast a processor can compute and how fast memory can deliver data to it, which leaves arithmetic units idle while they wait for operands. In AI hardware, it is the main reason that peak TOPS or FLOPS figures rarely translate into real model throughput, especially for large language model inference.

The term was coined in 1995 by Wulf and McKee, who observed that processor speed was improving far faster than DRAM latency. For modern accelerators the problem is mostly about bandwidth rather than latency: over the past two decades, peak compute has grown several times faster than memory bandwidth, so ever more workloads become memory-bound.

Why the memory wall appears

The memory wall appears because logic and memory scale differently. Transistor density and specialized matrix units have multiplied peak arithmetic throughput, while DRAM bandwidth is limited by pin counts, signaling speed and energy per bit moved off the chip. Moving data also costs far more energy than computing on it: fetching a 32-bit word from off-chip DRAM consumes roughly 100 to 1,000 times more energy than a single multiply-add.

The gap is easiest to see in the ratio of compute to bandwidth on a single chip. The figures below are approximate and vary by product generation and configuration.

EraPeak dense computeMemory bandwidthCompute per byte
Around 2016About 20 TFLOPS (FP16)About 0.7 TB/sAbout 30 FLOPs per byte
Around 2020About 300 TFLOPS (FP16)About 1.5 to 2 TB/sAbout 150 to 200 FLOPs per byte
Around 2023About 1,000 TFLOPS (FP16)About 3.4 TB/sAbout 300 FLOPs per byte
Around 2025About 2,000 TFLOPS (FP16)About 8 TB/sAbout 250 FLOPs per byte
Approximate compute and bandwidth growth in data-center accelerators

The final column is the arithmetic intensity a kernel must reach before compute, rather than memory, becomes the bottleneck. Since that threshold sits in the hundreds of operations per byte, any workload with lower intensity runs far below peak performance.

Reading the memory wall with the roofline model

The roofline model makes the memory wall measurable. It plots attainable performance against arithmetic intensity: below the ridge point, performance equals bandwidth multiplied by intensity, and above it performance is capped by peak compute. A kernel that sits on the sloped part of the roof is memory-bound, and adding more arithmetic units will not speed it up.

Different parts of an AI workload land on very different sides of the ridge point, as the following table shows.

OperationTypical intensityUsual boundReason
Large-batch training GEMMHundreds of FLOPs per byteCompute-boundWeights reused across many tokens
LLM prefillHighMostly compute-boundWhole prompt processed in parallel
LLM decode, batch 1About 1 to 2 FLOPs per byteStrongly memory-boundEvery weight read once per token
Attention with long KV cacheLowMemory-boundCache read grows with context length
Normalization and activationsBelow 1 FLOP per byteMemory-boundElementwise work on large tensors
Typical arithmetic intensity of AI operations

How the memory wall shapes large language model inference

Autoregressive generation is the most visible victim of the memory wall. To produce each new token, the accelerator must stream all model weights and the growing key-value cache from memory, while performing only about two floating-point operations per weight. A 70-billion-parameter model in 16-bit precision holds about 140 GB of weights, so even at 3.35 TB/s a single sequence is limited to roughly two dozen tokens per second by bandwidth alone.

This explains why batching requests, quantizing weights to FP8 or FP4 and sharing the KV cache efficiently produce such large gains in serving cost. Each technique either raises the operations performed per byte or reduces the bytes moved, pushing the workload toward the compute roof.

Hardware and software responses

Chip designers and software engineers attack the memory wall from both sides: bringing memory closer to compute and moving fewer bytes per useful operation. No single technique removes the wall, so production systems combine several of them.

StrategyMechanismTypical effectTrade-off
High-bandwidth memoryStacked DRAM on a silicon interposerSeveral TB/s per packageHigh cost, limited capacity
Large on-chip SRAMKeep weights or activations on the dieVery high bandwidth, low latencyCapacity measured in MB, not GB
Low-precision formatsFP8, FP4 or microscaling formatsFewer bytes per weightPossible accuracy loss
Operator fusionCombine kernels to avoid round tripsLess memory trafficMore complex compilers
In-memory computingCompute inside or beside memory arraysMinimal data movementImmature, precision limits
Batching and speculative decodingMore useful work per weight readHigher throughput per chipHigher latency or complexity
Main strategies against the memory wall

Wafer-scale and dataflow designs, such as chips that keep an entire model in distributed SRAM, take the on-chip route to an extreme. Their weakness is capacity: models larger than the available SRAM must be split across many chips, which turns the memory wall into an interconnect wall.

Common misunderstandings

The memory wall is often oversimplified in marketing and in casual comparisons between accelerators. The points below correct the most frequent errors.

  • Peak TOPS is not delivered performance: memory-bound kernels may use only 10 to 30 percent of it.
  • Bandwidth and capacity are different limits: a chip can have fast memory that is too small for the model.
  • Latency still matters for small, irregular accesses, even when bandwidth dominates large transfers.
  • Faster interconnects do not remove the wall: they relocate it to links between chips.
  • Benchmarks must match the workload: training results say little about single-user decode speed.

In everyday language

Imagine a very fast chef who can chop vegetables in seconds. The food, however, arrives through one narrow door. The chef spends most of the time waiting, not cooking. Hiring a faster chef does not help much.

AI chips face the same problem. They can calculate extremely quickly. But the numbers they need are stored in memory, and memory sends data much more slowly. The memory wall is that waiting time. Engineers fight it by building wider doors, placing storage closer to the chef and making each delivery smaller.

Seen in the real world

An engineering team serving a 70-billion-parameter chat model on eight data-center GPUs finds that each user receives only about 30 tokens per second, even though GPU compute utilization stays below 20 percent. Profiling shows that the decode phase spends almost all of its time reading weights and the KV cache from high-bandwidth memory.

The team quantizes the weights to FP8, enables continuous batching of up to 64 concurrent requests and uses paged storage for the KV cache. Per-user speed stays similar, but aggregate throughput rises by roughly four to six times on the same hardware, and the cost per million generated tokens falls accordingly. The compute units did not get faster; the system simply wasted less time waiting for memory.