Part VI Trust your results¶
The blue trace is the reference and the teal one is your TPU run. They agree point for point until one stretch bends away, and the orange ring is a check that caught it. The balance and the gauge are the two questions of this Part: do the two sides weigh the same, and is the speed reading inside the range you can defend?
Parts I to V showed you how to run, optimize, scale and serve PyTorch models on TPUs. Every chapter ended with a section called "Verifying the result", and most of those sections held a check: compare a layer with a CPU run at a tolerance, confirm a compile count, compute an MFU by hand, measure a latency percentile. Part VI collects those checks into a method. It asks two questions of any result: are the numbers right, and is the speed real?
Both questions call for judgement. A TPU result almost never matches a reference bit for bit: the MXU multiplies bf16 inputs, XLA fuses and reorders operations, and a compiled program can keep float32 intermediates that eager mode rounds away (chapter 6). A benchmark almost never measures only what it claims: the first steps compile, the host can stall the device, and a mean hides the tail. In both cases you have to decide what difference is expected, state it as a tolerance before you look, and show that the check would have failed on a result that was wrong.
The chapters¶
| Chapter | Summary | Reading time (min) |
|---|---|---|
| 23. Correctness: parity gates and numerical checks | Showing that a TPU model computes what its reference computes, choosing tolerances you can defend, and finding the first layer that goes wrong when it does not. | 40 |
| 24. Performance you can defend: benchmarks, MFU, SLOs | What a benchmark must state to survive review, keeping compilation out of it, reporting MFU and latency percentiles with their conventions, and telling a real speedup, or a published best case, from noise. | 40 |
Read end to end, Part VI takes about an hour and twenty minutes, plus the time to run the checks on your own model.
What links them¶
Both chapters turn a claim into a gate. A gate has three parts: a measurement taken the same way every time, a tolerance stated in advance and derived from something (a dtype, a measured noise floor, a statistical test), and a negative control that proves the gate can fail. Chapter 23 builds gates for numbers: tensors against a reference, loss curves over training steps, greedy tokens and logprobs from a server, and task accuracy. Chapter 24 builds them for speed.
Correctness comes first. A faster run that computes something different is not a speedup; it is a regression with a good step time. Chapter 24 therefore assumes chapter 23's parity gate has passed before any performance number is compared. vLLM-TorchTPU's CI makes the same ordering concrete: one perf lane runs a performance regression check and an accuracy regression check against the same live server.
What each chapter reuses. Chapter 23 reuses chapter 6's precision mechanics and tolerance arithmetic and the parity checks of chapters 9, 12, 14, 15, 18 and 19. Chapter 24 returns to the rooflines of chapter 2, the compile behaviour of chapter 7, the profiles of chapter 10, the MFU arithmetic of chapters 14 and 16, the TTFT and TPOT floors of chapters 17, 18 and 22, and the SLO percentiles of chapter 21. Its companion code reuses their helpers (chapter 2's roofline estimate, chapter 16's mfu, chapter 21's percentiles and SLO verdict) to render a benchmark report in which every field names its source.
Only chapter 6 comes from an earlier Part as a prerequisite, so Part VI can be read straight after Part I. The dashed arrows mark the chapters whose checks it reuses, six for correctness and two for performance; their examples are more familiar if you have read them.
A solid arrow from A to B means chapter B lists chapter A as a prerequisite. A dashed arrow from A to B means chapter B reuses chapter A without listing it as a prerequisite: the six into chapter 23 are the chapters whose parity checks it generalizes, and the two into chapter 24 are its main sources, the MFU arithmetic of chapter 16 and the SLO percentiles of chapter 21. Chapter 24 also draws on chapters 2, 7, 10, 14, 17, 18 and 22, as listed above; those arrows are not drawn, to keep the map readable. You can read Part VI without the chapters at the dashed arrows, but its examples will be more familiar if you have.
What this Part covers¶
- The kind of agreement to expect between a TPU result and its reference (bitwise, elementwise within a dtype tolerance, statistical over steps, or task-level), and a tolerance derived from the dtype, the matmul precision and the operation.
- Finding the first layer that leaves its tolerance by capturing activations on both sides, and telling precision, reduction order and bugs apart.
- CI gates for numerics with a deliberate failing control, and serving parity reports with a tie rule.
- Steady-state benchmarks of a training step or a serving endpoint with compilation excluded by rule, MFU reported with its FLOP convention, and latency percentiles at the SLO's quantile.
- Benchmark reports whose every field names a source, repeated runs that decide whether a speedup is real, and a checklist for published claims.
Part VII moves from judging the stack to extending it: new lowerings, plugins and agent-driven workflows, each of which needs the gates of this Part before it ships.

