Topic 2
Same machine, different numbers
Fixing the workload isn't enough. The same measurement, repeated on the same machine on another day, comes out different. This module has the evidence: three scripts timed the same CPU prefill of GPT-2.
Predict first
Loading measurements…
It is tempting to name a cause: lesson 1 ran on battery and lesson 2 on mains. We can't, because the methods also differ:
- Module 01 timed a forward pass alone, without the KV cache and without reading a token back. Its run did not record the power state.
- Lesson 1 timed the first token inside a streamed request, including choosing the token and reading it back, with each repeat also decoding 31 more tokens.
- Lesson 2 timed prefill with the cache and a token read back, after a sweep of decode batches up to 128.
Any of these, or none of them, could explain the gap. Isolating it would need runs that change one thing at a time.
What this means in practice: compare numbers from one run where you can, repeat runs before trusting a gap, and treat a difference smaller than your own run-to-run spread as no difference. That's why lessons 1 and 2 quote ratios.
Quick check