CURRICULUMMIXTURE OF EXPERTS, FROM ZERO02

Why decode is bandwidth-bound

Generating one token reads every active weight once and does almost nothing with it. That makes memory bandwidth, not arithmetic, the ceiling on single-stream speed — and the ceiling is a number you can calculate before you run anything.

Reading time
5 min
Words
1,027
Sources cited
8
Updated
2026-11-02
Prerequisites
What a mixture-of-experts model is

Prefill and decode are different workloads

A chat request has two phases. Prefill reads the whole prompt in one forward pass, with every prompt token processed together. Decode then produces the reply one token at a time: each new token needs a full forward pass of its own, and the pass cannot start until the previous token exists. Prefill is a batch of tokens; decode, for a single user, is a batch of one.

Pope and colleagues at Google laid out the accounting in their 2022 study of transformer inference. The weights have to be transferred from accelerator memory to the compute units once per forward pass, which they call the memory time; the matrix multiplications take a compute time; and, in their words, at small batch sizes and sequence lengths the time to load weights dominates. The same paper gives the rule of thumb for the arithmetic: a decoder with N parameters performs about 2N floating-point operations per token, one multiply and one add per parameter.

For a mixture-of-experts model the N in both statements is the active count, because only the chosen experts are read and multiplied. Everything that follows uses Qwen3-30B-A3B's 3.3B active parameters.

The roofline

Williams, Waterman and Patterson's roofline model, written up at Berkeley in 2008 and published in Communications of the ACM the following year, gives the ceiling its shape. Define the operational intensity of a computation as the operations it performs per byte of memory traffic. Then the attainable performance is the smaller of two roofs: the processor's peak arithmetic rate, and the memory bandwidth multiplied by the operational intensity. Low-intensity work hits the bandwidth roof long before it hits the arithmetic one.

Single-stream decode has very low intensity. Each token reads every active byte and performs about two operations per active parameter. At one byte per parameter that is about two operations per byte; at two bytes per parameter it is about one. Whether the arithmetic roof could bind at that intensity depends on a peak-rate figure Apple does not publish on the specification page this project cites, so no such figure appears here. The ceiling below is the bandwidth roof alone — an upper bound that an arithmetic limit could only lower, never raise — and the model reduces to one division: bytes per second available, over bytes that must be read per token.

The worked example, with every input named

The configuration is the one this project measured: Qwen3-30B-A3B in the mlx-community 8-bit MLX conversion, served by mlx-lm on Apple M3 Ultra hardware with 512GB of unified memory. Four inputs enter the calculation, each sourced.

Inputs and arithmetic (calculated)

  1. Memory bandwidth: 819 GB/s, from Apple's Mac Studio (2025) technical specifications for the M3 Ultra.
  2. Artifact bytes: 32,440,578,048, the metadata.total_size of the pinned 8-bit conversion's safetensors manifest.
  3. Total and active parameters: 30.5B and 3.3B, from the base model card; the conversion preserves the parameter count.
  4. Bytes per parameter: 32,440,578,048 ÷ 30,500,000,000 = 1.0636.
  5. Bytes read per token: 3,300,000,000 × 32,440,578,048 ÷ 30,500,000,000 = 3,509,964,182 (integer division, as the planner does it).
  6. Ceiling: 819 × 10⁹ ÷ 3,509,964,182 = 233.3 tokens per second for a single stream.

What a ceiling is for

The 233.3 is not a prediction. It is the rate above which a measurement would be impossible, if the hardware delivers its advertised bandwidth and nothing else costs time. Any real measurement will be lower. The number is useful for two things: it tells you which configurations are not worth measuring, and it gives a measurement a denominator.

Switching the hardware shows the first use. NVIDIA lists 1,792 GB/s for the GeForce RTX 5090, so the same bytes-per-token figure would give 1,792 × 10⁹ ÷ 3,509,964,182 = 510.5 tokens per second. But the card has 32GB of memory and the artifact is 32.44GB. It does not fit, so the ceiling is for a configuration that cannot exist as stated. The next lesson is about what happens when a mixture of experts does not fit.

What was measured

The committed Passport for this configuration records three trials of twelve requests each, at concurrency 1, with up to 256 output tokens per request, served by mlx-lm 0.32.2. Output token throughput was 54.7, 55.7 and 49.6 tokens per second across the three trials. Those are measured values and carry that class wherever this site shows them.

Against the 233.3 ceiling, the three trials sit at 0.23, 0.24 and 0.21 of the roof. The gap is unprofiled. This project has not measured where the remaining time goes, and the roofline cannot say: it bounds the weight-read term and is silent about everything else — attention over the growing key-value cache, the router, sampling, kernel launches, the framework's own overhead. Any of those could account for some of it. Naming them is a list of places to look, not a claim about which one is responsible.

That is the honest shape of a performance statement for a sparse model on a given machine: a sourced ceiling, a measured figure, and the distance between them left as a question rather than an explanation.

The rule

Single-stream decode reads every active byte once per token. Its ceiling is memory bandwidth divided by bytes read per token, calculated from sourced inputs. A measurement sits below it, and the distance is a fact to report, not a number to fill in.

Every figure in this lesson is sourced or computed. Where a claim would not verify against its source, it was removed rather than qualified.