Module 14 of 15

Inference engineering

  • Production
  • 7 lessons
  • 5 h 5 min

Chapter 14 · The Support Desk

The team will run the model on its own servers, and the queue is already long. Ananya asks one question before anything is started: how fast could this possibly go? You will predict the speed before anyone measures it, and see what each speed-up costs.

What you will be able to do

  • Predict how fast and how cheaply a model can serve before measuring it, using FLOPs, bytes, the roofline and the KV-cache.
  • Choose and sequence the levers (quantization, kernels, batching, scheduling, parallelism, engine) by the bottleneck each attacks and the price each adds.
  • Plan capacity, benchmark honestly and operate an inference service, and defend a serving design in an interview with numbers.

Lessons

  1. Model and kernel optimization

    45 minProduction

    Read first: Memory and the KV-cache

  2. Scheduling and decoding

    45 minProduction

    Read first: Model and kernel optimization

End of chapter 14 · The Support Desk

Latency the cat reached the far door a full minute after the reply did. Ananya wrote it down.