One place to learn everything about running AI models in production: why inference matters and where it is heading, GPUs from the inside, AI hardware, networking, how LLMs generate text, optimization, inference engines and vLLM in depth, distributed serving, platforms and production — from the very basics to the state of the art.
Inference engineering is the discipline of running trained models — above all large language models — as fast, cheap and reliable services. It sits where four fields meet:
Machine learning Computer architecture
(what the model is) (what the GPU and network do)
\ /
\ /
+--------------------+
| INFERENCE |
| ENGINEERING |
+--------------------+
/ \
/ \
Distributed systems Production operations
(many machines) (SLOs, cost, reliability)Most people learn one corner and stall. A researcher can explain attention but not why their server falls over at 40 concurrent users. A backend engineer can build a solid API but not explain why a 7B model at batch size 1 leaves almost all of the GPU idle. This material builds all four corners, in the order in which they depend on each other, and teaches each idea once.
What you will be able to do#
- Explain where the industry is, where it is heading, and why — from the economics of tokens to the hardware roadmap.
- Read a model config and predict its memory footprint, KV cache growth and peak throughput before deploying it.
- Read a GPU spec sheet, explain what is inside the chip, and tell whether a kernel is limited by bandwidth or compute.
- Choose hardware — NVIDIA, AMD, TPU, Trainium, SRAM machines — for a workload and justify it.
- Explain the networks that join GPUs (PCIe, NVLink, InfiniBand, Ethernet) and do the arithmetic of moving tensors and KV caches over them.
- Explain and implement continuous batching, paged attention, prefix caching, speculative decoding, quantization and the parallelism strategies.
- Run, tune and read the source of inference engines, vLLM above all.
- Design a multi-tenant inference platform with KV-aware routing, disaggregation, autoscaling, quotas and cost attribution.
- Read a new paper or announcement and judge whether it matters for production.
Who this is for#
| You are | This material will |
|---|---|
| New to AI infrastructure | Take you from “what is inference” to production systems, one step at a time |
| A backend, platform or DevOps engineer | Add the ML, GPU and networking foundations, in systems vocabulary you already have |
| An ML engineer who trains models | Add the systems, hardware and production layers training rarely teaches |
| An SRE inheriting a GPU fleet | Give you the mental models to reason about capacity, cost and failure |
| Preparing for inference or ML-infra interviews | Give you a complete path with exercises and interview questions in every lesson |
Assumed: you can program in at least one language, use a terminal and know what an HTTP request is. Not assumed: any ML, linear algebra beyond school, GPU knowledge or distributed systems.
The modules#
flowchart TB
subgraph W["Why"]
direction LR
M1["1 · The Big Picture"] --> M2["2 · The Physics of Inference"]
end
subgraph MA["The machine"]
direction LR
M3["3 · Computer Foundations"] --> M4["4 · GPU Architecture"] --> M5["5 · GPU Programming"] --> M6["6 · GPU Performance"]
M6 --> M7["7 · AI Hardware"] --> M8["8 · Choosing Hardware"] --> M9["9 · Networking"]
end
subgraph MO["The model"]
direction LR
M10["10 · ML Foundations"] --> M11["11 · Models as Computation"] --> M12["12 · LLM Inference"] --> M13["13 · Optimization"]
end
subgraph EN["Many GPUs and the engine"]
direction LR
M19["14 · Distributed Inference"] --> M14["15 · Inference Engines"] --> M15["16–19 · vLLM in depth"]
end
subgraph SC["At scale"]
direction LR
M20["20 · Serving Systems"] --> M21["21 · Inference Platforms"]
M21 --> M22["22 · Performance Engineering"] --> M23["23 · Production Inference"] --> M24["24 · Research and Frontier"]
end
subgraph PL["Principal level"]
direction LR
M25["25 · Advanced Kernels"] --> M26["26 · Beyond Text"] --> M27["27 · Reasoning, Agents, RL"] --> M28["28 · Correctness and Quality"]
M28 --> M29["29 · On-Device and Edge"] --> M30["30 · Landmark Papers"] --> M31["31 · The Principal Engineer"]
end
W --> MA --> MO --> EN --> SC --> PL
class M1,M2 neutral
class M3,M4,M5,M6,M7,M8,M9 memory
class M10,M11,M12,M13 compute
class M19,M14,M15 io
class M20,M21,M22,M23,M24 queue
class M25,M26,M27,M28,M29,M30,M31 neutral| # | Module | What it covers |
|---|---|---|
| 1 | The Big Picture | What inference is, why it is hard and expensive, the state of the industry, where it is heading, the job |
| 2 | The Physics of Inference | Parameters and activations, latency and throughput, batching, compute vs memory, arithmetic intensity, why GPUs |
| 3 | Computer Foundations | CPUs, caches, NUMA, SIMD, threads, virtual memory, model loading, Linux, containers, profiling |
| 4 | GPU Architecture | SMs, warps, the memory hierarchy, HBM, tensor cores, power and the host link, reading a spec sheet |
| 5 | GPU Programming | The software stack, CUDA kernels, launches and memory copies, streams, CUDA graphs |
| 6 | GPU Performance | Roofline, coalescing, occupancy, profiling, Triton kernels |
| 7 | AI Hardware | Hopper, Blackwell, NVL72, Rubin, edge parts, AMD, TPU, Trainium, Groq, Cerebras, racks and power |
| 8 | Choosing Hardware | Hardware for each stage of the AI lifecycle, levels of scale, the memory map, choosing |
| 9 | Networking | Networking basics, PCIe, NVLink, InfiniBand and Ethernet, the AI data center network, moving KV caches, NCCL, communication cost, multi-node |
| 10 | ML Foundations | Matrices, neural networks, embeddings, softmax, attention, the transformer, number formats, quantization basics |
| 11 | Models as Computation | Forward pass trace, operators and graphs, GEMM vs GEMV, layouts, fusion, shapes, precision |
| 12 | LLM Inference | Tokenization, prefill and decode, KV cache, GQA and MLA, batching, chunked prefill, PagedAttention, prefix caching, speculation, sampling, capacity maths |
| 13 | Optimization | Quantization (INT8, FP8, INT4, FP4), KV cache optimization, fusion, CUDA graphs, FlashAttention, compilers, speculative decoding, distillation |
| 14 | Distributed Inference | Data, tensor, pipeline, expert and context parallelism, MoE, long context, disaggregation, KV offload |
| 15 | Inference Engines | What an engine is, SGLang, TensorRT-LLM, Triton and ONNX Runtime, local and edge engines, choosing |
| 16 | vLLM: Foundations and the Request Path | What vLLM is, a first server, the code map, one request end to end |
| 17 | vLLM: Scheduler and KV Cache | One scheduling step, token budget, preemption, async scheduling, the block pool, prefix caching |
| 18 | vLLM: Model Execution and Features | Executor and model runner, batch building, attention backends, compilation, sampling, speculation, LoRA, multimodal, tools, quantization |
| 19 | vLLM: Scaling, Operating and Extending | Parallelism, disaggregation and KV connectors, metrics, tuning, Kubernetes, plugins, new models |
| 20 | Serving Systems | APIs, queues and admission, batching in servers, backpressure, load balancing, autoscaling, lifecycle, canaries, priorities |
| 21 | Inference Platforms | Control and data plane, registry, Kubernetes for GPUs, GPU sharing, multi-tenancy, routing, gateways, Dynamo and llm-d |
| 22 | Performance Engineering | Method, roofline in practice, utilisation myths, allocators, OOM, benchmarking, Nsight, dashboards, case studies |
| 23 | Production Inference | SLOs, capacity, cost per token, autoscaling, fault tolerance, DR, rollouts, observability, security, abuse |
| 24 | Research and Frontier | Reading papers, research directions, memory-centric hardware, the frontier in 2026 |
| 25 | Advanced Kernel Engineering | TMA, mbarriers, WGMMA and tcgen05, warp specialization, CUTLASS and CuTe, the new kernel languages, GEMM, attention, low-precision, MoE and communication kernels, megakernels, AMD and TPU, testing and autotuning |
| 26 | Beyond Text | Vision-language serving, image and video diffusion, streaming speech recognition, TTS and real-time voice, embeddings and rerankers, omni models |
| 27 | Reasoning, Agents and RL Workloads | Reasoning-token economics, agent sessions and KV reuse, tool calls at scale, RL rollouts and weight sync, batch and async jobs |
| 28 | Correctness, Determinism and Quality | What correct means, kernel numerics, batch invariance, evaluating serving changes, logprob and KL regression tests, quality incidents |
| 29 | On-Device and Edge Inference | Device budgets, llama.cpp and GGUF, Apple silicon and MLX, mobile runtimes, NPUs, edge quantization, hybrid device and cloud |
| 30 | Landmark Papers, Explained | 25 papers from Roofline to sparse attention: the problem, the idea, the results, what held up, where each lives in 2026 |
| 31 | The Principal Inference Engineer | The role, design reviews, build or buy, hardware and cost strategy, fleet programmes, three worked designs, the interview |
Plus Projects: fifteen builds from a from-scratch inference engine to a mini inference platform, and five GPU labs.
How to read it#
Read Module 1 → 2 → 3 → … → 24, then the principal-level Modules 25–31, and inside each module its lessons in order (1.a, 1.b, …). Every lesson assumes only what came before it. Each idea is taught once, where you first need it; later lessons link back instead of repeating it.
Shortcuts#
| If you | Then |
|---|---|
| Need to be useful in three weeks | Modules 1, 2, 12 and 15, then 16 and 20. Come back for the rest. |
| Already know operating systems and Linux | Skim Module 3; read 3.g (model loading) |
| Already know CUDA | Skim Module 5; read 5.f (CUDA graphs) and Module 6 |
| Already know transformers and PyTorch | Skim Modules 10–11; read 10.k, 10.l and 11.c |
| Mostly care about hardware | Modules 2, 4, 7, 8, 9 |
| Already run vLLM in production | Modules 16–19, then 14 and 21 |
| Already senior, aiming for principal | Skim 1–24 by their lesson lists, then Modules 25–31; Module 30 works as a reading list |
Do not skip Modules 2 and 12. Everything else depends on them.
Lesson format#
Most lessons follow one shape: what it is, why it exists, an analogy, a tiny example, the technical explanation, what happens under the hood, performance and production implications, common mistakes, a hands-on exercise, interview questions and further reading. Hardware and vLLM lessons use a shorter format with a “Remember this” summary and a “Check yourself” quiz. Module 30 uses a per-paper format: the paper, the problem, the idea, how it works, results, what held up, where it lives in 2026, questions.
About the code#
Examples are there when running something teaches more than reading about it. They are written in
whichever language fits the lesson: Go for the systems around the model (schedulers, caches,
routers, calculators — single files that run with go run and only the standard library),
CUDA, Triton and Python where the lesson is about those APIs, and shell and YAML for real
engines and deployments. You do not need to write Go to follow the material; read the examples as
precise pseudocode if you prefer.
Hardware you need#
A laptop for Modules 1–3 and 10–12. A single NVIDIA GPU — a free Colab T4, a rented L4 or A10G, or a consumer RTX card — for most exercises after that. Multi-GPU lessons say when they need more and give a single-GPU or simulated fallback.
Three kinds of knowledge#
Lessons label what they teach:
- [FUNDAMENTAL] — physics and maths: memory bandwidth, arithmetic intensity, Amdahl’s law. True in 1995, true in 2035.
- [ESTABLISHED] — production-proven engineering: continuous batching, PagedAttention, FP8, tensor parallelism.
- [EMERGING] — promising but not yet universal: FP4 KV caches, attention–FFN disaggregation, diffusion LLM serving.
Numbers (bandwidths, prices, versions) drift; the methods for computing them do not. Re-derive with current specs.
Currency#
Product facts carry a “checked on” date in each lesson. The overview lessons — 1.e (the state of inference), 1.f (where it is heading), 15.a (engines), 21.j (Dynamo and llm-d) and 24.j (the frontier) — were checked on 11 November 2026: vLLM v0.32.0, SGLang v0.5.23, TensorRT-LLM 1.2, NVIDIA Dynamo 1.6, llm-d 1.0, Hugging Face TGI archived. Hardware lessons in Modules 7–9 were checked on 16 October 2026; the vLLM lessons read the source at a pinned commit, named in 16.a.
Reference#
- Glossary — every term, defined briefly, with the lesson that explains it
- Resources — papers, documentation, blogs and talks, by topic
Related learning materials#
- Observability — measuring all of this in production: SLOs, GPU and engine telemetry, tracing, cost per token.
- AI System Design — where the model sits in a whole system.
- AI Security — attacking and defending AI applications.
The one idea to carry through everything#
Modern LLM inference is not limited by how fast your GPU can multiply. It is limited by how fast it can move bytes.
Almost every technique in this material — batching, the KV cache, paging, quantization, FlashAttention, speculative decoding, disaggregation, KV-aware routing — is at bottom a way to move fewer bytes, or to do more useful arithmetic per byte moved. Once you see that, the field stops being a list of tricks and becomes one coherent story.
Start with Module 1 — The Big Picture.