All lessons in AI Engineering: From Foundation Models to Evaluated Applications

GPU Serving and Inference Internals

Explain memory bottlenecks, KV caches, speculative decoding, and parallel serving.

300 minutes · Members lesson · preview

What you will learn

  • Estimate model-weight and key-value-cache memory with explicit assumptions.
  • Explain how prefill, decoding, batching, and parallel serving create different bottlenecks.
  • Evaluate speculative decoding and memory optimizations using a fixed task-quality contract.

This optional topic looks below the application API. You will explain why a model that fits in memory may still serve too few requests, why long conversations consume resources after their first response, and why a faster kernel may not improve the user's wait. The prerequisite is the core inference-performance lesson, including latency, throughput, and quality gates.

Budget five hours: 45 minutes for reading, 60 for memory calculations, 90 for examining traces or running a bounded local experiment, 60 for comparing configurations, and 45 for a short report. You can complete the conceptual assessment with the supplied original fixtures. If you do not run a model server, label performance results as calculations or fixture analysis rather than measured hardware behavior.

Choose another lesson