Back to all projects

Sep 2025 – Dec 2025

AI · SWE

Last edited

Beyond Binary Priorities: Multi-Tier SLA Scheduling for LLM Serving

This project extends Llumnix (Sun et al., OSDI 2024), a dynamic scheduling system from Alibaba Group for LLM inference, with multi-priority SLA support. The goal is to enable fine-grained service-level differentiation across tenants in a shared inference cluster, while preserving low tail latency and high GPU utilization.

We reimplemented the relevant scheduling architecture in Microsoft Research's Vidur simulator and evaluated latency, throughput, and cost efficiency through large-scale simulations.

The result: up to ~3× improvement in P99 latency for high-priority tenants, with diminishing returns beyond four priority tiers.

Affiliation

UC Berkeley

Partners

Report

  • Manuscript

Keywords

  • Priority Scheduling
  • SLO-aware Scheduling
  • KV-Cache Management
  • Live Migration
  • Tail Latency Optimization
  • Discrete-Event Simulation
  • Python
  • Vidur
  • LLM Serving
  • Slurm
  • Weights & Biases

Deepdive

Introduction

Production LLM serving must satisfy heterogeneous service-level objectives across a diverse population of users, from latency-critical interactive API calls to background batch jobs. Llumnix (Sun et al., OSDI 2024) introduced a migration-capable, multi-instance scheduler that unifies load balancing, defragmentation, priority isolation, and auto-scaling under a single freeness metric, but its priority model is binary: every request is either “high” or “normal,” controlled by a single fixed headroom value. This abstraction is too coarse for real deployments, where providers commonly differentiate three to five SLA tiers (platinum, gold, silver, standard, free) with distinct latency targets. This project extends Llumnix to K2K \geq 2 priority tiers, assigning each tier its own isolation budget via exponential headroom decay, and asks a concrete design question: what is the right number of priority tiers for a migration-capable LLM serving system, and how should isolation headroom be allocated across them?

Evaluated across three realistic workload distributions in Microsoft Research’s Vidur simulator, the answer is four. Four tiers deliver the best cost-efficiency tradeoff, with end-to-end P99 speedups up to 3.1×3.1\times and cost-per-latency improvements of 46–68% over an INFaaS+vLLM baseline, all while preserving strong SLO differentiation and sustaining gains all the way to 10 tiers without tail-latency collapse. Beyond five tiers, isolation benefits plateau and overhead from headroom fragmentation begins to dominate.

This was a joint course project at UC Berkeley (EECS), Sep–Dec 2025, with Anders Vestrum and Hanna Rød. We reimplemented the relevant scheduling architecture in Vidur and built INFaaS, vLLM, Orca, and Sarathi-Serve comparison baselines so the multi-tier extension could be evaluated against both global-routing and per-replica schedulers at scale.

Problem Definition

LLM inference has two phases with opposite resource profiles: a compute-bound, bursty prefill that processes all input tokens in parallel, and a memory-bandwidth-bound decode that generates tokens autoregressively. The KV-cache that stores attention state for active requests is the dominant memory consumer, and because output length is unknown a priori, its footprint grows unpredictably throughout a request’s lifetime. Single-instance schedulers (vLLM, Orca, Sarathi-Serve) optimize per-replica throughput but dispatch at the cluster level with one-shot FCFS or round-robin policies: once a request lands on a replica, it stays there, leaving the system structurally unable to react to cross-instance load imbalance or to re-isolate high-priority requests that arrive after an instance is already overloaded. Llumnix removes this constraint with runtime live migration of running requests across instances; this work generalizes the priority abstraction that migration is steered by.

The freeness metric

The central abstraction is the freeness of a replica, the slack between its KV-cache capacity and the virtual usage committed to it:

F  =  MrV(r)B,F \;=\; \frac{M - \sum_r V(r)}{B},

where MM is the replica’s total KV-cache block capacity, rV(r)\sum_r V(r) is the virtual usage summed over all requests rr associated with the replica (including queued ones), and BB is the current batch size. F>0F > 0 signals available capacity; F<0F < 0 means the replica is overloaded relative to its virtual commitments and triggers migration.

The per-request virtual usage encodes physical KV footprint, head-of-line demand, and a priority-dependent headroom term:

V(r)  =  {req.demandr is head-of-line0r queuedphysUsage(r)+H(p,i)r runningr on a draining replicaV(r) \;=\; \begin{cases} \textsf{req.demand} & r \text{ is head-of-line} \\ 0 & r \text{ queued} \\ \textsf{physUsage}(r) + H(p, i) & r \text{ running} \\ \infty & r \text{ on a draining replica} \end{cases}

The headroom function H(p,i)H(p, i) returns the budget reserved for priority tier pp on instance ii. In the original Llumnix this is a single scalar charged only to high-priority requests; generalizing it to KK tiers is the core of this extension.

Replica KV capacity Mphys(r) · 35%HoL · 15%Hp · 20%free · 30%virtual usage Σ V(r)F = ( M − Σ V(r) ) / Bpositive when usage leaves slack; negative once headroom + demand exceed M, triggering migrationrunning KV footprinthead-of-line demandper-tier headroom
Components of virtual usage in the freeness metric. A replica’s KV memory is partitioned into running-request allocations, head-of-line demand, priority headroom, and free space. Freeness FF is positive when virtual usage leaves slack and goes negative when headroom plus demand exceed MM, marking the replica for migration.

Approach

Two-level architecture

The system follows Llumnix’s two-level design, adapted to Vidur. A Llumnix-style global scheduler sits atop NN Llumlet local replica schedulers, one per simulated GPU instance. The global scheduler dispatches incoming requests to the freest non-draining replica, decides when and which requests to migrate, issues auto-scaling recommendations from cluster-wide freeness, and marks replicas for graceful draining. Each Llumlet maintains a priority-ordered request queue, computes per-request virtual usage including priority headroom, manages block-level KV-cache allocation, and executes multi-stage live migration.

priority streamsP0 · criticalP1 · highP(K-1) · backgroundLlumnix Global Schedulerpriority dispatch · migration · auto-scalingLlumlet 1Replica 1Llumlet 2Replica 2Llumlet NReplica Nmigrate
Two-level scheduling architecture. Priority-tagged streams from P0 (critical) to P(K-1) (background) enter the Llumnix global scheduler, which dispatches them to NN Llumlet replica schedulers and receives freeness reports in return. Bidirectional migration links carry live KV-cache transfers between replicas.

Multi-tier priority model

Llumnix defines headroom as a single scalar hh, charged as h/numHighPriorityRequestsh / \text{numHighPriorityRequests} for high-priority requests and zero otherwise, so a loaded replica looks artificially less free and discourages further normal-priority dispatch. We generalize this to KK tiers. Each tier p{0,,K1}p \in \{0, \dots, K-1\} gets a dedicated headroom budget via exponential decay:

Hp  =  Mhmaxeλp,H_p \;=\; M \cdot h_{\max} \cdot e^{-\lambda p},

with hmax=0.20h_{\max} = 0.20 (tier 0 reserves 20% of capacity) and λ\lambda chosen so HK10H_{K-1} \approx 0. Exponential decay mirrors the diminishing isolation requirements of lower tiers while protecting overall efficiency. The total virtual headroom on a replica is

Vheadroom  =  p=0K1Hp1[numRequests(p)>0].V_{\text{headroom}} \;=\; \sum_{p=0}^{K-1} H_p \cdot \mathbb{1}\bigl[\text{numRequests}(p) > 0\bigr].

The full budget HpH_p is charged whenever any request of priority pp is present, not per request, so a single critical request can effectively block normal-priority dispatch to an overloaded replica.

Hp/M20.0%7.4%2.7%1.0%tier 0tier 1tier 2tier 3Hp = M · hmax · e^(−λp), with hmax=0.20, λ=1.0; total 31.1% of M at K=4
Per-tier headroom allocation under exponential decay (K=4K = 4, hmax=0.20h_{\max} = 0.20, λ=1.0\lambda = 1.0). Tier 0 reserves 20% of KV capacity; each subsequent tier decays by eλ37%e^{-\lambda} \approx 37\%. Total headroom across all four tiers is 31.1% of MM.

Priority-aware dispatch and migration

The global scheduler keeps a sorted pending queue and dispatches in strict priority order (tier 0 first), FCFS within a tier, selecting the non-draining replica with the highest freeness (argmaxF\arg\max F). Two freeness values are maintained per replica: full freeness FfullF_{\text{full}} includes priority headroom and drives dispatch and migration targeting, while normal-priority freeness FnormalF_{\text{normal}} excludes headroom and is used only for auto-scaling, so isolation headroom is never mistaken for a genuine capacity shortage and never triggers spurious scale-out.

Migration is evaluated on a time interval (50 ms in most experiments) and a load-imbalance threshold ΔF=max(F)min(F)θ\Delta F = \max(F) - \min(F) \geq \theta (θ=0.3\theta = 0.3). When triggered, the scheduler picks low-freeness sources and high-freeness destinations and migrates one request each, preferring queued requests (no KV state, cheap) and then low-priority running requests with small footprints. Running requests migrate in stages: each stage copies a fixed block chunk from source to destination while the request keeps executing on the source, and only the final handoff incurs a brief re-enqueue latency, while decode tokens are generated throughout.

Inst. AInst. Brequest executing on Afreedcopy 1copy 2commitexecuting on BStage 1Stage 2Stage 3time
Multi-stage live migration of a running request’s KV-cache from Instance A to Instance B. Each stage copies a fixed block chunk while the request continues executing on A; after the final stage the request commits to B. Only a brief re-enqueue latency is incurred at handoff, and decode-phase tokens are generated throughout.

Simulation and baselines

The extended scheduler was implemented as a new policy in Vidur, forking both the Vidur and Llumnix codebases. Vidur’s discrete-event engine models transformer operator latencies from real profiling data, predicting TTFT, TBT, and end-to-end latency without GPU hardware; its configuration search can identify optimal deployments for LLaMA2-70B in roughly 1 CPU-hour versus an estimated 42,000 GPU-hours on real hardware. A PrioritySampler draws request tiers from three distributions: uniform (equal 1/K1/K per tier, a stress test), Gaussian (middle-heavy, centered at K/2\lfloor K/2 \rfloor), and enterprise (≈10% critical at tier 0, ≈70% mid-priority, 5–20% background, modeling a deployment where most traffic is standard). Request lengths follow a right-skewed synthetic mix calibrated to real API traffic (≈65% short 64–128-token turns, tapering to ≈2% very-long 384–512-token code generation). As the primary comparison baseline we implemented an INFaaS-style global scheduler with a cost-based dispatch function combining estimated queue depth, EWMA service time, and state penalties, but unlike Llumnix it performs no live migration and maintains no KV-aware freeness.

Results

Main priority sweeps run on 4 replicas at aggregate QPS = 1,250 (Poisson); the cross-scheduler benchmark uses QPS = 10 to isolate overhead. Experiments swept 120 configurations per distribution on Berkeley Research Computing infrastructure.

Priority differentiation works, and four tiers is the optimum

Under the uniform distribution, K=1K=1 collapses to no differentiation (median end-to-end latency 10–12 s for everyone). At K=3K=3, tier 0 reaches a median TTFT of ≈0.3 s versus over 3 s for tier 2, clear evidence of effective isolation. At K=5K=5, tier 0 stays fast while tier 4 absorbs the longest tail, but the gap between adjacent mid-priority tiers narrows and system P99 rises slightly. The Gaussian distribution leaves tier-0 headroom mostly idle (few critical requests), so it is utilized less efficiently overall, while the enterprise distribution, with consistently busy tier-0 headroom and a large isolated mid-priority band, produces the largest absolute speedups.

Sweeping the scheduler comparison from K=1K=1 to K=10K=10 at moderate load, Llumlet sustains all 10 priority levels without latency collapse and holds aggregate parity with vLLM, Orca, and Sarathi-Serve. Llumlet’s P99 rises modestly to ≈1.61 s at K=7K=7 before recovering (the cost of more active tiers inflating total virtual usage), and this overhead is concentrated in prefill, with decode latency stable or slightly better than baselines throughout. The aggregate trend confirms overhead neutrality; per-tier differentiation is the separate story shown by the controlled sweeps above.

Speedup over INFaaS+vLLM

The table reports speedup of the full system (Llumnix global + Llumlet local) over the INFaaS+vLLM baseline under the uniform distribution at two request scales. The K=4K=4 optimum (in bold) recurs across all three distributions.

ScalePrefill P99Prefill meanE2E P99E2E meanCost/Lat.KK
10K requests4.79×4.79\times8.23×8.23\times2.87×2.87\times2.80×2.80\times65%3
10K requests4.87×\mathbf{4.87\times}8.23×\mathbf{8.23\times}3.13×\mathbf{3.13\times}2.88×\mathbf{2.88\times}68%4
10K requests4.16×4.16\times8.11×8.11\times3.04×3.04\times2.92×2.92\times67%5
15K requests2.98×2.98\times5.00×5.00\times1.87×1.87\times1.97×1.97\times46%3
15K requests3.16×\mathbf{3.16\times}5.16×\mathbf{5.16\times}2.12×\mathbf{2.12\times}2.08×\mathbf{2.08\times}53%4
15K requests2.72×2.72\times5.07×5.07\times2.04×2.04\times2.12×2.12\times51%5
Llumnix (reported)5.5×\leq 5.5\times2.2×\leq 2.2\times2.9×\leq 2.9\times2.0×\leq 2.0\times16–36%2

Three findings stand out. Four tiers is consistently optimal: across all distributions, K=4K=4 achieves peak or near-peak E2E P99, E2E mean, and cost-per-latency, because four tiers separate critical, high, standard, and background traffic without fragmenting queues so finely that load-balancing heuristics lose traction. Prefill mean speedup exceeds the original paper (5.05.08.3×8.3\times vs. Llumnix’s 2.2×\leq 2.2\times): migration-driven load balancing continuously redistributes prefill work and prevents the convoy effect where bursty prefill requests pile onto one instance, whereas INFaaS’s reactive cost model responds more slowly to transient bursts. Cost-per-latency improvements (46–68%) also exceed the reported 16–36%, because consolidating low-priority requests frees KV capacity for high-priority work with fewer preemption penalties. Prefill P99 speedup is the one metric that drops at high load (2.0–3.2×3.2\times at 15K), since near saturation all replicas approach capacity and the freeness differential that drives migration shrinks.

The priority-granularity tradeoff

The results crystallize a general principle: as KK grows, finer granularity enables more precise SLA differentiation, but each tier with any active requests charges its full budget HpH_p to virtual usage, reducing effective batching capacity and raising average latency. The empirical optimum at K=4K=4 is robust across workloads. Benefits are also load-dependent: most pronounced at moderate load where freeness variance is high and migration opportunities abundant, and diminishing near saturation where every replica is equally overloaded. This argues for pairing fine-grained prioritization with proactive auto-scaling that detects saturation before migration loses its leverage.

Future Work

The static exponential-decay schedule is the most natural thing to make adaptive: monitoring the observed latency differential between tiers and adjusting HpH_p upward when SLO violations appear and downward when headroom sits unused. Tier assignment is currently fixed at arrival, so a multilevel-feedback-queue extension could promote long-waiting requests to prevent starvation of low tiers under sustained load. Vidur-Search could replace manual tuning entirely, automatically searching headroom schedules and tier counts for a given workload and SLO target. The cross-scheduler benchmark also ran below saturation (QPS = 10), where headroom rarely binds and pooled percentiles look similar across schedulers; rerunning at higher utilization with per-tier breakdowns would directly demonstrate the intended split of high tiers improving at the expense of low ones. Finally, validating the simulation on a real A100/H100 cluster would quantify the gap between simulated and hardware migration costs, which hinge on PCIe and NVLink bandwidth not fully captured by Vidur.