grunz

Tokens per second and memory bandwidth: why bandwidth sets your speed

A local model's writing speed is capped by memory bandwidth: tokens per second can be no higher than bandwidth divided by the size of the weights read for each token. A 3.8 GB model on a 256 GB/s machine tops out near 67 tokens per second, and real runs reach about 55 to 85 percent of that ceiling.

Why bandwidth, not compute

A model writes one token (a word or part of one) at a time. For each token, the processor has to read every active weight of the model from memory once. The arithmetic on those weights is quick. Moving them is slow. So for one person chatting, the chip spends most of its time waiting for memory, and the speed of that memory sets the pace.

Reading your prompt is different. The model can process all of the prompt's tokens in one pass, so that phase is limited by compute instead. That is why benchmarks show two numbers: in the llama.cpp results below, an M5 Max reads a prompt at about 3,200 tokens per second and writes at about 120.

The formula

Maximum tokens per second ≈ memory bandwidth (GB/s) ÷ weights read per token (GB)

For a regular, dense model, the weights read per token are the whole file. A 7B model in Q4_0 is 3.8 GB. On a machine with 256 GB/s, that is 256 ÷ 3.8, or about 67 tokens per second at best. Real software never reaches the ceiling, because of the KV cache, kernel overhead and the time between reads, but it is a reliable guide to the order of magnitude.

Two things follow. A smaller file is faster, which is one reason to quantize. And doubling the bandwidth roughly doubles the speed, while doubling compute does little for writing.

Measured on real hardware

The llama.cpp project keeps public scoreboards that run the same model, Llama 2 7B in Q4_0 (3.56 GiB, or 3.8 GB), on many chips: one for Apple Silicon and one for the Vulkan backend on AMD and NVIDIA. Bandwidths are from Apple, AMD and StorageReview's RTX 5090 review.

ChipBandwidthCeilingMeasuredShare
Ryzen AI Max+ 395256 GB/s67 t/s52 t/s77%
Apple M5 Pro, 20-core GPU307 GB/s80 t/s66 t/s83%
Apple M5 Max, 40-core GPU614 GB/s161 t/s120 t/s75%
NVIDIA RTX 40901,010 GB/s264 t/s188 t/s71%
Apple M5 Ultra, 80-core GPUabout 1,230 GB/s321 t/s179 t/s56%
NVIDIA RTX 50901,790 GB/s468 t/s264 t/s56%

Measured: llama-bench text generation (tg128), Llama 2 7B Q4_0, as posted to the scoreboards. Ryzen and NVIDIA rows use the Vulkan backend without flash attention; Apple rows use Metal. Apple lists the M5 Ultra at 1.2 TB/s; the scoreboard uses 1,228 GB/s. Ceiling = bandwidth ÷ 3.82 GB.

The order of the measured column follows the bandwidth column almost exactly. The fastest chips land furthest below their ceiling on this small model, because fixed overheads per token start to matter when each token takes only a few milliseconds.

What it means for big models

Apply the formula to a dense 70B model at Q4_K_M, a 42.5 GB file:

256 GB/sAt most about 6 tokens per second. Ryzen AI Max+ 395.
614 GB/sAt most about 14. M5 Max.
1,230 GB/sAt most about 29. M5 Ultra.
1,790 GB/sWould be about 42, but a 32 GB RTX 5090 cannot hold the file, so part of it runs from much slower system memory.

Fitting a model and running it fast are separate questions. Memory capacity decides what fits (see how much memory you need). Bandwidth decides how fast it writes once it fits.

How mixture-of-experts changes it

A mixture-of-experts (MoE) model splits most of its weights into many "experts" and uses only a few of them for each token. The whole model still has to sit in memory, but only the active part is read per token. So the formula uses active weights, not total weights.

OpenAI's gpt-oss-120b has 117B parameters, of which 5.1B are active per token. Its file is about 63 GB. In the llama.cpp gpt-oss guide, an M3 Ultra with about 800 GB/s writes with it at 80 tokens per second. A dense model of the same 63 GB could not go faster than about 13 on that machine.

The same guide shows gpt-oss-20b (21B total, 3.6B active, a 12 GB file) at about 282 tokens per second on an RTX 5090, well above the 148 a dense 12 GB model could reach on that card.

Two cautions. MoE saves bandwidth, not capacity: you still need memory for all the experts. And MoE models land further below their own ceiling than dense ones, because routing and many small reads add overhead. They are still several times faster than a dense model of the same size, which is why most new large open models use the design.

Other things that slow writing down

  • Long context. The KV cache, the model's memory of the conversation, is read for every token too, so speed falls as a conversation grows.
  • Spilling out of fast memory. If part of a model lives in slower memory, such as system RAM behind a graphics card, the slow part sets the pace.
  • Higher precision. Q8_0 reads about 1.7 times as many bytes as Q4_K_M, so it writes correspondingly slower.

To run the formula for a specific model and machine, with the context included, use the will it run calculator.

On Grunz Box

Grunz Box is designed around the Ryzen AI Max+ 395 with LPDDR5X-8000 on a 256-bit bus, about 256 GB/s shared by the processor and graphics. By the formula, that suits mixture-of-experts models best: they fit in 64 GB or 128 GB and write quickly, while dense 70B models fit but are slow. We will publish measured speeds for the preloaded models before orders open. See the specs.

Reserve from $20