M9-027M9: Senior ML & AI System DesignLLM Serving, RAG & Agent SysDesignHard
⚡Flashcard Drill➔Mastery:
Design a Distributed LLM Serving Cluster with Prefill-Decode Disaggregation
🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Physically decouple compute-bound Prefill pools from HBM-bandwidth-bound Decode pools, transferring KV states over RDMA/NVLink to eliminate TTFT/TPOT interference.
📌 Key Takeaways
- •L1 Interference Root Cause: co-located long-context prefills stall co-batched decode steps, spiking TPOT 5-10x
- •L2 Pool Specialization: optimize Prefill nodes for peak Tensor-Core TFLOPS and Decode nodes for high-batch HBM bandwidth
- •L2 Layerwise KV Transfer: overlap layer computation with GPUDirect RDMA/NVLink KV block streaming (Mooncake/NIXL style)
- •L3 Elastic P:D Ratio: auto-scale Prefill-to-Decode node ratios dynamically from live input/output token ratios plus prefix-aware routing
📐 Mathematical Derivations
Per-layer KV payload is ; pipelining layerwise transfer hides network latency whenever .
🏭 Production Trade-offs
1) Route short prompts (<512 tokens) to colocated fallback pools to avoid RDMA handshake overhead; 2) Pre-allocate KV slots on Decode before starting Prefill.
⚠️ Common Interview Pitfalls
- ✕Waiting until full prefill completion before sending KV blocks instead of pipelining layer-by-layer
- ✕Missing decode memory reservation causing incoming KV transfers to trigger preemption thrashing
🎯 Interviewer Follow-up Inquiries
- ?How do you compute the crossover prompt length where PD disaggregation pays off over slower Ethernet?
- ?Where should Radix prefix cache live in multi-turn agent workloads—Prefill, Decode, or tiered DRAM?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚