Llumnix cuts P99 prefill latency by up to 14.8x (reported as 15x overall) and P99 decode latency by up to 2x over load-balanced dispatching (INFaaS++), while saving up to 36% in cluster cost at matching tail latency, by migrating running LLM requests and their KV caches across instances at runtime. Built by Biao Sun, Ziming Huang, Hanyu Zhao, Wencong Xiao, Xinyi Zhang, Yong Li, and Wei Lin (Alibaba Group), the system treats model instances like CPU cores and requests like Unix processes that can be context-switched after admission.
Dispatch-time load balancing breaks down in multi-instance LLM serving because output lengths are unknown when a request arrives. Even at 62% average memory utilization on LLaMA-7B, vLLM still preempts 8% of requests due to sudden sequence growth, stretching P99 per-token decode latency to 3.8x P50 (with 70% of P99 latency coming from a 50-second preemption stall). Conversely, spreading requests evenly fragments free GPU memory across nodes, blocking long new prompts even when total cluster memory has plenty of room.
- 20 to 30 ms constant migration downtime: Exploiting the append-only property of KV caches, live migration takes under one decode step across 256 to 8,192 tokens, up to 111x shorter than recomputing an 8k sequence on LLaMA-30B (3.5 s, or ~54 decode steps).
- 92% less fragmented cluster memory: Runtime defragmentation cuts average wasted fragmented memory on the Medium-Medium trace from 7.9% (
INFaaS++) down to 0.7%, reducing preemption loss by 70.4% on average (and 84% vs. Round-Robin). - 1.5x faster high-priority requests: Dynamic memory headroom speeds up high-priority requests by 1.2x to 1.5x end-to-end (up to 10x P99 prefill) while slowing normal requests by at most 4.5% mean end-to-end (2% decode).
- Scales to 64 instances without stalling: Offloading per-request tracking to local
llumletskeeps scheduling overhead near zero at 500 req/s, where a centralized vLLM scheduler stalls 40 ms per iteration (1.7x slowdown).
How It Works
Borrowing from VM live migration without needing dirty-page tracking, Llumnix exploits the fact that Transformer KV caches are append-only: past tokens’ key and value tensors never mutate during decoding.
When a source llumlet migrates a request, it copies completed KV blocks over a separate CUDA stream while the request keeps generating tokens on the source GPU (Stage 0). Because copying outpaces autoregressive decoding, usually only two stages are needed before the final step drains the request for one iteration (stage-N), copies the last iteration’s newly appended blocks, and commits execution on the destination instance. A PRE-ALLOC / ACK / ABORT / COMMIT handshake handles edge cases cleanly if the request emits EOS or hits memory pressure mid-flight.
To transfer vLLM’s scattered 16-token blocks (4,000 blocks of 128 KB for a 1k-token LLaMA-7B request) without racing against NCCL tensor-parallel collectives, Llumnix fuses blocks into a contiguous CPU buffer and sends them over Gloo. On top, a global scheduler reads only instance-level freeness F = (M - sum(V)) / B (remaining decode steps before memory fills) to dispatch requests and pair overloaded/underloaded nodes, unifying load balancing, defragmentation, priority isolation, and auto-scaling under one load-balancing rule.
Key Findings
On a 16-GPU Alibaba Cloud cluster (four VMs with 4x NVIDIA A10 24 GB over 64 Gbps links), Llumnix improves latency across ShareGPT, BurstGPT, and five synthetic power-law length mixes (S-S, M-M, L-L, S-L, L-S):
- Real conversation traces: On ShareGPT and BurstGPT, Llumnix cuts end-to-end latency up to 2x mean and 2.9x P99 over
INFaaS++, and cuts prefill latency up to 26.6x mean and 34.4x P99 over Round-Robin. - Long-tail mixes: Across synthetic traces, Llumnix improves mean/P99 prefill latency up to 7.7x / 14.8x and end-to-end latency up to 1.5x / 1.6x over
INFaaS++. - Burst and auto-scaling savings: Under varying Poisson rates and Gamma burstiness (
CV2 to 6), migration lets auto-scaling saturate new nodes and drain terminating ones 16% to 18% cheaper at equal aggressiveness, and 36.49% cheaper when matching a ~5s P99 prefill SLO. - Low active overhead: Per-step decode latency changes by at most 1% during migration, and instances spend only ~10% of their time migrating.
Caveats and Builder Takeaway
- PCIe CPU bounce and short-request limits: Implementing transfers via CPU memory and Gloo over 64 Gbps Ethernet avoids NCCL races, yet assumes migration targets longer-lived requests whose relief outweighs transfer bandwidth.
- Scope of testbed: Real-GPU tests ran up to 16 A10s and 8k context on LLaMA-7B/30B; the 64-instance scalability stress test simulated GPU forward passes with offline-measured
sleepdelays. - Manual headroom and single-model pool: Execution priority relies on profiling a static memory headroom (
1,600tokens for LLaMA-7B), and multi-model routing or intra-instance fair scheduling remain separate concerns.
For multi-replica fleets serving unpredictable outputs, mixed priorities, or elastic autoscaling, Llumnix complements phase disaggregation (DistServe) and chunked prefill (Sarathi-Serve) by giving cluster schedulers a low-cost way to fix bad placement decisions mid-flight.


