FlexLLM: Token-Level Co-Serving of LLM Inference and Finetuning with SLO Guarantees

Gabriele Oliaro (Carnegie Mellon University), Xupeng Miao (Purdue University), Xinhao Cheng (Carnegie Mellon University), Vineeth Kada (Anthropic PBC), Mengdi Wu (Carnegie Mellon University), Ruohan Gao (Carnegie Mellon University), Yingyi Huang (Carnegie Mellon University), Remi Delacourt (Mistral AI), April Yang (Carnegie Mellon University), Yingcheng Wang (Purdue University), Colin Unger (Stanford University), Zhihao Jia (Carnegie Mellon University and Amazon Web Services)

23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 2 · Living Large in Shared Clouds

Overview

The rapid commercialization of large language model (LLM) APIs has popularized Fine-Tuning-as-a-Service (FaaS), enabling users to adapt foundation models—whether proprietary or open-source—using cloud provider infrastructure. Platforms such as Tinker (by Thinking Machines) and analogous APIs offered by major cloud providers rely on parameter-efficient techniques like LoRA (Low-Rank Adaptation) to let multiple tenants share a single backbone model while training lightweight adapter weights. However, deploying these services at scale exposes a fundamental operational dilemma: infrastructure teams must choose between maintaining separate GPU clusters for latency-critical inference and compute-intensive training, or attempting fragile manual multiplexing.

Watch on YouTube · Slides

Visual summary for FlexLLM: Token-Level Co-Serving of LLM Inference and Finetuning with SLO Guarantees by Gabriele Oliaro, Xupeng Miao, Xinhao Cheng, Vineeth Kada, Mengdi Wu, Ruohan Gao, Yingyi Huang, Remi Delacourt, April Yang, Yingcheng Wang, Colin Unger, Zhihao Jia
Visual summary for FlexLLM: Token-Level Co-Serving of LLM Inference and Finetuning with SLO Guarantees by Gabriele Oliaro, Xupeng Miao, Xinhao Cheng, Vineeth Kada, Mengdi Wu, Ruohan Gao, Yingyi Huang, Remi Delacourt, April Yang, Yingcheng Wang, Colin Unger, Zhihao Jia

Key moments

  1. 0:00 Introduction to FlexLLM and fine-tuning as a service
  2. 1:53 The problem of resource isolation and GPU underutilization
  3. 4:00 Co-serving concept and LoRA architecture fusion
  4. 6:15 Memory optimization via static compilation and graph pruning
  5. 7:55 Automated parallelization for complex model configurations
  6. 9:50 Incremental fine-tuning with token and layer-level scheduling
  7. 13:20 End-to-end evaluation and throughput comparisons
  8. 16:45 Burst workload case study and conclusion

FlexLLM: Token-Level Co-Serving of LLM Inference and Finetuning with SLO Guarantees

Speakers: Gabriele Oliaro, PhD Student, Carnegie Mellon University; Xupeng Miao (Purdue University); Xinhao Cheng (Carnegie Mellon University); Vineeth Kada (Anthropic PBC); Mengdi Wu (Carnegie Mellon University); Ruohan Gao (Carnegie Mellon University); Yingyi Huang (Carnegie Mellon University); Remi Delacourt (Mistral AI); April Yang (Carnegie Mellon University); Yingcheng Wang (Purdue University); Colin Unger (Stanford University); Zhihao Jia (Carnegie Mellon University and Amazon Web Services)

Conference: USENIX NSDI

YouTube: https://www.youtube.com/watch?v=cmHEqiJuRJA

Overview

The rapid commercialization of large language model (LLM) APIs has popularized Fine-Tuning-as-a-Service (FaaS), enabling users to adapt foundation models—whether proprietary or open-source—using cloud provider infrastructure. Platforms such as Tinker (by Thinking Machines) and analogous APIs offered by major cloud providers rely on parameter-efficient techniques like LoRA (Low-Rank Adaptation) to let multiple tenants share a single backbone model while training lightweight adapter weights. However, deploying these services at scale exposes a fundamental operational dilemma: infrastructure teams must choose between maintaining separate GPU clusters for latency-critical inference and compute-intensive training, or attempting fragile manual multiplexing.

Separate clusters guarantee absolute workload isolation and protect inference latency Service Level Objectives (SLOs), but they introduce severe inefficiencies. Inference traffic is notoriously bursty and unpredictable, forcing providers to heavily overprovision GPUs. During periods of low inference demand, these clusters sit idle, while neighboring training clusters may face distinct utilization profiles. Moving fine-tuning jobs onto inference GPUs on-the-fly is practically impossible with traditional frameworks because abruptly halting or rescheduling training jobs introduces unacceptable latency spikes that violate strict inference SLOs.

To solve this problem, researchers from Carnegie Mellon University, Purdue University, Anthropic, Mistral AI, Stanford, and AWS developed FlexLLM, a system designed to co-serve LLM inference and parameter-efficient fine-tuning (PEFT) on the exact same GPU resources. By introducing novel compilation, memory management, and scheduling abstractions—specifically token-level fine-tuning, layer-level fine-tuning, and fused kernels—FlexLLM dynamically expands fine-tuning workloads into spare inference capacity when demand drops, and shrinks them instantaneously when inference bursts arrive, all without breaching strict user-facing latency SLOs.

Background

▶ Watch: Introduction to FlexLLM and fine-tuning as a service (0:00)

The infrastructure stack for serving LLMs has evolved around strict operational boundaries. High-performance inference engines like vLLM are engineered to maximize request throughput and minimize time-to-first-token (TTFT) and inter-token latency. These systems employ continuous batching, PagedAttention, and aggressive memory management to handle unpredictable Poisson-like arrival processes. Conversely, training and fine-tuning frameworks like Llama Factory prioritize sustained compute utilization across massive backward passes, gradient accumulations, and optimizer steps.

When infrastructure providers attempt to unify these disparate workloads, they encounter architectural friction. A standard transformer inference step consists solely of a forward pass over frozen weights, structured for memory-bandwidth-bound token generation or compute-bound prompt prefilling. Fine-tuning, even with parameter-efficient methods like LoRA, requires calculating activations, storing intermediate tensors for the backward pass, computing gradients for adapter matrices (and potentially backbone weights), and updating optimizer states (such as AdamW momentum and variance vectors).

This introduces two primary systems challenges:

  1. Memory Footprint Disparity: The memory required to fine-tune an LLM is a multiple of the memory required purely for inference. Allocating tensors for gradients and activation caching alongside active inference KV caches causes out-of-memory (OOM) errors on shared GPUs.
  2. Scheduling Granularity: Inference steps execute in tens of milliseconds, whereas fine-tuning iterations (comprising both forward and backward passes) take orders of magnitude longer. A naive joint scheduler forces inference requests to stall behind long-running backward kernels, instantly violating millisecond-scale latency SLOs.

Prior work in workload multiplexing largely relied on coarse-grained temporal sharing (alternating entire training and inference epochs or batches) or rigid spatial partitioning (slicing streaming multiprocessors or GPU memory spaces). These approaches fail to react dynamically to sub-second traffic surges, leaving providers trapped between chronic underutilization and SLO violations.

Key Findings

▶ Watch: Co-serving concept and LoRA architecture fusion (4:00)

FlexLLM demonstrates that LLM inference and PEFT fine-tuning can be tightly co-served on shared GPU hardware without sacrificing inference performance. The main discoveries and results established by the system include:

  • Massive Fine-Tuning Throughput Gains: By leveraging idle inference capacity through intelligent co-serving, FlexLLM increases fine-tuning throughput by up to 4.8× under heavy loads and up to 6.8× under light loads, compared to statically partitioned baseline clusters with equivalent aggregate resources.
  • Strict SLO Compliance: FlexLLM maintains high SLO attainment (comparable to dedicated inference clusters) even under bursty, production-derived arrival traces from platforms like Azure.
  • Dramatic Memory Reduction: Through automated graph pruning and selective activation recomputation, FlexLLM cuts memory utilization by up to 80%, making it feasible to fit both inference KV caches and fine-tuning gradient/activation states within the memory limits of standard accelerators.
  • Sub-Millisecond Reactivity: FlexLLM makes scheduling decisions at the granularity of individual forward passes, allowing the system to shrink fine-tuning resource consumption within milliseconds when an inference burst arrives.

Technical Deep Dive

▶ Watch: Automated parallelization for complex model configurations (7:55)

FlexLLM achieves its performance through an integrated stack combining custom compilation, graph-level analysis, and incremental scheduling techniques.

1. Fused Forward Kernels and Memory Management

In a standard LoRA setup, the target linear module computes $h = Wx + BAx$, where $W$ is the frozen backbone weight matrix, and $A$ and $B$ are low-rank adaptation matrices. FlexLLM fuses the forward pass of inference and the forward pass of fine-tuning into a single unified kernel. This allows the system to evaluate the shared backbone weights ($W$) exactly once, eliminating redundant memory reads of the massive base model parameters.

However, fine-tuning requires storing activation tensors for the backward pass. To prevent memory exhaustion, FlexLLM implements a static graph pruning compiler pass. By analyzing the computational graph ahead of execution, the compiler identifies and prunes unnecessary tensors—such as gradients for frozen backbone weights—and dynamically determines whether intermediate activations should be stored in high-bandwidth memory (HBM) or recomputed on-the-fly during the backward pass. This analysis yields up to an 80% reduction in memory overhead.

2. Independent Parallelism Optimizer

When serving large models (such as 8B to 32B parameter LLMs) across a cluster, tensor parallelism, pipeline parallelism, and data parallelism must be configured carefully. When multiple parallel LoRA adapters are attached to a single backbone model, each tensor dimension can be sharded, replicated, or left unparallelized in combinatorial ways. Manual configuration is intractable.

FlexLLM incorporates an automated compiler pass that uses lightweight runtime profiling information to optimize parallelization strategies independently for the backbone model and all attached PEFT adapters, ensuring that operators sharing common tensors materialize data on the correct GPU devices without unnecessary cross-device communication overhead.

3. Incremental Fine-Tuning: Token-Level and Layer-Level Scheduling

To prevent fine-tuning backward passes from blocking latency-critical inference requests, FlexLLM breaks down fine-tuning execution into fine-grained increments:

  • Token-Level Fine-Tuning (Forward Pass): Instead of processing an entire fine-tuning training batch in a single monolithic step, FlexLLM distributes the tokens from the training batch across multiple sequential forward passes, aligning their execution time with standard inference step durations.
  • Layer-Level Fine-Tuning (Backward Pass): Rather than executing a full backward pass across all layers of the LLM simultaneously, FlexLLM staggers the backward pass across layers (e.g., computing gradients for the final two layers in step $t$, the preceding two layers in step $t+1$, and so on).

This incremental execution ensures that fine-tuning work is perfectly interleaved with inference steps. When an inference burst arrives, the scheduler can immediately suspend or scale back the current fine-tuning increment at the boundary of any forward pass, bounding the maximum induced delay to a few milliseconds.

Experimental Setup & Results

▶ Watch: Incremental fine-tuning with token and layer-level scheduling (9:50)

The authors evaluated FlexLLM across a robust experimental testbed designed to simulate real-world cloud serving environments.

Experimental Configuration

  • Model Scale: Standard open-weights transformer models ranging from 8 billion to 32 billion parameters.
  • Parallelism: Distributed across multi-GPU nodes using tensor parallelism degrees suited to the model sizes.
  • Inference Workloads: Evaluated using standard open-source chat inference traces (ShareGPT) as well as production arrival traces from Microsoft Azure.
  • Fine-Tuning Workloads: Powered by reasoning model fine-tuning datasets using LoRA adapters.
  • Baselines:
  • Separate Clusters: vLLM for inference paired with Llama Factory for fine-tuning, evaluated across various static resource split ratios (e.g., 50/50, 75/25).
  • Temporal & Spatial Multiplexing: Alternative co-serving baselines including fixed-frequency temporal alternation and spatial Streaming Multiprocessor (SM) partitioning.

Headline Results

  • SLO Attainment vs. Throughput: Under low arrival rates, all serving strategies maintain acceptable SLO compliance. However, when traffic spikes under Azure production traces, static resource partitioning schemes fail unless heavily biased toward inference (e.g., allocating 75% of resources to inference, which severely starves fine-tuning throughput). FlexLLM maintains strict SLO attainment while simultaneously delivering up to 4.8× higher fine-tuning throughput than the best-performing static split baseline under heavy loads.
  • Reactivity: In bursty case studies where arrival rates oscillate abruptly (e.g., jumping from 0 requests/second to 4 requests/second), FlexLLM demonstrates near-zero latency degradation. Because scheduling decisions are re-evaluated at every forward pass, the system dynamically dials back fine-tuning allocation within milliseconds.

Practical Implications

▶ Watch: Burst workload case study and conclusion (16:45)

For infrastructure teams and cloud platform engineers, FlexLLM bridges a long-standing operational divide between AI training and serving infrastructure.

  • Hardware Cost Reduction: By safely multiplexing fine-tuning onto inference GPUs, providers can eliminate the idle overprovisioning traditionally required to absorb peak inference traffic. Spare capacity is automatically monetized via billable fine-tuning-as-a-service jobs.
  • Operational Simplicity: FlexLLM automates complex parallelization and memory pruning, removing the burden from platform operators who previously had to manually partition clusters and risk SLA breaches.
  • Limitations & Tradeoffs: While FlexLLM effectively hides the compute latency of fine-tuning backward passes, the co-residency of training states and inference KV caches places a high demand on GPU memory bandwidth. Extremely high-concurrency inference loads combined with massive concurrent multi-adapter fine-tuning may still saturate HBM bandwidth, requiring careful tuning of adapter batch sizes and maximum sequence lengths.

Key Takeaways

  • FaaS Market Growth: Fine-Tuning-as-a-Service using parameter-efficient methods like LoRA represents a major emerging cloud workload that suffers from severe GPU underutilization due to static cluster isolation.
  • Co-Serving via Fusion: FlexLLM fuses inference and fine-tuning forward passes into single GPU kernels, sharing backbone weights and eliminating redundant memory reads.
  • Aggressive Memory Optimization: Automated graph pruning and selective activation recomputation reduce fine-tuning memory overhead by up to 80%, resolving OOM conflicts on shared accelerators.
  • Incremental Scheduling: Token-level forward distribution and layer-level backward staggering eliminate long execution stalls, guaranteeing strict inference latency SLOs.
  • Superior Efficiency: End-to-end evaluations prove that FlexLLM achieves up to 4.8× higher fine-tuning throughput under heavy production loads compared to separate cluster baselines without violating inference latency constraints.

About the Speaker(s)

Gabriele Oliaro is a PhD student at Carnegie Mellon University whose research focuses on systems and machine learning co-design, high-performance LLM serving infrastructure, and efficient distributed training systems. The work presented represents a collaborative effort spanning Carnegie Mellon University, Purdue University, Anthropic, Mistral AI, Stanford University, and Amazon Web Services.

Reviews

→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)

All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)