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

0/108
Start hereModel identity and the architecture fields that set serving cost
1Model, Workload and Request Arithmetic0 of 13 passed · project: Request arithmetic and workload harness for servelab
  1. Model identity and the architecture fields that set serving cost4h
  2. Weight memory by dtype and the runtime memory categories4h
  3. KV bytes per token across MHA, GQA, MQA and MLA, and allocated capacity4h
  4. Prefill and decode operation counts per request3h
  5. Length, reuse and media-token distributions of a workload4h
  6. Arrival processes, concurrency, bursts and open versus closed load4h
  7. The request contract and its latency metrics4h
  8. Throughput, goodput, rejection, quality acceptance and energy per token3h
  9. One request through the engine, from API to detokenizer4h
  10. Streaming, cancellation, failure and cleanup states and ownership invariants4h
  11. Offered and completed token rates and first-order capacity3h
  12. An immutable workload manifest and deterministic request replay4h
  13. A validated open- and closed-loop load generator with raw records5h
2Prefill, Decode and Baseline Measurement0 of 12 passed · project: Prefill and decode baseline measurement harness
  1. Prompt tokenization and preprocessing as request work3h
  2. Prefill parallelism, the decode dependency and decode shapes4h
  3. Compute, bandwidth, launch, capacity and queue-bound regimes5h
  4. Batch size, sequence shape, chunked prefill and phase interference4h
  5. Decomposing TTFT and decode steps into their components4h
  6. Device synchronization, warmup, compilation and cold versus warm state4h
  7. Identical output contracts, seeded sampling and distributional comparison4h
  8. Single-request baselines, concurrency and rate sweeps, and a shape matrix5h
  9. Raw timestamps, decode gaps, and memory, utilization and power context3h
  10. Repeated trials, uncertainty and observer overhead3h
  11. Profiler ranges across the lifecycle and queueing versus execution stalls4h
  12. Predictions before profiles, residuals and goodput under latency targets4h
3KV Memory and Prefix Reuse0 of 11 passed · project: Paged KV allocator with prefix reuse
  1. Per-layer KV layouts and the cache consequences of attention variants4h
  2. Logical tokens, paged storage, block size and block tables4h
  3. Fragmentation, page waste, capacity and KV compression4h
  4. Free lists, reserve policies, block tables and append4h
  5. Reference counts, copy-on-write, fork, beam and shared prefixes4h
  6. Eviction, recomputation, preemption and terminal cleanup4h
  7. Prefix hashing with collision checks and radix longest-prefix lookup6h
  8. Exact prefix identity, version scope and tenant privacy scope4h
  9. Cache-aware routing, KV offload and connector metadata3h
  10. Allocator and prefix-index state machines under randomized property tests5h
  11. Prefix reuse, memory pressure and fairness measured against outcomes5h
4Batching, Scheduling and Admission0 of 12 passed · project: Continuous-batching scheduler with collapse and recovery evidence
  1. Static, dynamic and continuous batching and iteration-level scheduling4h
  2. Waiting, running and preempted sets, token budgets and runner limits4h
  3. Memory admission, KV reserve and preemption by recompute or swap4h
  4. Mixing prefill and decode, and chunked prefill to protect decode4h
  5. Priorities, deadlines, fairness, starvation and head-of-line blocking4h
  6. Cancellation, disconnects, overload, rejection and SLO-aware goodput4h
  7. Scheduler state, resource, progress and bounded-wait invariants4h
  8. A continuous-batching simulator with deterministic replay and event traces6h
  9. Long-prefill, decode-heavy, mixed, bursty, priority and cancellation workloads4h
  10. Offered-load sweeps through saturation, queue growth and recovery4h
  11. Policy ablation, a negative regime and a bounded real-engine change5h
  12. Adapter and prefix affinity, grammar cost and multimodal co-scheduling3h
5Inference Kernels and Graph Execution0 of 12 passed · project: Serving kernels with oracles, graphs and endpoint translation
  1. Stable and online softmax, normalization and fused residual paths3h
  2. Prefill and decode attention shapes and IO-aware attention4h
  3. Paged and variable-length decode attention, GQA grouping and KV addressing4h
  4. KV append, gather and layout, and RoPE positions and offsets4h
  5. Sampling and token-selection kernels and guided-decoding integration4h
  6. Memory layout, strides and alignment, and fusion against intermediate traffic3h
  7. Launch and host overhead, streams, events and asynchronous execution4h
  8. CUDA graph capture and replay, static shapes, buckets, padding and fallback5h
  9. Compilation, graph breaks and recompilation in a serving path3h
  10. Kernel contracts, an independent oracle and randomized differential tests5h
  11. Device timing, FLOP, byte and launch accounting, and profiler classification4h
  12. Engine dispatch and fallback, kernel-to-endpoint translation and negative results5h
6Quantization and Speculative Decoding0 of 12 passed · project: Quantized and speculative paths with measured win regions
  1. Inference number formats and what gets quantized4h
  2. Symmetric and asymmetric quantization, scales, zero points and granularity4h
  3. Calibration, observers, outliers and activation smoothing4h
  4. Packing overhead, accumulator precision and fused dequantization kernels4h
  5. Post-training and quantization-aware methods, and quality checks by slice4h
  6. Measuring quantized memory, latency and throughput, including KV quantization3h
  7. Draft and target roles, exact acceptance and the correction distribution5h
  8. Cache advance, rollback, stop handling and tokenizer compatibility4h
  9. Draft cost, verification cost, accepted tokens and the speedup crossover4h
  10. N-gram, tree and learned drafters, multi-token heads and structured outputs3h
  11. A deterministic distribution simulator and distributional equivalence tests4h
  12. Engine integration, versioned fallback, and benefit and loss regions5h
7Distributed and Disaggregated Inference0 of 11 passed · project: Disaggregated serving with owned handoffs and evidence labels
  1. Replica serving and tensor-parallel inference shapes and collectives4h
  2. Pipeline bubbles, expert-parallel MoE and context parallelism in serving5h
  3. Weight and KV sharding and per-rank memory ownership3h
  4. Communication volume, topology, and small-batch latency against capacity5h
  5. Replica routing, load balance and cache-locality skew4h
  6. Prefill-decode disaggregation and independent phase capacity4h
  7. KV transfer cost, connectors, overlap, backpressure and offload tiers5h
  8. Pool placement, heterogeneous GPUs and the disaggregation break-even5h
  9. Request identity, KV versions, checksums and layout compatibility4h
  10. Cancellation, timeout, retry and failure across phases and ranks5h
  11. A topology and capacity simulator, evidence labels and cost comparison6h
8Production Serving and Reliability0 of 12 passed · project: Reliable gateway with quotas, shedding and recovery drills
  1. Typed OpenAI-compatible schemas, token streaming and backpressure4h
  2. Deadlines, cancellation, authentication, quotas, validation and idempotency5h
  3. Router and load-balancer responsibilities, token- and cache-aware routing4h
  4. Weight loading, startup phases, warmup, readiness and graceful drain4h
  5. Compatibility checks, canary and blue-green rollout, and rollback4h
  6. Autoscaling signals, startup lag, failure reserve and degraded-mode headroom4h
  7. Overload, admission, load shedding and retry budgets3h
  8. Multi-tenant model and cache isolation, and prompt and trace privacy4h
  9. Per-request logs, metrics and traces, and engine and hardware telemetry4h
  10. Quality, availability, latency and error SLIs, SLOs and error budgets3h
  11. Worker, dependency, cache and bad-rollout failure injection5h
  12. Seeded incidents, runbooks, first-cause timelines and recovery load tests5h
9Capacity, Economics and Engine Extension0 of 13 passed · project: Measured engine contribution with capacity decision
  1. The benchmark question, its decision owner and an immutable manifest4h
  2. Offered and completed load, goodput and useful work4h
  3. Cost per token, quality acceptance, retry cost and energy4h
  4. Fair warmup and arrivals, raw traces and tail percentiles with uncertainty4h
  5. Capacity headroom under demand growth across three scenarios4h
  6. Reconstructing the engine API, tokenizer path, scheduler and request state5h
  7. Reconstructing the block manager, prefix cache, model runner and attention backend5h
  8. Reconstructing sampling, streaming, cleanup, workers and telemetry4h
  9. A contribution hypothesis with a predicted boundary and one bounded change6h
  10. Reference fallback, versioned configuration and the test and protection suite5h
  11. Strong baselines, three ablations, three workload regions and a negative result6h
  12. The bottleneck shift and the capacity and cost decision4h
  13. 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.