Distributed and Disaggregated Inference
Multiple devices add communication, placement, queue and failure boundaries. A topology is justified only when its added capacity or phase isolation exceeds collective and KV-transfer costs for the declared workload.
Section 7 of 9 · 11 units · about 50 hours
By the end you can Defend single-node, replica, TP, PP, EP or disaggregated choices with a quantitative topology model, preserve request and KV lifecycle through cancellation or failure, and label every result as analytical, simulated, local-process or measured multi-device evidence.
Units
- 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
Build it
Mini project · about 12 to 16 hours
Disaggregated serving with owned handoffs and evidence labels
Extend sim/ with sharded, disaggregated and topology-aware serving plans and prove their handoffs preserve identity under faults. The evidence-labeled comparison ranks colocated against phase-separated serving and feeds gateway and capacity work.
- 1Extend
sim/with replica and tensor-parallel shard plans plus a per-rank ownership ledger, and check sharded forwards against an unsharded reference with own tests. Keep the ledger with replicated-head and over-budget rejection cases. - 2Reproduce the Day 17 pipeline bubble timeline on CPU and extend it with expert skew and position-shard accounting, checking boundaries against the notebook experiment. Keep timelines and a case where skew outweighs byte counts.
- 3Build a per-layer communication ledger with a shared-link contention model, then sweep small-batch latency against memory capacity to surface a feasible plan that loses after startup. Keep the ledger and the losing plan.
- 4Implement deterministic cache-aware routing in
sim/with stated tie-breaks and compare it against load-only and predicted-waiting policies under skew and stale information, passing the TensorTonic routing problem. Keep traces and a hot-prefix loss. - 5Add separate phase queues with a fixed-budget pool sweep and first-token against KV-ready traces, plus serialized and overlapped handoff timelines with bounded credits, slow-receiver backpressure, tier-restore comparison, heterogeneous service and reserve-aware resize. Keep traces and the break-even decision.
- 6Implement a versioned KV envelope with a mapping oracle and checksum plus incompatible-identity rejection, then replay cancellation, rank, transfer and duplicate faults with fencing and bounded retirement through a saturation-tested equal-budget comparison with ablations against hand ledgers. Keep fault traces and a negative regime.
What you hand in
- Shard, ownership and communication ledgers with differential checks and the losing latency plan.
- Routing, phase-pool and handoff evidence in
sim/with traces, break-even decision and fault cases. - Evidence-labeled comparison in
reports/with equal-budget goodput, utilization, traffic and cost plus tests.
How to check it
- Self-grade with the rubric below
- TensorTonic cache-aware routing
Free public cases for locality, tie-breaks and rejection; add own load tests.
- 100 Days Day 17 pipeline bubble
Run the bubble break-even item and check boundaries with own timeline enumeration.
How it's graded
Shard and communication
Pass: Ownership and communication ledgers reconcile, sharded forwards match the unsharded reference, and the losing latency plan is kept.
Great: A second sharding or topology case is checked, and startup versus bandwidth terms are separated.
Routing and disaggregation
Pass: The router passes public cases plus own tie tests, and phase-pool traces show queueing, transfer and reserve costs.
Great: A hot-prefix counterexample explains the loss, and resize keeps only ready workers counted.
Handoff and evidence
Pass: Envelope, fencing and retirement tests pass, and the equal-budget comparison keeps saturation traces and a negative regime.
Great: Hand-ledger replay matches, and goodput, utilization, traffic and cost are labeled by evidence tier.
Resources
- DistServe: Disaggregating Prefill and Decoding for Goodput-Optimized LLM ServingPeking University and Microsoft Research
Read the interference model, independent phase parallelism, placement, KV transfer and goodput evaluation. Reuse the break-even method with your workload and topology; do not transfer the paper's speedups to different hardware.
- AI Systems Performance Engineering - Chapters 15 and 17, distributed and disaggregated inferenceChris Fregly (O'Reilly)
Read the disaggregated prefill and decode architecture and the MoE parallelism strategies in Chapter 15, then Chapter 17 on disaggregated pools, routing policies and scalability. Reproduce every communication and KV-transfer estimate for a small declared topology.
- AI Systems Performance Engineering companion code - Chapters 15 and 17Chris Fregly
Use the single-device KV-handoff and simulation paths before the multi-GPU pairs. Then choose one disaggregation, routing or MoE target compatible with available hardware and keep bundled results separate from newly captured evidence.
- NVIDIA Dynamo - Disaggregated Serving and KV-Aware RoutingNVIDIA
Trace frontend, prefill router, prefill worker, KV transfer, decode routing and decode worker. Record how load, cache overlap, worker discovery and transfer metadata affect placement; implement only a small simulated or available-hardware slice.
- TensorRT-LLM Disaggregated Serving and KV Cache ExchangeNVIDIA
Study the KV exchange abstraction, unique request identity, layout conversion, overlap and fleet-worker model. Use its reproducible benchmark sections only on supported hardware and pin the release.
- Hands-On LLM Serving and Optimization - Chapter 7, multi-GPU and disaggregationChi Wang and Peiheng Hu (O'Reilly)
Read "Multi-GPU and Multi-Node Inferencing" (data, tensor, pipeline and expert parallelism) and "Prefill-Decode Disaggregation" (architecture, KV transfer, when to use it) in Chapter 7.
- SGLang documentation - PD DisaggregationSGLang Project
Use the transfer backends, router integration, heartbeat, timeout and cleanup behavior as a second engine's view of the same handoff.
- Mooncake: A KVCache-Centric Disaggregated Architecture for LLM ServingMoonshot AI
Read the KV-centric architecture, transfer engine and scheduling sections to understand remote cache pools. Compare its assumptions with DistServe and your simpler handoff; defer reproduction requiring a large cluster.
- 100 Days of LLM Inference - Days 12, 17 and 18Elizabeth Thomas
Use the Dynamo, model-parallelism and disaggregation notebooks for a compact topology simulator and request-handoff trace. Label notebook outputs as local analytical or simulated evidence unless real devices were used.
- TensorTonic Language Modeling from Scratch - Route Cache-Aware Prefill RequestsTensorTonic
Solve after the routing unit and compare its cost rule with your own placement model.
- LLM Inference: From scratch, one token at a time - Module 09Tushar Amrit
Work the Distributed Inference module's communication arithmetic before the tensor and pipeline parallel units.
- AI Performance Engineering - Distributed InferenceWafer
A curated index. Use Section 5 only to find a distributed-serving paper the other entries lack.
- Python 3.14 hashlib - byte digests for KV integrity checksPython Software Foundation
Usage and Hash Objects only: compute and compare a SHA-256 digest over a declared canonical KV payload. Add request/version checks separately; a byte digest is not cache compatibility or authentication.