01Latency is a different goal from training throughput
Training is about throughput: process millions of samples per hour in big batches, and it's fine if a single step takes a second. Serving a patient is about latency: one prediction, now β typically a budget of ~10β15 ms for the model inside a ~100 ms end-to-end request.
Where inference time goes:
- Python overhead β interpreting each operation, creating objects.
- Memory traffic β moving weights from RAM to the CPU caches; often the real bottleneck.
- Arithmetic β the multiply-adds themselves.
Optimisation attacks each one: compiled runtimes remove Python overhead, smaller number formats cut memory traffic, and SIMD instructions do more arithmetic per cycle.