What you'll be able to do
By the end of the core course.
- Separate prefill and decode costs when diagnosing latency
- Estimate KV cache memory for a model, context, and batch size
- Choose batching, paging, and quantisation strategies against a target
- Plan GPU capacity from a traffic profile and a latency budget
Inference Optimisation & AI Infrastructure
In progress · 4 modules live
Read the modules in order. Each card links to the module's first lesson and states the reader question it answers and the work product you produce.
- Module 013 lessons liveMeasure and Explain Inference Performance
Reader question: "Why is my first token or stream slow?"
Work product: Latency and Memory Attribution Report.
Start with: Serving Workloads and Performance Metrics
- Module 024 lessons liveSchedule Requests and Manage KV Memory
Reader question: "How do we keep the GPU saturated without running out of memory?"
Work product: Continuous Batching and Chunk Budget Policy.
Start with: Batching and throughput
- Module 034 lessons liveQuantize Without Losing the Result
Reader question: "Can we cut weight and KV memory without degrading accuracy?"
Work product: Hardware-Calibrated Precision Gate.
Start with: Quantization: Scale, Zero Point, and Granularity
- Module 045 lessons liveBuild a Serving System
Reader question: "How many GPUs do we need and what happens when traffic spikes?"
Work product: Production Capacity and Cost Decision Record.
Start with: Speculative Decoding
Main subjects
The territory this track covers.
- 01FlashAttention
- 02KV cache
- 03Quantisation
- 04Batching
- 05GPU performance
- 06Local and distributed serving
Who this is for
Engineers who run models in production or on their own hardware and need to defend the cost and latency numbers.
Before you start
- Read How LLM inference works, or know the difference between prefill and decode
- Comfort with multiplication and powers of two
- Some experience running a model or using a hosted inference API
Curriculum
16 of 16 lessons published
Core course
16 of 16 liveThe main sequence, read in order.
Module 01
Measure and Explain Inference Performance
How to instrument and explain inference latency and memory before changing any system.
3 of 3 lessons live
- 01Serving Workloads and Performance MetricsDefine TTFT, inter-token latency, throughput, and tail latency, then map each to a reproducible measurement and the instrument that actually answers it.Read
- 02Where Inference Time and Memory GoBreak down inference cost into weights, KV cache, compute, and memory bandwidth, and identify whether prefill or decode is the bottleneck for a stated workload.Read
- 03FlashAttention and GPU Data MovementExplain why reducing HBM reads can matter more than reducing FLOPs, and trace where FlashAttention avoids materialising the full attention matrix.Read
Module 02
Schedule Requests and Manage KV Memory
How schedulers and cache managers keep the GPU busy without running out of memory.
4 of 4 lessons live
- 04Batching and ThroughputAnalyze how batching amortizes weight transfers in LLM decode, derive memory-versus-compute bounds with KV traffic, and evaluate queue and capacity tradeoffs.Read
- 05PagedAttention: Virtual Memory for the KV CacheMap logical KV positions to physical blocks, trace copy-on-write sharing, and calculate capacity and tail waste without assuming memory savings guarantee throughput.Read
- 06Continuous Batching: Iteration-Level SchedulingTrace iteration-level scheduling, request state machines, packed tensor representations, roofline compute-memory dynamics, and KV memory budget limits in LLM serving engines.Read
- 07Prefill Optimisation: Prefix Caching, Chunked Prefill, and DisaggregationPrefix caching reuses KV blocks across queries to skip redundant prefill compute, while chunked prefill bounds per-iteration tokens to protect decode latency. We trace both mechanisms and tradeoffs.Read
Module 03
Quantize Without Losing the Result
How precision choices change memory, speed, and quality, and how to verify them.
4 of 4 lessons live
- 08Quantization: Scale, Zero Point, and GranularityChoose the quantization granularity (per-tensor, per-channel, per-group) and measure the rounding error it introduces on a weight matrix.Read
- 09Calibration Data and Quality RegressionPick representative calibration data, run post-training quantization, and decide whether the quality drop on a held-out set is acceptable before deploying.Read
- 10Low-bit LLM Weights and ActivationsSeparate what is quantized (weights, activations, KV cache) from the numeric format (INT8, FP8, 4-bit), then compare each combination against hardware support and quality tradeoffs.Read
- 11KV-Cache QuantizationMeasure memory saved by quantizing the KV cache, the quality impact on a target task, and the runtime cost of dequantisation.Read
Module 04
Build a Serving System
How to assemble precision, scheduling, and capacity into a defensible serving design.
5 of 5 lessons live
- 12Speculative DecodingExplain draft-and-verify, estimate when it reduces generation latency, and identify the conditions where it does not help.Read
- 13Choose a Serving Runtime and HardwareCompare CPU, single-GPU, and production serving paths using the same workload, and state the constraints that decide between them.Read
- 14Capacity Planning: From Traffic Profile to GPU CountTurn a latency target and a traffic profile into a GPU count you can defend, using memory bounds, queueing theory, and a load-sweep protocol.Read
- 15Scale Beyond One GPU: Replication, Tensor Parallelism, and Prefill/Decode DisaggregationChoose a multi-GPU serving topology—replicas, tensor parallelism, or prefill/decode disaggregation—given a model footprint, traffic target, latency SLOs, and GPU interconnect.Read
- 16Overload and Failure HandlingWhen a burst exceeds serving capacity, decide which requests to admit, reject, cancel, or route to a fallback while protecting latency, useful throughput, quality, and cost.Read
Lessons are published in reading order. A coming-soon entry has no page yet — it is not a broken link.