Unit 10 of 13 · about 5 hours · implement
Reference fallback, versioned configuration and the test and protection suite
Build on Protection, clean reproduction and claim-to-artifact links. Serving fallback must also handle live request state, shared KV and terminal races, not just select a different function.
You'll be able to
- Implement a selectable reference fallback with versioned effective configuration and compatible state.
- Protect the contribution with unit, differential, randomized-state, integration and performance-regression checks.
- Diagnose the first correctness or lifecycle divergence under a seeded fault.
Covers
Read
In this order, only the parts listed
0 of 3 done
- The reference, fault and rollback contractLLM Inference Systems Laboratory - Full Capstone
Milestone A: full-prefix/reference equivalence; Milestone C: fallback and compatibility; Milestone D: first-cause timeline and divergence bisection; Correctness requirements; Failure-injection requirements
Choose fault cases touching your contribution plus request cancellation, exhaustion and rollback. Simulate rank/network faults on CPU; do not expand the patch into all capstone mechanisms.
- Configuration ingestion and fallback boundaryNano-vLLM and Mini-SGLang as Engine Reconstruction Bridges
nanovllm/config.py:Configdeclaration and post-initialization validation; comparenanovllm/engine/llm_engine.py: constructor keyword filtering;nanovllm/engine/model_runner.py:run_modeleager/graph branch - In-flight output and cleanup protectionNano-vLLM and Mini-SGLang as Engine Reconstruction Bridges
overlap_loop,_process_last_data,_process_one_msgand_free_req_resources; compare normal execution with the terminal guard and abort branch
Focus on
- Keep the unmodified reference selectable and record the effective configuration, not just requested options. Reject unknown settings in your contribution wrapper rather than silently accepting a misspelling.
- Numerical closeness, greedy token agreement, stochastic distribution agreement and application quality are different contracts. Choose the appropriate independent reference and tolerances before timing.
- Unit tests check the decision; randomized histories check state conservation; integration tests prove real-path behavior; regression tests protect quality, tails, memory and failure recovery.
- A fallback switch must drain, migrate or invalidate incompatible state before reuse. Test cancellation, late output, cache pressure and restart through the same boundary.
Common mistakes · 3
- Calling the contribution itself the oracle. Reusing its accounting logic can reproduce the same ownership bug in both paths.
- Assuming a seed guarantees token-identical stochastic output across batching or backends. Check the declared distribution or quality contract instead.
- Switching code while retaining incompatible KV or graph state. A successful flag change is not a successful rollback.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Is greedy token equality implied by close logits?Answer
No. Near a tie, a small numerical difference can change the argmax. Record numerical tolerance and any token-agreement requirement separately.
2.Why test the tests with seeded defects?Answer
A passing suite may not exercise the protection boundary. A known missing release or duplicate completion proves the relevant check can fail.
3.When may fallback reuse existing cache state?Answer
Only when identity, layout, numerical and ownership contracts remain compatible and in-flight consumers are safe. Otherwise drain, migrate or invalidate it.
You're done when
Off, on and rollback preserve the declared contract, seeded defects fail the protection suite, and fault traces reconcile request and cache ownership.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 12 more in the section
- Nano-vLLM and Mini-SGLang as Engine Reconstruction BridgesGeeeekExplorer and SGLang Project · required
Reconstruct Nano-vLLM first, then compare Mini-SGLang cache, scheduler, overlap and model-runner boundaries. Move to vLLM or SGLang only when you can predict where the same responsibility lives.
- LLM Inference Systems Laboratory - Full CapstoneRoadmap-Final · required
Complete the architecture map, contribution, fallbacks, correctness and fault suite, raw benchmark package, negative result, capacity and cost plan, independent reproduction and design defense. This artifact supplies the track milestone.
Also in this section
- Hands-On LLM Serving and Optimization - Chapters 8 and 9, frameworks and optimization in practiceChi Wang and Peiheng Hu (O'Reilly) · primary
Read Chapter 9 as a worked sequence from traffic generation and baseline through quantized and distributed variants, then the vLLM architecture and scheduler sections of Chapter 8. Replace its model, engine version and hardware with your own fixed contract.
- TensorRT-LLM Benchmarking GuideNVIDIA · required
Use the benchmark workflow, configuration capture, startup metrics and online-serving path as a benchmark-governance reference. Apply the same discipline to your engine and never import NVIDIA results as your own evidence.
- vLLM V1 Architecture OverviewvLLM Project · required
Map API server, EngineCore, scheduler, KV cache manager, model executor and distributed deployment from the current documentation into exact source files. Select the bounded contribution only after identifying its state and fallback boundaries.
- UCSD CSE 291A (Spring 2026) - Guest lecture: Engineering vLLMUC San Diego · support
Read the scribe notes, Sections 3, 6 and 7: the architecture overview, model parallelism and serving topology, and the hybrid KV allocator with offloading. Use it to predict where a change would live before reading code.
- AI Performance Engineering - Inference Engine and Benchmark LanesWafer · reference
A curated index. Use Sections 4 and 5 only to find a mechanism source for the contribution.
- AI Systems Performance Engineering companion code - inference labsChris Fregly (O'Reilly) · required
Use
labs/dynamic_router,labs/cache_aware_disagg_inference,labs/speculative_decodeorlabs/flashinfer_attentionas a pattern for a controlled baseline, optimization and profile. Rerun everything under your own manifest. - Etalon: Holistic Performance Evaluation Framework for LLM Inference SystemsMicrosoft Research · required
Use its per-request SLO and goodput framing to audit the benchmark. Preserve raw outcomes, quality acceptance and load shape so a throughput increase cannot hide missed latency targets.
- Machine Learning Systems, Volume 2 - The Economics and Architecture of InferenceHarvard (Vijay Janapa Reddi) · support
Read the opening sections of Inference at Scale for cost per token, utilization and serving-architecture dimensions, then build your own capacity and cost model from measured numbers.
- MLPerf Inference Datacenter BenchmarkMLCommons · support
Study scenario definitions, audit discipline and reproducibility. Borrow governance ideas appropriate to the capstone; submitting to MLPerf or reproducing its fleet hardware is outside the gate.
- Artificial Analysis - Performance benchmarking methodologyArtificial Analysis · reference
Read how its latency, output speed and price figures are measured. Use its public numbers as an outside comparison for your capacity plan, never as your own evidence.
- SciPy bootstrap confidence intervalsSciPy · support
Read the resampling procedure, paired parameter, Notes on degenerate data and Examples. Apply it to independent trials; do not assume correlated serving requests are independent samples.
- Machine Learning Systems, Volume 2 - Sustainable AIVijay Janapa Reddi · support
For optional energy/carbon accounting, read Energy measurement techniques, System-level energy profiling and Operational carbon calculation. State meter boundaries and apply PUE only to complete IT energy, once.