What You Will Understand
In the setup lesson your first request came back as a stream of tokens, a few tens of them per second. This lesson explains what the server is doing during that stream, why a GPU does it faster than a CPU, and why even a GPU costing tens of thousands of dollars spends most of a single request waiting. You will compute an upper limit on decode speed from two numbers on a spec sheet, and you will know why the measured number is always lower. No command runs in this lesson; the task is a calculation you check against a measurement from the setup lesson.
Bridge: Bytes per Value
Models store numbers in a handful of formats, and the format decides how many bytes every parameter and every cached value occupies (S52):
| Format | Bytes per value | Typical use |
|---|---|---|
| FP32 | 4 | Training; rarely for serving |
| FP16, BF16 | 2 | The usual serving precision for weights and the KV cache |
| FP8 | 1 | Weights and activations on Ada and Hopper GPUs |
| INT8 | 1 | Quantized weights, sometimes activations and the cache |
| INT4 | 0.5 | Quantized weights (the Q4 GGUF files are close to this) |
A model with 7 billion parameters at FP16 is 7 x 2 = 14 GB of weights; at INT4 it is about 3.5 GB plus the quantization's bookkeeping. The practice model's Q4_K_M file is 491 MB for 0.49 billion parameters, about 1 byte per parameter, because K-quants store scales alongside the 4-bit values and some tensors stay at higher precision.
Two Phases of One Request
Generating a reply has two phases (S52):
Prefill processes the whole prompt at once. Every prompt token goes through every layer in one pass, so the work is a set of large matrix-matrix multiplications. That is the kind of work a GPU is built for: thousands of cores busy on independent arithmetic. Prefill is compute-bound, and its cost grows with prompt length. Its result is the first output token and the keys and values of every prompt token, stored in the KV cache.
Decode produces the rest of the reply one token at a time. Each step takes the previous token, runs it through every layer, reads the KV cache of everything before it, and emits one more token. The arithmetic per step is small, a matrix-vector multiplication per layer, but every step has to read every weight of the model from memory, plus the cache. Decode is memory-bandwidth-bound: the time per token is set by how fast bytes move from memory to the compute units, not by how fast the units can multiply.
That is why the stream in your first request arrived token by token at a steady rate, and why the first token took longer than the gap between the others: the first token paid for prefill, the rest paid for a memory read each.
Arithmetic Intensity
Hardware is characterised by two numbers: how many operations per second it can perform (compute, in TFLOPS) and how many bytes per second it can move from memory (bandwidth, in TB/s). A workload is characterised by its arithmetic intensity: operations per byte moved. If the workload's intensity is below the hardware's ratio of compute to bandwidth, the hardware waits on memory and the compute units idle; above it, the reverse. This is the roofline idea.
Decoding one sequence has very low intensity: for every weight byte read, it does about two operations (one multiply and one add), so a GPU whose compute-to-bandwidth ratio is in the hundreds spends almost all of its time on memory. Batching raises the intensity: if eight sequences share a decode step, the weights are read once and used eight times. That is the single reason continuous batching, which you will measure in the serving module, raises total throughput without raising the time per step much.
The Bandwidth Bound
Because decode is bandwidth-bound, a spec sheet gives you an upper limit on tokens per second for one sequence:
time per token >= bytes read per step / memory bandwidth
bytes read per step = weight bytes + KV cache bytes for the context so far
tokens per second <= 1 / time per token
Worked example from the vendor pages read on 2026-10-21 (S52, S53): a 7-billion-parameter model at FP16 has about 14 GB of weights. An H100 SXM has 3.35 TB/s of memory bandwidth. Ignoring the cache,
14 GB / 3.35 TB/s = 0.0042 s = 4.2 ms per token
1 / 0.0042 s = about 240 tokens per second for one sequence

Figure: the same 14 GB read every step, divided by each card's bandwidth. The bars are ceilings, not predictions; measured rates are lower for the reasons listed below.
In 4.2 ms, that GPU could have performed about 4 trillion dense FP16 operations; the decode step needed about 14 billion. The compute units are more than 99 percent idle. Serving one user at a time on an H100 is like driving a truck to deliver one letter; batching fills the truck.
The KV cache adds to the bytes read. The sizing lesson gives the exact per-token size; for the example model at a 4096-token context it adds a fraction of a gigabyte per sequence, which lengthens the step and lowers the bound.
What the Laptop Measurement Shows
In the setup lesson your first reply came with usage counts, and the
serving module measures the same model at about 83 to 100 output tokens
per second on the author's Apple M2 laptop with Metal and about 27 on
its CPU (illustrative, measured 2026-10-21). The same bound applies: a
laptop's memory bandwidth is a small fraction of an H100's and is shared
with everything else running, so its ceiling is lower, and the measured
number sits below the ceiling because the step also includes the cache
read, the attention computation, sampling and the server's own work.
The lesson does not state the laptop's bandwidth as a fact; vendor pages
for data-centre GPUs do state theirs, which is why the calculation uses
those.
Why a Sparsity Figure Overstates
The tensor-throughput figures on NVIDIA's H100 and L4 pages carry a footnote, "with sparsity" (S53, S54), and the L4 page states that the figures are one-half lower without it. Structured sparsity doubles the figure only for models whose weights have been pruned in the supported pattern; a model served as downloaded is dense. So read 1,979 TFLOPS on the H100 SXM as about 990 dense, and 242 on the L4 as 121. The A100 page prints both numbers (312 dense, 624 with sparsity; S55). For decode this matters less than you might think, because decode is bandwidth-bound; it matters for prefill, which is compute-bound.
The Task: Compute Two Bounds
Goal: compute the bandwidth-bound tokens per second for the practice model at Q8_0 on two GPUs, then explain why a measurement sits below it.
Inputs: the Q8_0 file is 675,710,816 bytes, which you treat as the bytes read per step. The L4 has 300 GB/s of memory bandwidth and the H100 SXM 3.35 TB/s (vendor pages, 2026-10-21; S53, S54). Ignore the cache.
Work through it on paper or in a Python prompt:
L4: 0.6757 GB / 300 GB/s = 0.00225 s per token -> about 444 tokens per second
H100: 0.6757 GB / 3350 GB/s = 0.000202 s per token -> about 4,960 tokens per second
Then write one paragraph on why the measured value for one sequence would be lower on either GPU: the cache is read too, attention and sampling take time that is not a weight read, small models do not reach the full bandwidth because each read is short, and the server adds its own overhead per token. The author's laptop measured about 57 tokens per second for this file at concurrency 1, which is below the laptop's own (unstated) bound for the same reasons.
Success: your two numbers match the ones above to two significant figures, and your paragraph names at least three of the four reasons.
Check Your Understanding
- Why does the first token of a reply take longer than the gap between later tokens?
- A colleague proposes ranking GPUs for a chat service by FP16 TFLOPS. What is wrong with that for the decode phase, and which number should rank them instead?
- Eight users share a decode step through batching. Roughly what happens to the bytes read per step and to the useful work per step?
- A spec sheet says 1,979 TFLOPS. What number do you use for a model served as downloaded, and why?
Answers: (1) The first token pays for prefill, which processes the whole prompt through every layer; later tokens each pay for one decode step. (2) Decode is memory-bandwidth-bound, so the compute figure is mostly idle; rank by memory bandwidth, after checking the model fits in memory. (3) Bytes read stay about the same (the weights are read once; the cache read grows by the eight contexts); useful work rises eight times, so the intensity rises and total throughput with it. (4) About 990 TFLOPS: the figure is marked "with sparsity" and halves for dense models.
Next
The spec-sheet lesson puts memory capacity, bandwidth, throughput, power, MIG and interconnect side by side for three GPUs and ranks them for stated workloads.