LLM Inference & Serving
Build LLM serving systems from request arithmetic and phase measurement through KV memory, scheduling, kernels, compression, distributed serving and production operation. Every optimization is bounded by a fixed workload, correctness and quality contract, and the final gate requires a tested real-engine contribution with an honest negative result.
9 sections · 108 units · about 449 hours
- Model identity and the architecture fields that set serving cost4h
- Weight memory by dtype and the runtime memory categories4h
- KV bytes per token across MHA, GQA, MQA and MLA, and allocated capacity4h
- Prefill and decode operation counts per request3h
- Length, reuse and media-token distributions of a workload4h
- Arrival processes, concurrency, bursts and open versus closed load4h
- The request contract and its latency metrics4h
- Throughput, goodput, rejection, quality acceptance and energy per token3h
- One request through the engine, from API to detokenizer4h
- Streaming, cancellation, failure and cleanup states and ownership invariants4h
- Offered and completed token rates and first-order capacity3h
- An immutable workload manifest and deterministic request replay4h
- A validated open- and closed-loop load generator with raw records5h
- Prompt tokenization and preprocessing as request work3h
- Prefill parallelism, the decode dependency and decode shapes4h
- Compute, bandwidth, launch, capacity and queue-bound regimes5h
- Batch size, sequence shape, chunked prefill and phase interference4h
- Decomposing TTFT and decode steps into their components4h
- Device synchronization, warmup, compilation and cold versus warm state4h
- Identical output contracts, seeded sampling and distributional comparison4h
- Single-request baselines, concurrency and rate sweeps, and a shape matrix5h
- Raw timestamps, decode gaps, and memory, utilization and power context3h
- Repeated trials, uncertainty and observer overhead3h
- Profiler ranges across the lifecycle and queueing versus execution stalls4h
- Predictions before profiles, residuals and goodput under latency targets4h
- Per-layer KV layouts and the cache consequences of attention variants4h
- Logical tokens, paged storage, block size and block tables4h
- Fragmentation, page waste, capacity and KV compression4h
- Free lists, reserve policies, block tables and append4h
- Reference counts, copy-on-write, fork, beam and shared prefixes4h
- Eviction, recomputation, preemption and terminal cleanup4h
- Prefix hashing with collision checks and radix longest-prefix lookup6h
- Exact prefix identity, version scope and tenant privacy scope4h
- Cache-aware routing, KV offload and connector metadata3h
- Allocator and prefix-index state machines under randomized property tests5h
- Prefix reuse, memory pressure and fairness measured against outcomes5h
- Static, dynamic and continuous batching and iteration-level scheduling4h
- Waiting, running and preempted sets, token budgets and runner limits4h
- Memory admission, KV reserve and preemption by recompute or swap4h
- Mixing prefill and decode, and chunked prefill to protect decode4h
- Priorities, deadlines, fairness, starvation and head-of-line blocking4h
- Cancellation, disconnects, overload, rejection and SLO-aware goodput4h
- Scheduler state, resource, progress and bounded-wait invariants4h
- A continuous-batching simulator with deterministic replay and event traces6h
- Long-prefill, decode-heavy, mixed, bursty, priority and cancellation workloads4h
- Offered-load sweeps through saturation, queue growth and recovery4h
- Policy ablation, a negative regime and a bounded real-engine change5h
- Adapter and prefix affinity, grammar cost and multimodal co-scheduling3h
- Stable and online softmax, normalization and fused residual paths3h
- Prefill and decode attention shapes and IO-aware attention4h
- Paged and variable-length decode attention, GQA grouping and KV addressing4h
- KV append, gather and layout, and RoPE positions and offsets4h
- Sampling and token-selection kernels and guided-decoding integration4h
- Memory layout, strides and alignment, and fusion against intermediate traffic3h
- Launch and host overhead, streams, events and asynchronous execution4h
- CUDA graph capture and replay, static shapes, buckets, padding and fallback5h
- Compilation, graph breaks and recompilation in a serving path3h
- Kernel contracts, an independent oracle and randomized differential tests5h
- Device timing, FLOP, byte and launch accounting, and profiler classification4h
- Engine dispatch and fallback, kernel-to-endpoint translation and negative results5h
- Inference number formats and what gets quantized4h
- Symmetric and asymmetric quantization, scales, zero points and granularity4h
- Calibration, observers, outliers and activation smoothing4h
- Packing overhead, accumulator precision and fused dequantization kernels4h
- Post-training and quantization-aware methods, and quality checks by slice4h
- Measuring quantized memory, latency and throughput, including KV quantization3h
- Draft and target roles, exact acceptance and the correction distribution5h
- Cache advance, rollback, stop handling and tokenizer compatibility4h
- Draft cost, verification cost, accepted tokens and the speedup crossover4h
- N-gram, tree and learned drafters, multi-token heads and structured outputs3h
- A deterministic distribution simulator and distributional equivalence tests4h
- Engine integration, versioned fallback, and benefit and loss regions5h
- Replica serving and tensor-parallel inference shapes and collectives4h
- Pipeline bubbles, expert-parallel MoE and context parallelism in serving5h
- Weight and KV sharding and per-rank memory ownership3h
- Communication volume, topology, and small-batch latency against capacity5h
- Replica routing, load balance and cache-locality skew4h
- Prefill-decode disaggregation and independent phase capacity4h
- KV transfer cost, connectors, overlap, backpressure and offload tiers5h
- Pool placement, heterogeneous GPUs and the disaggregation break-even5h
- Request identity, KV versions, checksums and layout compatibility4h
- Cancellation, timeout, retry and failure across phases and ranks5h
- A topology and capacity simulator, evidence labels and cost comparison6h
- Typed OpenAI-compatible schemas, token streaming and backpressure4h
- Deadlines, cancellation, authentication, quotas, validation and idempotency5h
- Router and load-balancer responsibilities, token- and cache-aware routing4h
- Weight loading, startup phases, warmup, readiness and graceful drain4h
- Compatibility checks, canary and blue-green rollout, and rollback4h
- Autoscaling signals, startup lag, failure reserve and degraded-mode headroom4h
- Overload, admission, load shedding and retry budgets3h
- Multi-tenant model and cache isolation, and prompt and trace privacy4h
- Per-request logs, metrics and traces, and engine and hardware telemetry4h
- Quality, availability, latency and error SLIs, SLOs and error budgets3h
- Worker, dependency, cache and bad-rollout failure injection5h
- Seeded incidents, runbooks, first-cause timelines and recovery load tests5h
- The benchmark question, its decision owner and an immutable manifest4h
- Offered and completed load, goodput and useful work4h
- Cost per token, quality acceptance, retry cost and energy4h
- Fair warmup and arrivals, raw traces and tail percentiles with uncertainty4h
- Capacity headroom under demand growth across three scenarios4h
- Reconstructing the engine API, tokenizer path, scheduler and request state5h
- Reconstructing the block manager, prefix cache, model runner and attention backend5h
- Reconstructing sampling, streaming, cleanup, workers and telemetry4h
- A contribution hypothesis with a predicted boundary and one bounded change6h
- Reference fallback, versioned configuration and the test and protection suite5h
- Strong baselines, three ablations, three workload regions and a negative result6h
- The bottleneck shift and the capacity and cost decision4h
- An independent reproduction package and a technical design defense5h
Final project: LLM Inference Systems Laboratory
Extend one service from a reference-equivalent baseline into an observable, failure-aware serving system, then modify one real engine path and defend its workload boundary. CPU or simulation evidence can establish state correctness, while GPU, multi-device and fleet claims require measurements on that exact hardware.
- A request and engine architecture map, analytical model, immutable workload manifest, validated load generator and raw phase-separated baseline traces.
- One scheduler, KV, routing, instrumentation or kernel contribution with fallback, correctness and fault tests, three ablations, three workload regions and a preserved neutral or negative result.
- A production operations and evaluation package with SLO and quality goodput, capacity and cost, isolation, canary and rollback, runbooks, evidence labels and independent reproduction.
How it's graded · about 20 to 30 hours
Baseline and workload
Pass: Architecture map locates owners, analytical model predicts bounds, manifests bind revisions, generator passes validation, and raw phase-separated traces are retained.
Great: Predictions precede measurement with residuals explained, and tuning stays separate from final traces.
Contribution and boundary
Pass: One scheduler, KV, routing, instrumentation or kernel contribution ships behind versioned fallback, passes correctness and fault suites, and keeps three ablations across three regions with a negative row.
Great: Ablations isolate mechanisms, losing regimes set dispatch bounds, and fallback is drilled.
Operations and evaluation
Pass: SLO and quality goodput, capacity and cost, isolation, canary with rollback, runbooks and evidence labels are shown with independent reproduction.
Great: Recovery is load-tested, budgets burn by tier, and a second operator regenerates decision-critical evidence.
Reproducibility and judgment
Pass: A clean checkout regenerates claims from raw evidence, protections have injected-defect tests, and scoped claims state hardware and simulation limits.
Great: Losing rows stay visible, fleet numbers stay labeled simulated unless measured, and maintenance costs join the decision.