Pidoku

Inference Engineering

Everything about running AI models in production, in one place — why inference matters and where it is heading, GPUs from the inside, AI hardware, networking, LLM inference, optimization, inference engines and vLLM in depth, distributed serving, platforms and production — then principal-level depth in advanced kernels, multimodal and agent workloads, correctness, the edge and the landmark papers.

Start with Module 1
  • 31 modules
  • 328 lessons
  • ~479h 35m
Part 1

The big picture

What inference is, why it is hard, and the physics that sets its limits.

  1. Module 1 The Big Picture What inference is, why it became its own engineering discipline, what it costs, what the industry looks like today and where it is going. No maths and no hardware yet: this module gives you … 7 lessons · ~5h 30m
  2. Module 2 The Physics of Inference The handful of ideas every later module is built on: what a model is made of, what running it means, the metrics that judge it, why batching is the central trade-off, why memory bandwidth … 8 lessons · ~8h 35m
Part 2

The machine

The computer and the GPU from the inside, and how to program and measure it.

  1. Module 3 Computer Foundations The machine underneath the GPU: CPUs, caches, RAM and NUMA, SIMD, threads, virtual memory, storage and model loading, the OS scheduler, Linux, containers and profiling. Inference servers are … 11 lessons · ~11h 45m
  2. Module 4 GPU Architecture Inside the chip: streaming multiprocessors, warps and SIMT, the memory hierarchy from registers to HBM, tensor cores and their number formats, and the power, heat and host link that bound it … 7 lessons · ~6h 55m
  3. Module 5 GPU Programming How work gets onto a GPU: the software stack from driver to framework, writing a CUDA kernel, calling one from a host program, how launches and memory copies really work, streams and … 6 lessons · ~7h 10m
  4. Module 6 GPU Performance Why one kernel runs at 90% of peak and another at 5%: the roofline model, memory coalescing, occupancy and divergence, profiling with Nsight, and writing fast kernels in Triton without … 5 lessons · ~6h 30m
Part 3

Hardware and networks

Every accelerator that serves models, how to choose one, and the networks between them.

  1. Module 7 AI Hardware Every accelerator that serves models today, drawn and explained: NVIDIA's Hopper, Blackwell and Rubin generations and the NVL72 rack, workstation and edge parts, then AMD Instinct, Google … 12 lessons · ~9h 35m
  2. Module 8 Choosing Hardware From the chips to a decision: what each stage of the AI lifecycle needs from hardware, the seven levels of scale from a laptop to a campus, where AI data lives, the memory map of every tier, … 5 lessons · ~3h 40m
  3. Module 9 Networking The other half of the machine. Networking fundamentals, PCIe and DMA, NVLink and NVSwitch, InfiniBand and RoCE, the AI data center network (scale-up and scale-out, UALink, Ultra Ethernet, … 8 lessons · ~9h 5m
Part 4

Models

The maths, the model as a computation, and what LLM inference actually does.

  1. Module 10 ML Foundations Just enough maths and machine learning to understand what the GPU is computing: vectors and matrices, matmul by hand, tensors and broadcasting, neural networks from scratch, activations, … 12 lessons · ~15h 30m
  2. Module 11 Models as Computation A model seen as an engineer sees it: a graph of operators over tensors. A forward pass traced end to end, GEMM versus GEMV, convolutions, normalisation, the attention computation, tensor … 11 lessons · ~12h 30m
  3. Module 12 LLM Inference How a large language model actually generates text, and every mechanism a serving engine is built from: tokenisation, prefill and decode, the KV cache and its arithmetic, MQA, GQA and MLA, … 17 lessons · ~24h 15m
Part 5

Making it fast

Optimization, distributed inference and the engines that put it together.

  1. Module 13 Optimization Making inference cheaper and faster without changing what the model says: a method for optimising, quantization from INT8 to FP8 to FP4, KV cache optimisation and quantization, kernel … 16 lessons · ~19h 45m
  2. Module 14 Distributed Inference When one GPU is not enough: why to distribute, data, tensor, pipeline, expert and context parallelism, mixture-of-experts models and how they are served, long context, disaggregated prefill … 13 lessons · ~16h 30m
  3. Module 15 Inference Engines The software that runs the model: what an inference engine is and what every one of them contains, the current landscape, SGLang, TensorRT and TensorRT-LLM, Triton Inference Server, ONNX … 6 lessons · ~5h 30m
Part 6

vLLM in depth

One engine read from its source, from the API server to the GPU.

  1. Module 16 vLLM: Foundations and the Request Path vLLM from the inside, read from the source at a pinned commit. What vLLM is and why it won, your first server, the map of the code base, then one request followed through the processes, the … 7 lessons · ~5h 10m
  2. Module 17 vLLM: Scheduler and KV Cache The two parts that decide vLLM's throughput: the scheduler (one step, chunked prefill and the token budget, priorities, preemption and asynchronous scheduling) and the KV cache manager … 9 lessons · ~7h 45m
  3. Module 18 vLLM: Model Execution and Features What happens on the GPU side of vLLM: the executor, worker and model runner, building the batch, attention backends, CUDA graphs and torch.compile, sampling and structured output, then the … 10 lessons · ~7h 40m
  4. Module 19 vLLM: Scaling, Operating and Extending Running vLLM for real: parallelism across GPUs and nodes, disaggregated prefill and decode with KV connectors, the metrics it exports, tuning and benchmarking, deploying on Kubernetes, then … 8 lessons · ~6h 15m
Part 7

Serving and production

Servers, platforms, performance work and running inference for real users.

  1. Module 20 Serving Systems Everything between the user and the engine: the anatomy of a serving system, APIs, queues and admission control, batching in servers, backpressure, timeouts and retries, load balancing, … 11 lessons · ~12h 15m
  2. Module 21 Inference Platforms Many models, many teams, one fleet: control and data planes, the model registry, Kubernetes for GPUs, sharing one GPU, scheduling and placement, multi-tenancy, routing and prefix-aware … 13 lessons · ~14h 50m
  3. Module 22 Performance Engineering Finding where the time and the memory actually go: a method, the roofline in practice, memory- versus compute-bound work, GPU utilisation myths, fragmentation and allocators, out-of-memory … 11 lessons · ~13h 30m
  4. Module 23 Production Inference Running inference as a business: SLOs and latency budgets, capacity planning, cost per token, autoscaling, fault tolerance, multi-region and disaster recovery, model rollouts, observability, … 11 lessons · ~13h 30m
Part 8

The frontier

Where research and systems are heading next.

  1. Module 24 Research and Frontier How to keep up after this material ends: reading papers, the research directions in attention, KV caches, quantization, decoding, mixture of experts, long context, systems and memory-centric … 10 lessons · ~9h 30m
Part 9

Principal level

Advanced kernels, workloads beyond chat, correctness, the edge, the landmark papers and the principal role itself.

  1. Module 25 Advanced Kernel Engineering How state-of-the-art inference kernels are built on Hopper, Blackwell and beyond: the asynchronous machinery of a modern kernel (TMA, mbarriers, WGMMA, tcgen05 and tensor memory), warp … 12 lessons · ~16h 55m
  2. Module 26 Beyond Text: Multimodal, Diffusion, Speech, Embeddings The workloads that are not a chatbot writing text: vision-language models and their encoders, image and video generation with diffusion transformers, streaming speech recognition, … 8 lessons · ~8h 40m
  3. Module 27 Reasoning, Agents and RL Workloads The workloads that now dominate inference demand: reasoning models that think for thousands of tokens, agents that call a model dozens of times per task, reinforcement-learning rollouts that … 8 lessons · ~7h 45m
  4. Module 28 Correctness, Determinism and Quality How to know an inference server is computing the right thing: what "correct" means when every optimization changes the arithmetic, how to test kernel numerics, where nondeterminism comes … 6 lessons · ~7h 15m
  5. Module 29 On-Device and Edge Inference Running models on phones, laptops, desk machines and embedded boards, in depth: the limits each device sets, llama.cpp and GGUF from the inside, Apple silicon and MLX, the mobile runtimes … 7 lessons · ~8h 45m
  6. Module 30 Landmark Papers, Explained The papers that built modern inference, one per lesson, in the order they appeared: the problem each one faced, the idea, how it works, the numbers it reported (checked against the paper), … 25 lessons · ~16h 20m
  7. Module 31 The Principal Inference Engineer The job that ties the whole material together: what the principal role owns, design docs and reviews, build vs buy, hardware strategy and procurement, unit economics, running fleet-wide … 12 lessons · ~12h 45m

Build

Reference

About

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 areThis material will
New to AI infrastructureTake you from “what is inference” to production systems, one step at a time
A backend, platform or DevOps engineerAdd the ML, GPU and networking foundations, in systems vocabulary you already have
An ML engineer who trains modelsAdd the systems, hardware and production layers training rarely teaches
An SRE inheriting a GPU fleetGive you the mental models to reason about capacity, cost and failure
Preparing for inference or ML-infra interviewsGive 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
#ModuleWhat it covers
1The Big PictureWhat inference is, why it is hard and expensive, the state of the industry, where it is heading, the job
2The Physics of InferenceParameters and activations, latency and throughput, batching, compute vs memory, arithmetic intensity, why GPUs
3Computer FoundationsCPUs, caches, NUMA, SIMD, threads, virtual memory, model loading, Linux, containers, profiling
4GPU ArchitectureSMs, warps, the memory hierarchy, HBM, tensor cores, power and the host link, reading a spec sheet
5GPU ProgrammingThe software stack, CUDA kernels, launches and memory copies, streams, CUDA graphs
6GPU PerformanceRoofline, coalescing, occupancy, profiling, Triton kernels
7AI HardwareHopper, Blackwell, NVL72, Rubin, edge parts, AMD, TPU, Trainium, Groq, Cerebras, racks and power
8Choosing HardwareHardware for each stage of the AI lifecycle, levels of scale, the memory map, choosing
9NetworkingNetworking basics, PCIe, NVLink, InfiniBand and Ethernet, the AI data center network, moving KV caches, NCCL, communication cost, multi-node
10ML FoundationsMatrices, neural networks, embeddings, softmax, attention, the transformer, number formats, quantization basics
11Models as ComputationForward pass trace, operators and graphs, GEMM vs GEMV, layouts, fusion, shapes, precision
12LLM InferenceTokenization, prefill and decode, KV cache, GQA and MLA, batching, chunked prefill, PagedAttention, prefix caching, speculation, sampling, capacity maths
13OptimizationQuantization (INT8, FP8, INT4, FP4), KV cache optimization, fusion, CUDA graphs, FlashAttention, compilers, speculative decoding, distillation
14Distributed InferenceData, tensor, pipeline, expert and context parallelism, MoE, long context, disaggregation, KV offload
15Inference EnginesWhat an engine is, SGLang, TensorRT-LLM, Triton and ONNX Runtime, local and edge engines, choosing
16vLLM: Foundations and the Request PathWhat vLLM is, a first server, the code map, one request end to end
17vLLM: Scheduler and KV CacheOne scheduling step, token budget, preemption, async scheduling, the block pool, prefix caching
18vLLM: Model Execution and FeaturesExecutor and model runner, batch building, attention backends, compilation, sampling, speculation, LoRA, multimodal, tools, quantization
19vLLM: Scaling, Operating and ExtendingParallelism, disaggregation and KV connectors, metrics, tuning, Kubernetes, plugins, new models
20Serving SystemsAPIs, queues and admission, batching in servers, backpressure, load balancing, autoscaling, lifecycle, canaries, priorities
21Inference PlatformsControl and data plane, registry, Kubernetes for GPUs, GPU sharing, multi-tenancy, routing, gateways, Dynamo and llm-d
22Performance EngineeringMethod, roofline in practice, utilisation myths, allocators, OOM, benchmarking, Nsight, dashboards, case studies
23Production InferenceSLOs, capacity, cost per token, autoscaling, fault tolerance, DR, rollouts, observability, security, abuse
24Research and FrontierReading papers, research directions, memory-centric hardware, the frontier in 2026
25Advanced Kernel EngineeringTMA, 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
26Beyond TextVision-language serving, image and video diffusion, streaming speech recognition, TTS and real-time voice, embeddings and rerankers, omni models
27Reasoning, Agents and RL WorkloadsReasoning-token economics, agent sessions and KV reuse, tool calls at scale, RL rollouts and weight sync, batch and async jobs
28Correctness, Determinism and QualityWhat correct means, kernel numerics, batch invariance, evaluating serving changes, logprob and KL regression tests, quality incidents
29On-Device and Edge InferenceDevice budgets, llama.cpp and GGUF, Apple silicon and MLX, mobile runtimes, NPUs, edge quantization, hybrid device and cloud
30Landmark Papers, Explained25 papers from Roofline to sparse attention: the problem, the idea, the results, what held up, where each lives in 2026
31The Principal Inference EngineerThe 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 youThen
Need to be useful in three weeksModules 1, 2, 12 and 15, then 16 and 20. Come back for the rest.
Already know operating systems and LinuxSkim Module 3; read 3.g (model loading)
Already know CUDASkim Module 5; read 5.f (CUDA graphs) and Module 6
Already know transformers and PyTorchSkim Modules 10–11; read 10.k, 10.l and 11.c
Mostly care about hardwareModules 2, 4, 7, 8, 9
Already run vLLM in productionModules 16–19, then 14 and 21
Already senior, aiming for principalSkim 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
  • 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.

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in