Disaggregated Serving: Prefill/Decode Ayrımı — Mooncake + DistServe
Modern LLM serving'in en yeni trend'i (2024-2026): prefill (input encoding) ve decode (token generation) farklı GPU'larda. Prefill compute-bound, decode memory-bound — ayrımı %30-50 throughput artırır. Mooncake (Kimi), DistServe (UCB) reçeteleri. RTX 4090 multi-GPU senaryosunda kavramsal.
Şükrü Yusuf KAYA
24 dakikalık okuma
İleri1. Niye Disaggregation?#
LLM inference iki farklı workload:
| Phase | Karakter | Bottleneck |
|---|---|---|
| Prefill | input token'ları için forward, KV cache oluştur | Compute-bound (parallelizable) |
| Decode | tek tek token üret, KV cache'i kullan | Memory-bound (sequential) |
Klasik (co-located): Aynı GPU prefill + decode → bir phase'in bottleneck'i diğerini bekletir.
Disaggregated: Prefill GPU'sunu Prefill için, Decode GPU'sunu Decode için → her ikisi de optimum.
Sonuçlar (DistServe paper):
- Aynı GPU sayısında +%30-50 throughput
- P99 latency %40-60 düşer
RTX 4090 senaryosu: Tek GPU disaggregation yapamazsın. 2× 4090 veya cloud multi-GPU gerekir. Cookbook'taki Lab kavramsal, gerçek deploy multi-node.
2. Mooncake (Kimi/Moonshot) + DistServe (UCB)#
Mooncake (2024):
- Prefill ve Decode için ayrı GPU pool'ları
- KV cache GPU-to-GPU transfer (NVLink/RDMA)
- Centralized cache pool (SSD/RAM) — long context için
- Kimi-1.5'in 2M context'ini destekliyor
DistServe (UCB, 2024):
- Open-source reference impl
- Goodput optimization (SLO-aware scheduling)
- Per-GPU SLA: P95 latency target → routing kararı
Cookbook Lab (multi-GPU senaryo):
# Mooncake server (multi-node) # Node 1: prefill workers mooncake-prefill --model llama-3.1-70b --gpu 0,1,2,3 --kv_transfer rdma # Node 2: decode workers mooncake-decode --model llama-3.1-70b --gpu 0,1,2,3 --kv_source node1-rdma
✅ Teslim
- DistServe paper'ı oku (concept kavramı için). 2) Mooncake repo'sunu incele. 3) Sonraki ders: 15.10 — Edge Inference: ONNX + Jetson + NPU.
Yorumlar & Soru-Cevap
(0)Yorum yazmak için giriş yap.
Yorumlar yükleniyor...
İlgili İçerikler
Part 0 — Engineering Foundations
Fine-Tuning Cookbook'a Hoş Geldin: Sistematik, Stage Taksonomisi ve Reproducibility Kontratı
Öğrenmeye BaşlaPart 0 — Engineering Foundations
Reproducibility Stack: Seeds, cuDNN Flags ve Deterministic CUDA — 'Sende Niye Çalışıyor Bende Çalışmıyor' Sorununu Bitir
Öğrenmeye BaşlaPart 0 — Engineering Foundations