Latency Dynamics / Interactive 03

Model on Metal

The model and the chip, seen as two layers. Prompts arrive, get packed into batches, go through every layer during prefill, then come out one token at a time during decode. The highlights show which part of the hardware is doing the work at each moment.

GrowthVectorIllustrative simulation

On smaller screens, scroll the diagrams horizontally. All figures are illustrative; use the assumptions and sources below to interpret them.

Model layer over hardware layer during prefill and decode Isometric view. Top plate: transformer layers with attention and expert grids, an output projection and per-slot KV cache bars. Bottom plate: GPUs with compute dies, memory stacks and interconnect. Tokens arrive at left, are batched, pass through the layers, and stream out at right. PHASE Requests arrive LIMITED BY — PROMPTS ARRIVE · 1 SQUARE = 128 TOKENS TOKENS STREAM OUT Model layer gpt-oss-120b · 117B total, 5.1B active Hardware layer 4× H100 SXM · tensor-parallel 4

Requests arrive

Four prompts land in the queue.

Compute in use
0%
Memory bandwidth in use
0%
Interconnect traffic
0%
Memory capacity used
0%
prompt tokens read 0 tokens written 0 KV cache 0 GB
Illustrative. Compute, bandwidth and interconnect percentages are representative of each phase, not measurements. Model and hardware figures come from the gpt-oss model card and vendor spec pages listed below. The 4× H100 view assumes the model is split across four GPUs (tensor parallelism) to show NVLink at work; a single H100 can also hold this model. Vera Rubin figures are NVIDIA's preliminary specs and may change.
Factor index

Everything that sets the speed

Numbers match the markers in the diagram. Factors that matter in the current phase are highlighted as the animation plays.

Model

1Number of layers PREFILLDECODEEvery token passes through all 36 in order. Split across GPUs, each layer adds a sync over the interconnect.
2Attention heads, GQA PREFILLDECODEMEMORY64 query heads share 8 KV heads, so the KV cache is 8× smaller than with one KV head per query head.
3Experts and top-k routing PREFILLDECODEEach token uses 4 of 128 experts: 5.1B of 117B weights. Decode reads only those. A big prefill batch touches nearly all of them.
4Vocabulary size DECODEThe output projection over about 201k tokens is read for every token generated.
5KV cache per slot DECODEMEMORYGrows with context and is read every decode step. About 36 KB per token for this model.
–Total parameters MEMORY117B decides whether the model fits (about 65 GB), not how fast it runs.
–Weight precision PREFILLDECODEMEMORYMXFP4 experts are about 4.25 bits each. Fewer bytes per token speeds decode; chips without native FP4 spend compute converting.
–Context length PREFILLDECODEMEMORYAttention work in prefill grows faster than linearly. Half of gpt-oss's layers use a 128-token sliding window, which caps their cost.
–Reasoning and output length DECODEEvery hidden reasoning token is one more decode step.

Serving runtime

–Parallel slots DECODEMEMORYMore slots raise total throughput and reserve more KV memory. Each user's speed falls as the batch grows.
–Micro-batch size (num_batch) PREFILLLarger batches reuse each weight read across more tokens. Matters most for MoE models.
–Chunked prefill PREFILLDECODESplits long prompts so other users' decode steps are not stalled behind them.
–Continuous batching DECODEA finished slot is refilled at once instead of waiting for the whole batch to end.
–Prefix cache PREFILLStored KV for an identical prompt prefix lets prefill skip it.
–KV cache precision DECODEMEMORYAn 8-bit KV cache halves its memory and the bytes read per step.
–Attention kernels PREFILLFlash attention avoids writing the full attention matrix to memory.
–Speculative decoding DECODEA small draft model proposes tokens; the big model checks several per weight read.
–Scheduler queue FIRST TOKENWhen every slot is busy, new requests wait.

Hardware

6Compute throughput PREFILLMatrix units and native low-precision formats (FP8, FP4) set prefill speed.
7Memory bandwidth DECODEDecode ceiling ≈ bandwidth ÷ bytes read per token. HBM3 gives 3.35 TB/s per H100, HBM4 19.2 TB/s per Rubin GPU; a compact unified-memory box gives about 256 GB/s.
8Interconnect (NVLink, PCIe) PREFILLDECODESplitting a model across GPUs adds a sync every layer. NVLink keeps it short; PCIe or networking makes it long. One chip avoids it.
9Host CPU FIRST TOKENDECODETokenising, scheduling, sampling and kernel launches run on the CPU. At small batch they show up on every token.
10Weight streaming DECODEThe beams: weights move from memory to compute on every forward pass.
–Memory capacity MEMORYWeights plus KV for all slots must fit, or layers spill to slower memory.
–On-chip cache PREFILLDECODELarge L2 or Infinity Cache keeps frequently used data next to compute.
–Power and thermal limits PREFILLPrefill is the first thing to slow under a lower power limit.
–Unified vs separate memory DECODEMEMORYUnified memory fits large models cheaply, but the CPU shares the same bus.
Back of the envelope

Three equations behind the picture

Prefill · compute-boundtime ≈ 2 × active params × input tokens ÷ effective FLOP/s

gpt-oss-120b needs about 2 × 5.1B ≈ 10 GFLOP per prompt token, plus attention. A supplied reference measurement of 524 tokens/s on a compact AI box works out to about 5.3 TFLOP/s of useful work.

Decode · bandwidth-boundtime per token ≥ (active weight bytes + KV bytes) ÷ memory bandwidth

About 3.5–5 GB is read per token, so 256 GB/s caps a compact box near 50–75 tokens/s; the supplied reference measurement was 33 tokens/s. On 4 GPUs each reads about a quarter of the weights, so per-layer syncs and launch overhead become the limit.

Fit · capacityweights + slots × context × KV per token ≤ memory

65 GB + 4 slots × 32,768 tokens × 36 KB ≈ 65 + 4.8 GB. Fits in 128 GB of unified memory, or in one 80 GB H100.

Sources
OpenAI, gpt-oss-120b & gpt-oss-20b Model Card, arXiv, 2025-08 NVIDIA, H100 Tensor Core GPU specifications NVIDIA, Vera Rubin NVL72 specifications (preliminary), specification assumptions in this visual AMD, Ryzen AI Max+ 395 product page (example compact-box spec) Pope et al., Efficiently Scaling Transformer Inference, arXiv, 2022-11-09 Kwon et al., PagedAttention / vLLM, arXiv, 2023-09-12 Agrawal et al., Sarathi-Serve (chunked prefill), arXiv, 2024-03-04 Leviathan et al., Speculative Decoding, arXiv, 2022-11-30