arXiv(opens in a new tab)cs.LGOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2611.00652

Inference First, Training Underneath: Layer-Granular LoRA Co-Serving with LayerLoom

Zongpu Zhang, Yishu Yin, Xuehai Qian

ABSTRACT

Serving and fine-tuning a large language model on the same GPUs can turn the idle capacity between inference bursts into training progress, and low-rank adaptation (LoRA) makes this co-location cheap because both workloads read a single frozen copy of the base weights. The difficulty lies in the fine-tuning backward pass, which has no counterpart in inference. Current co-serving systems schedule backward work per serving iteration: each iteration carries a fixed backward budget, and requests that arrive in the meantime wait for it to finish, so fine-tuning dictates inference latency whenever load spikes. We observe that the backward pass of a LoRA microbatch decomposes into per-layer tasks over the same weights that the inference forward pass visits, which allows backward work to be scheduled at layer rather than iteration granularity. Building on this observation, LayerLoom attaches same-layer backward tasks to the inference forward pass and, at each layer, runs only as many of them as the latency slack of in-flight requests permits. To keep a ready task at every layer, LayerLoom maintains a wavefront of fine-tuning microbatches staggered across layers, and it bounds the wavefront's activation memory by offloading microbatch state to host memory and prefetching it ahead of the layer where the scheduler plans to use it. A fused kernel serves the paired forward and backward GEMMs from a single read of each base weight. Because all backward work of an iteration finishes within its forward pass, new requests join the next iteration as in continuous batching. On an RTX 4090 GPU running Llama-3.1-8B under a bursty production trace, LayerLoom raises joint SLO attainment by 13.5–21.8 points over prior works with fine-tuning throughput that is comparable or up to 12% higher, and it reaches the same training losses.

1 INTRODUCTION

LLM platforms increasingly serve a model online while also fine-tuning it, e.g., to adapt it to new domains or users. The two workloads have opposite performance objectives. Online inference must meet a latency target for every request, i.e., a time-to-first-token (TTFT) and a time-per-output-token (TPOT) target, whereas fine-tuning prefers sustained throughput. Since inference demand is bursty, serving GPUs are typically provisioned for demand peaks and remain underutilized between bursts (Wang et al., 2025b). Running fine-tuning on the same GPUs could turn this idle capacity into training progress, provided that fine-tuning yields the GPU as soon as inference needs it.

Low-rank adaptation (LoRA) (Hu et al., 2022) makes such co-serving particularly attractive. Since LoRA freezes the pretrained base weights and trains only small adapters, inference and fine-tuning can share one resident copy of the base weights, and their forward passes apply the same operators to different tokens. Recent co-serving systems (He et al., 2025; Zhang et al., 2025b; Oliaro et al., 2026) exploit this sharing by merging fine-tuning tokens into the inference batch of each serving iteration.

The fine-tuning backward pass, however, has no counterpart in inference, and existing systems handle it at the granularity of a serving iteration. They attach a fixed amount of backward work to each iteration, e.g., after the merged forward pass or on a separate CUDA stream in FlexLLM (Oliaro et al., 2026), and form the next batch only after this work completes. A request that arrives during an iteration therefore waits for the attached backward work regardless of its latency target, which makes such iteration-level co-serving fine-tuning-prioritized in effect. Under bursty production traces, it lowers the joint SLO attainment of FlexLLM from at least 99% under inference alone to 1.5–19.0%, and attaching less backward work to each iteration restores responsiveness only by cutting fine-tuning throughput by up to 28×28\times.

We instead observe that the backward work does not have to be decided once per iteration. An inference iteration traverses the transformer layers in order, and the backward pass of a LoRA microbatch is itself a sequence of per-layer tasks on the same base weights. If backward tasks are attached to the inference forward pass one layer at a time, the runtime can decide at every layer how much backward work to run,

1^{1}Independent Researcher. 2^{2}Tsinghua University, China.

and no backward work remains when the forward pass ends, so a newly arrived request can join the next iteration just as in continuous batching (Yu et al., 2022).

To this end, we present LayerLoom, an inference-prioritized co-serving runtime built on three key ideas. First, a forward-anchored backward pipeline pairs the inference forward pass of each layer with backward tasks of the same layer. Since a backward pass runs from the last layer to the first, LayerLoom keeps a wavefront of microbatches whose next tasks lie at different layers, so that every layer finds a ready backward task. Second, an SLO-aware scheduler decides, layer by layer, how many of these tasks to run within the latency headroom of active requests. Third, since the paired inference forward and fine-tuning backward read the same base weight, a shared-weight kernel reads this weight only once for both GEMMs.

Turning these ideas into a working system raises two challenges. First, each microbatch in the wavefront retains the activations of all layers it has not yet processed, so a full wavefront over the 32 layers of Llama-3.1-8B retains 16.5×16.5 \times the activations of a single microbatch, which competes with the KV cache for GPU memory. LayerLoom addresses this challenge with scheduler-guided offloading, which moves each microbatch's state to host memory and prefetches it ahead of the layer at which the scheduler plans to run it. Second, the two fused GEMMs reduce along opposite dimensions of the base weight, so any mapping of the weight onto GPU thread blocks must reduce one of the outputs across blocks. LayerLoom reduces this cost by completing the wide backward output within each thread block and reducing only the narrow inference output across blocks.

We implement LayerLoom on FlexLLM and evaluate it on an RTX 4090 GPU with Llama-3.1-8B under a bursty production trace at two loads. Compared with FlexLLM's co-serving mode, LayerLoom achieves 21.8 and 13.5 points higher joint SLO attainment at the two loads, while training 12% more tokens per second at the lower load and a comparable number at the higher one. Offloading lets the wavefront hold twice as many microbatches as no-offloading allows, and the fused kernel runs 1.21−1.58×1.21-1.58\times faster than matched unfused kernels. LayerLoom also produces the same training losses as FlexLLM.

In summary, we make the following contributions.

• We examine existing co-serving runtimes and observe that they commit to backward work once per iteration, which makes inference wait for fine-tuning under bursty demand ( §2§2).

• We design LayerLoom, a forward-anchored backward pipeline with a backward wavefront and an SLO-aware scheduler ( §3§3).

• We address the two resulting challenges with scheduler-

guided offloading ( §4.1§4.1) and a shared-weight kernel ( §4.2§4.2).

• We implement a prototype of LayerLoom and evaluate it on a bursty production trace, showing 13.5–21.8 points higher SLO attainment with comparable or up to 12% higher fine-tuning throughput than a state-of-the-art co-serving runtime ( §6§6).

References (34)

  • Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve
  • PipeSwitch: Fast Pipelined Context Switching for Deep Learning Applications
  • Legion: Expressing locality and independence with logical regions
  • DeltaServe: Host-Agnostic Co-Serving of Inference and Fine-Tuning for LLMs, 2026 (opens arXiv in a new tab)
  • Punica: Multi-Tenant LoRA Serving
  • Training Deep Nets with Sublinear Memory Cost, 2016 (opens arXiv in a new tab)
  • Vicuna: An Open-Source Chatbot Impressing GPT-4 with 90%* ChatGPT Quality, 2023
  • Microsecond-scale Preemption for Concurrent GPU-accelerated DNN Inferences
  • Resource Multiplexing in Tuning and Serving Large Language Models
  • LoRA: Low-Rank Adaptation of Large Language Models
  • GPipe: Efficient Training of Giant Neural Networks using Pipeline Parallelism
  • Efficient Memory Management for Large Language Model Serving with PagedAttention
  • From Tokens to Layers: Redefining Stall-Free Scheduling for MoE Serving with Layered Prefill
  • PipeDream: generalized pipeline parallelism for DNN training
  • Paella: Low-latency Model Serving with Software-defined GPU Scheduling
  • FlexLLM: Token-Level Co-Serving of LLM Inference and Finetuning with SLO Guarantees
  • Stream-K: Work-Centric Parallel Decomposition for Dense Matrix-Matrix Multiplication on the GPU
  • ConServe: Fine-Grained GPU Harvesting for LLM Online and Offline Co-Serving
  • ZeRO-Offload: Democratizing Billion-Scale Model Training
  • vDNN: Virtualized deep neural networks for scalable, memory-efficient neural network design
  • SLoRA: Scalable Serving of Thousands of LoRA Adapters
  • Orion: Interference-aware, Fine-grained GPU Sharing for ML Applications
  • Llumnix: Dynamic Scheduling for Large Language Model Serving
  • Stability properties of constrained queueing systems and scheduling policies for maximum throughput in multihop radio networks
  • Colocating ML Inference and Training with Fast GPU Memory Handover
  • BurstGPT: A Real-World Workload Dataset to Optimize LLM Serving Systems
  • dLoRA: Dynamically Orchestrating Requests and Adapters for LoRA LLM Serving
  • FastServe: Iteration-Level Preemptive Scheduling for Large Language Model Inference
  • MuxTune: Efficient Multi-Task LLM Fine-Tuning in Multi-Tenant Datacenters via Spatial-Temporal Backbone Multiplexing
  • Orca: A Distributed Serving System for Transformer-Based Generative Models
  • Fine-Grained GPU Sharing Primitives for Deep Learning Applications
  • Improving GPU Sharing Performance through Adaptive Bubbleless Spatial-Temporal Sharing
  • Loquetier: A Virtualized Multi-LoRA Framework for Unified LLM Fine-tuning and Serving
  • DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving