Manuscript Offprint
arXiv:2611.00652Inference First, Training Underneath: Layer-Granular LoRA Co-Serving with LayerLoom
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 .
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,
Independent Researcher. 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 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 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 ( ).
• We design LayerLoom, a forward-anchored backward pipeline with a backward wavefront and an SLO-aware scheduler ( ).
• We address the two resulting challenges with scheduler-
guided offloading ( ) and a shared-weight kernel ( ).
• 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 ( ).
2.1 LLM Inference and LoRA Fine-Tuning
Online LLM serving processes each request in two phases. The prefill phase encodes the prompt into the key-value (KV) cache, and the decode phase then generates one output token at a time from the cached state. Since the engine can form a new batch at every prefill or decode iteration, continuous batching (Yu et al., 2022) allows newly arrived request to join the batch as soon as the current iteration finishes. The latency of a request is accordingly characterized by its time-to-first-token (TTFT), which includes queueing and prefill, and its time-per-output-token (TPOT) during decode.
Low-rank adaptation (LoRA) (Hu et al., 2022) fine-tunes an LLM by freezing its pretrained base weights and training small low-rank adapters attached to selected linear layers. Because the base weights are shared, many adapted variants of an LLM can be served or fine-tuned on one resident copy of its base weights (Chen et al., 2024; Sheng et al., 2024; Wu et al., 2024; Xue et al., 2026). Consider a LoRA linear layer with frozen base weight , adapters and with , , and scaling factor . Given an input , the layer computes
and given the output gradient , backpropagation computes
(2)
Freezing removes and its optimizer state, but propagating the gradient to earlier layers still requires the dense product in . The base weight is therefore used both by the inference and fine-tuning forward passes, which compute for different tokens, and by the fine-tuning backward pass, which computes .
2.2 Co-Serving Inference and Fine-Tuning
Since inference GPUs are typically provisioned for demand peaks, they sit partly idle between bursts, and co-serving can use this idle capacity to fine-tune the same model. Unlike general GPU-sharing systems, which colocate independent jobs by time slicing or spatial partitioning (Strati et al., 2024;

(a) Joint SLO attainment

(b) TTFT (log scale)

(c) TPOT

(d) Capping the microbatch
Figure 1. FlexLLM co-serving on an A800 GPU. (a)–(c) Joint SLO attainment, TTFT, and TPOT under the low-, median-, and high-burstiness traces. (d) Fine-tuning throughput relative to the uncapped default (line), and TTFT SLO attainment (bars), when the fine-tuning microbatch is capped at various sizes, under the high burstiness trace. "Def" refers to FlexLLM's uncapped default microbatches, with a median of 3308 tokens.
Zhang et al., 2025a; Wang et al., 2025a), LoRA co-serving runtimes such as FlexLLM (Oliaro et al., 2026) additionally merges the fine-tuning forward tokens into the inference batch of each iteration.
The LoRA fine-tuning backward pass, however, has no counterpart in inference and must be scheduled on its own. Existing runtimes attach a fixed amount of backward work, e.g., the backward of a few layers of one microbatch, to each serving iteration. FlexLLM offers three ways to execute this work. (1) Co-serving runs it inside the inference iteration, right after the merged forward pass, (2) spatial sharing runs it on a separate CUDA stream that overlaps the merged forward pass, while (3) temporal sharing alternates inference iterations with standalone fine-tuning forward and backward passes. In all three cases, the runtime forms the next inference batch only after this backward work completes.
Such iteration-level co-serving keeps scheduling simple, since each iteration is a self-contained unit that the runtime can launch. However, it also means that the runtime commits to the backward work when it forms an iteration and cannot revise this commitment when new requests arrive while the iteration runs.
2.3 Motivation
Setup. To examine whether iteration-level co-serving keeps inference within its latency SLOs when demand is bursty, we run the default co-serving mode of FlexLLM (Oliaro et al., 2026) on one A800-SXM4-80GB GPU with Llama-3.1-8B model and rank-16 LoRA on the MLP down-projection, following the FlexLLM paper. Fine-tuning samples are drawn from Sky-T1 with up to 8K tokens, and inference requests take their prompt and decode lengths from ShareGPT (Chiang et al., 2023). To isolate the effect of burstiness, we cut BurstGPT (Wang et al., 2025b) into segments of 4K consecutive requests, normalize them to a common duration, and pick the segments at the 10th, 50th, and 90th percentiles of the coefficient of variation of per-second arrivals as the low, median, and high-burstiness traces. They share the same sequence of prompt and output lengths and differ only in
request timing.
Following FlexLLM's setting for 8B models, a request meets its SLO only if its TTFT is at most 5 s and its TPOT is at most 50 ms. We replay each trace three times at 2.75 requests/s, the highest rate at which inference alone attains at least 99% SLO attainment on all three traces, so that SLO violations reflect co-serving rather than overload.
Observation 1: Iteration-level co-serving violates inference SLOs under bursts. As shown in Fig. 1a, co-serving lowers the joint (TTFT and TPOT) SLO attainment from at least 99% under inference alone to 18.96%, 12.89%, and 1.51% under low, median, and high burstiness, respectively. Figs. 1b and 1c further show that the degradation comes almost entirely from the first token. The median TTFT rises from 36.2 s under low burstiness to 145.9 s and 175.8 s under median and high burstiness, and the P99 TTFT exceeds 296 s in every case, whereas the median TPOT stays near 46 ms. This is because a request that arrives during a burst waits behind the backward work of every iteration ahead of it, and the more requests arrive together, the longer this queue grows.
Observation 2: Attaching less backward work to each iteration sacrifices fine-tuning throughput. A natural remedy within iteration-level co-serving is to attach less backward work to each iteration, so that every iteration, and hence every wait, becomes shorter. Preempting backward work when a request arrives (Bai et al., 2020; Han et al., 2022) is an alternative, but the request would then still wait for the active unit or pay to save and restore its partial state. To quantify this trade-off, we cap the fine-tuning microbatch on the high-burstiness trace at 2048, 512, 128, 32, 8, and 1 tokens, whereas FlexLLM's uncapped default uses microbatches with a median of 3308 tokens.
We observe that smaller caps can raise the TTFT SLO attainment (Fig. 1d), from 1.59% without a cap to 35.29% at 512 tokens and 72.51% at 128 tokens, yet even a one-token cap reaches only 81.40%, compared with 99.89% for inference alone. Meanwhile, fine-tuning throughput drops much faster, as the 512- and 128-token caps retain only 38.76%

Figure 2. One co-serving iteration of a four-layer model, with a request arriving at the same time in every panel. and are the forward and backward of layer , and superscripts in (e) denote different microbatches.
and 13.28% of the default 2,392.7 tokens/s and the smallest caps retain at most 3.58%.
Key insight. The above results suggest that the amount of backward work per iteration determines both (a) how long a new request waits and (b) how efficiently the backward GEMMs run. A large amount delays every inference request that arrives during a burst until the work completes, whereas a small amount fragments the backward computation into narrow GEMMs that underutilize the GPU and throttle fine-tuning throughput. In short, an iteration-level runtime cannot shorten the queueing time without slowing fine-tuning significantly.
We argue that an inference-prioritized co-serving runtime should instead decide the backward work during the iteration rather than before it. Specifically, it should (a) leave no backward work at the iteration boundary, so that new requests start as soon as the forward pass ends, while (b) still letting fine-tuning use the capacity that active requests leave within their SLOs with microbatches of efficient size. Achieving both requires deciding how much backward work to run while the inference iteration executes, layer by layer, which motivates the LayerLoom pipeline design as follows.
3 LAYERLOOM PIPELINE
3.1 Co-Serving Schedule
LayerLoom divides the backward pass of each fine-tuning microbatch into one backward task per transformer layer, which applies Eq. 2 at that layer. As an inference iteration advances from layer 1 to layer , the runtime may execute the inference forward of layer with ready backward tasks of layer from older microbatches.
Key properties. When the forward pass finishes the last layer , this iteration ends without any outstanding backward task, so a request that arrived during the iteration is admitted immediately, which makes our schedule inference first. The runtime adds a backward task at a layer only if the task fits within the latency headroom of the active inference

Figure 3. Cross-microbatch backward wavefront. Each backward microbatch (i.e., BWD-I to BWD-V) follows reverse layer order (gray dashed arrows), while their next ready tasks (blue) collectively follow the forward traversal.
requests. During a burst, the runtime withholds backward tasks from every layer that it has not yet dispatched, which makes the backward tasks opportunistic.
Fig. 2 compares our schedule with the three FlexLLM modes for a request that arrives during an iteration. In every FlexLLM mode, the request also waits for the backward work attached to the iteration. Whereas in LayerLoom, it waits only for the rest of the inference forward pass and the backward tasks already dispatched, since the runtime withholds backward tasks from the remaining layers.
Backward Wavefront. A single microbatch cannot feed this schedule, because its backward tasks become ready in reverse layer order while inference visits the layers in forward order. LayerLoom therefore keeps a wavefront of microbatches whose next tasks are staggered by one layer, so that every layer of an inference iteration finds a ready task (Fig. 3). Each iteration advances every microbatch by one layer, after which the oldest one completes and a new one enters at the last layer, restoring the same pattern. The runtime tracks the wavefront with a FIFO queue per layer and the backward pass of each microbatch spreads over at least successive iterations.
3.2 SLO-Aware Scheduling
We propose an SLO-aware scheduler in LayerLoom that decides how many ready backward tasks to run before each layer. The scheduler follows a simple greedy rule based on the latency headroom of the active inference requests.
The latency headroom is the time that backward tasks may still add to the current iteration at layer without making any request miss its SLO. To calculate , the scheduler (1) takes the time remaining until the earliest TTFT or TPOT deadline among unfinished requests, (2) subtracts the inference-only latency of the layers that remain in the iteration, i.e., layers to , and (3) if some requests are still waiting for their first token, subtracts the inference-only time to prefill them as well.
To estimate how much of the backward tasks consume, the scheduler uses a profiled latency model . Given the number of inference tokens in the current batch and a number of backward tasks , the model returns the latency that the backward tasks add to the current layer, measured as the median increase over the same layer without backward tasks.
With these two quantities, the greedy rule picks the largest such that and runs the backward tasks of the oldest microbatches queued at layer , since they are closest to completing their backward pass. We prefer this greedy rule to planning all remaining layers jointly, because a backward task costs roughly the same at every layer of an iteration. Saving headroom for later layers would therefore not let more tasks run, whereas spending it immediately finishes the oldest microbatches first.
Finally, LayerLoom accumulates the gradients of multiple microbatches that all run against the same LoRA adapter weights, and it applies the optimizer update only after the last of them finishes its backward pass. Before the next group of microbatches starts, this optimizer barrier drains the wavefront, which takes at least iterations, since a microbatch advances by one layer per iteration.
4 BOUNDING MEMORY AND FUSING SHARED-WEIGHT COMPUTATION
Realizing the above pipeline exposes two new challenges. First, the wavefront keeps many microbatches paused in the middle of their backward passes, and each of them retains activations for the layers it has yet to process. Second, the pipeline pairs the inference forward and the fine-tuning backward on the same base weight, whose two GEMMs reduce along opposite dimensions. We address the first challenge with scheduler-guided offloading in §4.1 and the second with a shared-weight GEMM kernel in §4.2.
4.1 Scheduler-Guided Offloading
Suppose that each layer retains bytes of activations per microbatch and that each microbatch holds a boundary gradient of bytes. Iteration-level co-serving, e.g., FlexLLM, runs the backward pass of one microbatch at a time and thus retains at most bytes. A full wavefront, in contrast, holds one microbatch at each layer , which still retains the activations of layers , so it occupies
For FP16 Llama-3.1-8B, where is about 120 KiB per token, reaches 124.4 GiB for 2048-token microbatches, compared with 7.5 GiB under iteration-level co-serving. Keeping this state in GPU memory could be impractical.
LayerLoom therefore offloads the retained state to pinned host memory. As soon as the fine-tuning forward pass completes a layer, the offload manager copies the retained activations of that layer to a preallocated host memory region on a separate CUDA stream. It also offloads each boundary gradient right after the backward task that produces it. As a result, the GPU holds only the state of the microbatches that are currently being produced or consumed. When the host PCIe link becomes the offloading bottleneck, e.g., while training for long sequences, recomputing cheap tensors instead of offloading them could further reduce this traffic.
LayerLoom additionally ensures that offloading does not stall computation by prefetching each microbatch's state back to the GPU before its backward task runs. Since the scheduler's plan already determines which microbatches each upcoming layer will run, the offload manager uses this plan to time the prefetches. For each planned microbatch, it walks back from the layer at which the microbatch will run, accumulating profiled layer times until they cover the host-to-device transfer, and issues the prefetch at that layer, serving the earliest use first. When a new incoming request revises the scheduler's plan, both the old and new plans select FIFO prefixes of each layer's queue, so the offload manager keeps the prefetches they share and fetches only the newly selected state.
4.2 Shared-Weight Forward-Backward Kernel
As established in §2.1, the inference forward computes while the fine-tuning backward computes . A fused kernel can load each tile of once for both GEMMs and thereby halve the base weight reads.
However, realizing this saving is not straightforward. A GEMM kernel assigns output tiles to thread blocks (CTAs) (NVIDIA Corporation, 2026), and since the two GEMMs reduce along opposite dimensions of , a weight partition that completes one output within a CTA leaves

(a) Forward reduction.
(b) Cross-CTA backward reduction.
Figure 4. A row-wise weight partition completes forward locally but distributes backward across CTAs.
partial sums of the other output spread across CTAs, as illustrated in Fig. 4. If the wide backward output is the one spread across CTAs, the reduction traffic erases the saving. For instance, for down_proj with 64-row panels and 128 backward tokens, a row-wise mapping writes about 470 MB of FP32 partial gradients to save a 117 MB weight read, which outweighs the saving four times over.
Since the two GEMMs reduce along different dimensions, one of their outputs must be reduced across CTAs. On commodity GPUs, this reduction can be costly, because CTAs cannot share registers or shared memory, so their partial sums must travel through global memory¹. LayerLoom therefore assigns this cross-CTA reduction to the inference output, which spans far fewer tokens than the backward output. It partitions into column panels, and each CTA processes all rows of its panel, so the backward output of a panel accumulates within a single CTA, while the CTAs add their partial inference outputs to a shared FP32 buffer with atomic operations.
We further improve Tensor Core utilization in the fused kernel with a software pipeline shared by both GEMMs. Specifically, we design a three-stage cp.async pipeline that prefetches the next tiles of and into shared memory while the current tile is being computed, which hides HBM latency, and maintains a swizzled layout that avoids shared-memory bank conflicts. Each staged weight tile is consumed by both GEMMs before its stage is refilled. The fused kernel reads the tile into registers with ldmatrix, using its transposing variant for the backward GEMM, so both GEMMs obtain the operand layouts of the Tensor Cores without extra copies, and both execute mma .sync.m16n8k16 Tensor Core instructions. The inference input stays in registers for a whole panel. Finally, the kernel launches one persistent CTA per SM and assigns each CTA the same number of weight rows to maximize SM utilization, following (Osama et al., 2023).
¹NVIDIA Hopper's distributed shared memory lets the CTAs of a thread-block cluster reduce partial sums in each other's shared memory, but the cost of cross-CTA reductions remains substantial compared with reductions in local shared memory.

Figure 5. LayerLoom system architecture.
5 IMPLEMENTATION
We implement LayerLoom on top of FlexLLM (Oliaro et al., 2026), which builds on FlexFlow Serve and the Legion runtime (Bauer et al., 2012), with 2.9K lines of C++ and CUDA. We leave the operators, LoRA kernels, and optimizer of FlexLLM unchanged for fair comparison.
Fig. 5 shows the architecture of the LayerLoom system. The backward wavefront (§3.1) organizes ready tasks in per-layer FIFO queues, and the SLO-aware scheduler (§3.2) selects how many to run using latency headroom and a profiled cost model. The offload manager (§4.1) keeps retained state in host memory and prefetches it for the selected tasks. The shared-weight kernel (§4.2) fuses the inference-forward and fine-tuning-backward GEMMs to reuse each base-weight tile.
6 EVALUATION
6.1 Experimental Setup
Our evaluation runs on one NVIDIA RTX 4090 GPU with Llama-3.1-8B in FP16, and we apply rank-16 LoRA to down_proj. Inference requests replay the high-burstiness trace of §2.3 at two loads, which we calibrate by the joint SLO attainment of inference alone so that neither load overloads the GPU by itself. Specifically, inference alone attains 100% at the Mid load and 98% at the High load.
In every evaluated system, fine-tuning uses microbatches of 128 tokens and accumulates gradients over 64 microbatches per optimizer update. A request meets its SLO if its TTFT is at most 5 s and its TPOT is at most 168 ms, which is 2.5× the median TPOT of inference alone on this GPU. We report (1) the joint SLO attainment, i.e., the fraction of requests that meet both TTFT and TPOT targets, and (2) the fine-tuning (FT) throughput in trained tokens per second.

(a) Mid load - SLO attainment

(b) Mid load - FT Throughput

(c) High load - SLO attainment

(d) High load - FT Throughput
Figure 6. Joint SLO attainment and fine-tuning throughput at the Mid (a, b) and High (c, d) loads.
We compare LayerLoom with the following baselines.
-
Inference-only runs FlexLLM without fine-tuning and gives the SLO attainment that other systems should approach.
-
FlexLLM (FLLM) runs its co-serving mode with the default backward setting.
-
FlexLLM-temporal (FLLM-T) and FlexLLM-spatial (FLLM-S) run FlexLLM's temporal and spatial sharing modes with their default settings.
-
FlexLLM-Backward-b (FLLM-Bb) limits co-serving to b backward layers per iteration, which represents the strategy of attaching less backward work to each iteration, and b = 1 is its most responsive setting.
All systems run the same cuBLAS kernels without Legion tracing (Bauer et al., 2012), because the per-layer graphs of LayerLoom change with every scheduling decision and cannot be replayed as one fixed trace. Unless noted otherwise, LayerLoom uses the greedy scheduler of §3.2 and a wavefront of at most 16 microbatches, and it enables offloading only when GPU memory is insufficient. LayerLoom and all baselines use the same configuration at both loads. Each experiment is repeated at least three times, and we report the mean results.
6.2 End-to-End SLO and Throughput
We first compare the end-to-end SLO attainment and fine-tuning throughput of LayerLoom with those of the baselines, and we make two observations.
First, LayerLoom achieves higher SLO attainment than FlexLLM at both loads without sacrificing fine-tuning throughput, as shown in Fig. 6. At the Mid load, LayerLoom attains 94.4% joint SLO attainment compared with

(a) TTFT

(b) TPOT
Figure 7. Inference latency. Dotted lines mark the SLO targets.
72.6% for FlexLLM, and it also trains 12% more tokens per second, i.e., 475 compared with 425. The High load shows a similar advantage, where LayerLoom attains 88.8% compared with 75.2% for FlexLLM while training a comparable 449 versus 463 tokens per second. In summary, LayerLoom improves SLO attainment by 21.8 and 13.5 points at the two loads while keeping fine-tuning throughput on par with or above FlexLLM.
Second, LayerLoom outperforms all other FlexLLM variants by at least 14.1 points in SLO attainment at both loads, while none of them trains more tokens per second. Specifically, (1) FLLM-B1, which attaches only one backward layer to each iteration, attains only 80.3% and 66.0% SLO attainment while training 28 and 27 tokens per second at the two loads, i.e., 16–17× less than LayerLoom. (2) FLLM-T performs worst, with 42.3% and 41.3% SLO attainment at about 77 tokens per second, because every request that arrives during a standalone fine-tuning pass waits for the whole pass. (3) FLLM-S trains 404 and 428 tokens per second but attains only 60.3% and 58.3% at the two loads, since the backward stream slows the forward pass and the next batch still waits for both streams. LayerLoom, in contrast, batches the backward tasks of each layer and withholds them only when the headroom is short, which keeps both its SLO attainment and its throughput high.
Tail latency. To understand where the higher SLO attainment of LayerLoom comes from, we further compare the P99 TTFT and TPOT of inference alone, FlexLLM, and LayerLoom in Fig. 7, and we make two observations.
First, LayerLoom lowers the P99 TTFT from 55.4 s to 14.2 s at Mid and from 54.8 s to 30.5 s at High, because a request that arrives during a burst no longer waits for backward work that was committed when the iteration started. It also keeps the P99 TPOT at 165 ms and 153 ms, below the 168-ms target, whereas FlexLLM reaches 308 ms and 252 ms, respectively.
Second, LayerLoom still trails inference alone by 5.6 points at Mid and 9.2 points at High. Since its P99 TPOT meets the target, the remaining violations come from the first token. Its P99 TTFTs of 14.2 s and 30.5 s show that requests still queue during the largest bursts, when the 16-request

Figure 8. Saved fine-tuning state at the Mid load in GPU and pinned host memory. OOM marks configurations that run out of GPU memory.

Figure 9. Joint SLO attainment (bars) and fine-tuning throughput (line) versus the wavefront limit at the Mid load, from single 300-s runs.
batch is full, and the observed iteration latency exceeds the scheduler's prediction in 18–23% of iterations, so the latency model occasionally admits more backward tasks than the headroom allows.
6.3 Wavefront Size and Memory Offloading
Next, we evaluate how the offload manager of LayerLoom enables larger wavefronts and saves GPU memory, and how the wavefront size affects the two metrics.
Fig. 8 shows how the saved fine-tuning state grows with the wavefront at the Mid load. Without offloading, LayerLoom can only scale to 24 microbatches, and the runs with 32 and 48 microbatches run out of GPU memory. The saved state grows from 1.8 GiB with 4 microbatches to 9.7 GiB with 24, while the GPU also holds the LLM weights and the KV cache. With the offload manager, LayerLoom places the saved state of 32 and 48 microbatches in 16.0 GiB and 24.0 GiB of pinned host memory, respectively. Only 1.6–2.4 GiB of state remains on the GPU for staging and prefetching.
To examine how the wavefront size affects fine-tuning throughput and SLO attainment, we vary the wavefront limit from 4 to 48 microbatches at the Mid load, enabling offloading for 32 and 48 microbatches, and show the results in Fig. 9.
Fine-tuning throughput rises from 187 to 470 tokens per second as the wavefront grows from 4 to 16 microbatches, while SLO attainment falls only from 100% to 92%, be-
Table 1. Scheduling policies of LayerLoom with 48 backward microbatches, averaged over five runs.
| Policy | Mid load | High load | ||
|---|---|---|---|---|
| SLO (%) | FT (tok/s) | SLO (%) | FT (tok/s) | |
| Greedy (ours) | 88.7 | 511 | 81.9 | 478 |
| Lookahead | 86.9 | 463 | 77.3 | 437 |
| Split | 78.7 | 485 | 79.8 | 466 |
cause a larger wavefront places ready backward tasks at more layers and lets the scheduler spend more of the headroom. From 24 microbatches on, both metrics level off at about 80% SLO attainment and 400–440 tokens per second, including the runs with 32 and 48 microbatches that require offloading, which suggests that the headroom rather than the number of ready tasks then limits the backward work.
In summary, offloading allows the wavefront to grow beyond GPU memory, and the wavefront size provides a knob that trades SLO attainment for fine-tuning throughput.
6.4 Scheduling Policy
In §3.2, we argued that the greedy rule of LayerLoom needs neither a plan for the remaining layers nor headroom saved for them. To test both arguments, we compare the greedy rule with two alternative policies that we also implement in LayerLoom. We run all three policies with 48 fine-tuning microbatches and offloading enabled, since this setting has the most microbatches competing for the headroom.
(1) The lookahead policy plans all remaining layers of the iteration at once. It chooses the number of tasks at each layer so that their total cost fits within the headroom, favoring layers whose queue is longer than that of the next layer in the spirit of MaxWeight scheduling (Tassiulas & Ephremides, 1992), and it solves this choice by dynamic programming before every layer. (2) The split policy instead saves headroom for later layers by giving each remaining layer a share of the headroom proportional to its queue length.
First, Table 1 shows that the greedy rule attains the highest SLO attainment and fine-tuning throughput at both loads. Specifically, it attains 1.8 and 4.6 points higher SLO attainment and 10% and 9% higher throughput than the lookahead policy at the Mid and High loads, and 10.0 and 2.1 points higher SLO attainment and 5% and 3% higher throughput than the split policy. Second, to understand why the greedy rule performs better, we replay 8,192 recorded scheduling decisions. Among the decisions in which a queued task fits within the headroom of the current layer, the greedy rule schedules a backward task every time, whereas the lookahead policy skips 14% of them because its plan reserves headroom for later layers, and the split policy skips 35% because its share of the headroom often falls below

(a) Microbenchmark

(b) In-runtime
Figure 10. Shared-weight down_proj kernel. (a) Speedup over two unfused kernels on the same mainloop. (b) down_proj GPU time per iteration inside LayerLoom at the Mid load.
the cost of a single task. These results suggest that holding headroom back for later layers, whether by planning or by splitting, leaves headroom unused without letting more tasks run. Lastly, the greedy rule also has the lowest runtime overhead, taking 0.1 µs per decision, compared with 48 µs for the lookahead policy and 0.14 µs for the split policy.
6.5 Shared-Weight Kernel
Next, we evaluate the shared-weight kernel by comparing it with two unfused kernels, one for WX and one for , which isolates the effect of reading each base weight tile only once.
We run the fused kernel and the unfused pair on the down_proj shape of Llama-3.1-8B, with 1–64 inference tokens and one or two backward microbatches, i.e., 128 or 256 backward tokens. As shown in Fig. 10(a), the fused kernel is 1.42–1.58× faster than the unfused pair for one backward microbatch and 1.21–1.25× faster for two. The speedup decreases with more backward microbatches, because the saved weight read becomes a smaller share of the work.
To further measure the benefit inside the full runtime, we run LayerLoom with either kernel at the Mid load, with a wavefront of 24 microbatches, and measure the time of every down_proj invocation with CUDA events. The fused kernel reduces the GPU time of down_proj from 5.66 ms to 3.58 ms per iteration, a 1.58× reduction, as shown in Fig. 10(b).
In summary, reading each base weight once for both GEMMs speeds up down_proj by up to 1.58×, both in isolation and inside the full runtime.
6.6 Training Correctness
To verify the training correctness of LayerLoom, we feed LayerLoom and FlexLLM the same samples in the same

(a) Training alone

(b) Mid load
Figure 11. Mean training loss per optimizer update (a) without inference load, where the two curves overlap, and (b) under the Mid load, with two runs per system.
order with the same learning rate, and we log the loss of every sample together with its adapter version, i.e., the number of updates applied at each of the 32 layers when its forward pass ran.
Without inference load, LayerLoom and FlexLLM produce the same losses for all 1,280 samples of 20 updates, with a maximum relative difference of , as shown in Fig. 11(a). The wavefront, the state transfers, and the optimizer barrier therefore preserve sequential gradient accumulation.
Co-serving makes the training numerics of both systems depend on which inference tokens share each GEMM with the fine-tuning tokens. Before the first update, when all forward passes use identical adapter weights, the per-sample losses of both LayerLoom and FlexLLM under the Mid load match training alone within 0.034%, so a co-served forward pass computes the same loss up to FP16 rounding. After the first update, these small rounding differences change the gradients slightly and accumulate, so even two runs of FlexLLM under the same load diverge, with a median per-sample loss difference of 0.15. The loss of LayerLoom differs from FlexLLM's by a median of 0.12–0.38 across pairs of runs, which is of the same order, and the per-update curves of all four runs follow the same trend in Fig. 11(b).
In summary, LayerLoom trains exactly like FlexLLM without inference load, and under load its losses deviate from FlexLLM's by the same order as two runs of FlexLLM deviate from each other.
7 DISCUSSION AND FUTURE WORK
Trace-compatible execution. Our prototype runs all systems without Legion tracing, because the per-layer task graphs of LayerLoom change with every scheduling decision. However, since the set of distinct layer graphs is small, i.e., one graph per <inference size, number of backward tasks> combination, each graph could be captured once as a Legion trace and replayed thereafter. We take such trace-compatible execution to raise the throughput of LayerLoom as future work.
More GPUs, models, and kernels. Extending the evaluation to other GPUs, larger models, multi-GPU serving, and LoRA on more projections is also future work. In particular, our shared-weight kernel could be improved by porting it to NVIDIA Hopper and newer GPUs, whose Tensor Memory Accelerator (TMA) and warpgroup-level MMA instructions change how weight tiles are staged and multiplied. We expect the benefit of LayerLoom to hold in these settings. This is because (1) the problem LayerLoom solves, i.e., inference waiting for backward work committed at the start of each iteration, arises from how existing runtimes schedule fine-tuning, not from a particular GPU or model, and (2) LayerLoom profiles its latency model on each target GPU and model, so its scheduler adapts to their speed.
Comparison with GPU preemption. GPU preemption systems (Ng et al., 2023; Chen et al., 2026) reduce the wait of inference by stopping already issued work, whereas LayerLoom largely avoids issuing backward work that would delay inference in the first place. These preemptive approaches are complementary to LayerLoom, and a comparison with them is future work.
8 RELATED WORK
Co-serving inference and fine-tuning. FlexLLM (Oliaro et al., 2026) merges fine-tuning tokens into the inference forward pass and attaches backward work to each serving iteration. Other systems multiplex tuning and serving across GPUs (He et al., 2025), unify multi-LoRA fine-tuning and serving in one virtualized model (Zhang et al., 2025b), harvest idle cycles through fine-grained preemption (Qiao et al., 2026), or suspend backward work at layer boundaries when inference demand appears (Chen et al., 2026). These systems decide when backward work may run or must stop. LayerLoom addresses a complementary question, namely which backward tasks are ready at each layer of an inference iteration, so that inference finds useful fine-tuning work during its forward pass.
GPU sharing and LLM serving. GPU-sharing systems colocate independent jobs (Yu & Chowdhury, 2020; Strati et al., 2024; Zhang et al., 2025a; Wang et al., 2025a) and preempt them at fine granularity (Bai et al., 2020; Han et al., 2022; Ng et al., 2023), but they treat the colocated jobs as independent graphs and cannot share their weights or computation. LLM serving systems reduce inference latency through continuous batching (Yu et al., 2022), paged KV memory (Kwon et al., 2023), chunked prefill (Agrawal et al., 2024), preemptive scheduling (Wu et al., 2026), disaggregation and migration (Zhong et al., 2024; Sun et al., 2024),
layer-level scheduling (Lee et al., 2026), and multi-LoRA batching (Chen et al., 2024; Sheng et al., 2024; Wu et al., 2024; Xue et al., 2026). These techniques are orthogonal to LayerLoom, which inherits the batching of FlexLLM.
Pipelined training and memory reduction. Pipeline-parallel training interleaves microbatches across the stages of several GPUs (Huang et al., 2019; Narayanan et al., 2019). The wavefront of LayerLoom similarly interleaves microbatches, but across the layers of one GPU and clocked by the inference forward pass, and its gradient accumulation with an optimizer barrier gives it the synchronous semantics of GPipe. Activation recomputation (Chen et al., 2016) and offloading (Rhu et al., 2016; Ren et al., 2021) trade computation or host bandwidth for GPU memory, and LayerLoom applies offloading to the wavefront while timing its prefetches with the plan of the scheduler.
9 CONCLUSION
Co-serving LLM inference with LoRA fine-tuning can turn the capacity that bursty inference leaves idle into fine-tuning progress, but existing runtimes fix the backward work before each serving iteration and make new requests wait for it. This paper presented LayerLoom, which instead anchors backward tasks to the inference forward pass at layer granularity. A wavefront of fine-tuning microbatches supplies ready backward tasks in forward layer order, an SLO-aware scheduler decides at every layer how many of them to run, offloading keeps the state of the wavefront off the GPU, and a shared-weight kernel reads each base weight once for both workloads. On an RTX 4090 GPU with the Llama-3.1-8B architecture, LayerLoom achieves 13.5–21.8 points higher joint SLO attainment than FlexLLM with comparable or up to 12% higher fine-tuning throughput, outperforms FlexLLM's temporal and spatial sharing modes, and matches the training losses of FlexLLM without inference load.
REFERENCES
Agrawal, A., Kedia, N., Panwar, A., Mohan, J., Kwatra, N., Gulavani, B., Tumanov, A., and Ramjee, R. Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve. In 18th USENIX Symposium on Operating Systems Design and Implementation, pp. 117–134, 2024.
Bai, Z., Zhang, Z., Zhu, Y., and Jin, X. PipeSwitch: Fast Pipelined Context Switching for Deep Learning Applications. In 14th USENIX Symposium on Operating Systems Design and Implementation, pp. 499–514, 2020.
Bauer, M., Treichler, S., Slaughter, E., and Aiken, A. Legion: Expressing locality and independence with logical regions. In 2012 International Conference for High Per-formance Computing, Networking, Storage and Analysis, pp. 1–11, 2012.
Chen, J., She, J., Yuan, Y., Ghosh, R., Gupta, K., Ho, Q., Liu, X., and Balmau, O. DeltaServe: Host-Agnostic Co-Serving of Inference and Fine-Tuning for LLMs, 2026. arXiv preprint arXiv:2607.28848.
Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., and Krishnamurthy, A. Punica: Multi-Tenant LoRA Serving. In Proceedings of Machine Learning and Systems, volume 6, pp. 1–13, 2024.
Chen, T., Xu, B., Zhang, C., and Guestrin, C. Training Deep Nets with Sublinear Memory Cost, 2016. arXiv preprint arXiv:1604.06174.
Chiang, W.-L., Li, Z., Lin, Z., Sheng, Y., Wu, Z., Zhang, H., Zheng, L., Zhuang, S., Zhuang, Y., Gonzalez, J. E., Stoica, I., and Xing, E. P. Vicuna: An Open-Source Chatbot Impressing GPT-4 with 90%* ChatGPT Quality, 2023.
Han, M., Zhang, H., Chen, R., and Chen, H. Microsecond-scale Preemption for Concurrent GPU-accelerated DNN Inferences. In 16th USENIX Symposium on Operating Systems Design and Implementation, pp. 539–558, 2022.
He, Y., Yang, H., Lu, Y., Klimovic, A., and Alonso, G. Resource Multiplexing in Tuning and Serving Large Language Models. In 2025 USENIX Annual Technical Conference, pp. 1639–1655, 2025.
Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., and Chen, W. LoRA: Low-Rank Adaptation of Large Language Models. In International Conference on Learning Representations, 2022.
Huang, Y., Cheng, Y., Bapna, A., Firat, O., Chen, M. X., Chen, D., Lee, H., Ngiam, J., Le, Q. V., Wu, Y., and Chen, Z. GPipe: Efficient Training of Giant Neural Networks using Pipeline Parallelism. In Advances in Neural Information Processing Systems, volume 32, 2019.
Kwon, W., Li, Z., Zhuang, S., Sheng, Y., Zheng, L., Yu, C. H., Gonzalez, J., Zhang, H., and Stoica, I. Efficient Memory Management for Large Language Model Serving with PagedAttention. In Proceedings of the 29th Symposium on Operating Systems Principles, pp. 611–626, 2023.
Lee, G., Kim, J., Park, J., Lee, Y., and Ahn, J. H. From Tokens to Layers: Redefining Stall-Free Scheduling for MoE Serving with Layered Prefill. In Proceedings of Machine Learning and Systems, volume 8, pp. 398–421, 2026.
Narayanan, D., Harlap, A., Phanishayee, A., Seshadri, V., Devanur, N. R., Ganger, G. R., Gibbons, P. B., and Zaharia, M. PipeDream: generalized pipeline parallelism for DNN training. In Proceedings of the 27th ACM Symposium on Operating Systems Principles, pp. 1–15, 2019.
Ng, K. K. W., Demoulin, H. M., and Liu, V. Paella: Low-latency Model Serving with Software-defined GPU Scheduling. In Proceedings of the 29th Symposium on Operating Systems Principles, pp. 595–610, 2023.
NVIDIA Corporation. Efficient GEMM in CUDA, 2026. NVIDIA CUTLASS Documentation. Accessed October 26, 2026.
Oliaro, G., Miao, X., Cheng, X., Kada, V., Wu, M., Gao, R., Huang, Y., Delacourt, R., Yang, A., Wang, Y., Unger, C., and Jia, Z. FlexLLM: Token-Level Co-Serving of LLM Inference and Finetuning with SLO Guarantees. In 23rd USENIX Symposium on Networked Systems Design and Implementation, pp. 1359–1379, 2026.
Osama, M., Merrill, D., Cecka, C., Garland, M., and Owens, J. D. Stream-K: Work-Centric Parallel Decomposition for Dense Matrix-Matrix Multiplication on the GPU. In Proceedings of the 28th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming, pp. 429–431, 2023.
Qiao, Y., Yu, S., Anzai, S., Ma, H., Yang, S., Wang, Y., Kim, M., Wu, Y., Zhou, Y., Xing, J., Gonzalez, J. E., Stoica, I., and Xu, H. ConServe: Fine-Grained GPU Harvesting for LLM Online and Offline Co-Serving. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pp. 101429–101443, 2026.
Ren, J., Rajbhandari, S., Aminabadi, R. Y., Ruwase, O., Yang, S., Zhang, M., Li, D., and He, Y. ZeRO-Offload: Democratizing Billion-Scale Model Training. In 2021 USENIX Annual Technical Conference, pp. 551–564, 2021.
Rhu, M., Gimelshein, N., Clemons, J., Zulfiqar, A., and Keckler, S. W. vDNN: Virtualized deep neural networks for scalable, memory-efficient neural network design. In 2016 49th Annual IEEE/ACM International Symposium on Microarchitecture, pp. 1–13, 2016.
Sheng, Y., Cao, S., Li, D., Hooper, C., Lee, N., Yang, S., Chou, C., Zhu, B., Zheng, L., Keutzer, K., Gonzalez, J. E., and Stoica, I. SLoRA: Scalable Serving of Thousands of LoRA Adapters. In Proceedings of Machine Learning and Systems, volume 6, pp. 296–311, 2024.
Strati, F., Ma, X., and Klimovic, A. Orion: Interference-aware, Fine-grained GPU Sharing for ML Applications.
In Proceedings of the Nineteenth European Conference on Computer Systems, pp. 1075–1092, 2024.
Sun, B., Huang, Z., Zhao, H., Xiao, W., Zhang, X., Li, Y., and Lin, W. Llumnix: Dynamic Scheduling for Large Language Model Serving. In 18th USENIX Symposium on Operating Systems Design and Implementation, pp. 173–191, 2024.
Tassiulas, L. and Ephremides, A. Stability properties of constrained queueing systems and scheduling policies for maximum throughput in multihop radio networks. IEEE Transactions on Automatic Control, 37(12):1936–1948, 1992.
Wang, J., Wang, Y., Han, M., and Chen, R. Colocating ML Inference and Training with Fast GPU Memory Handover. In 2025 USENIX Annual Technical Conference, pp. 1657–1675, 2025a.
Wang, Y., Chen, Y., Li, Z., Kang, X., Fang, Y., Zhou, Y., Zheng, Y., Tang, Z., He, X., Guo, R., Wang, X., Wang, Q., Zhou, A. C., and Chu, X. BurstGPT: A Real-World Workload Dataset to Optimize LLM Serving Systems. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2, pp. 5831–5841, 2025b.
Wu, B., Zhu, R., Zhang, Z., Sun, P., Liu, X., and Jin, X. dLoRA: Dynamically Orchestrating Requests and Adapters for LoRA LLM Serving. In 18th USENIX Symposium on Operating Systems Design and Implementation, pp. 911–927, 2024.
Wu, B., Zhong, Y., Zhang, Z., Liu, S., Liu, F., Sun, Y., Huang, G., Liu, X., and Jin, X. FastServe: Iteration-Level Preemptive Scheduling for Large Language Model Inference. In 23rd USENIX Symposium on Networked Systems Design and Implementation, pp. 57–74, 2026.
Xue, C., Pan, Y., Cui, W., Chen, Q., Zhang, S., He, B., and Guo, M. MuxTune: Efficient Multi-Task LLM Fine-Tuning in Multi-Tenant Datacenters via Spatial-Temporal Backbone Multiplexing. In 23rd USENIX Symposium on Networked Systems Design and Implementation, pp. 1533–1552, 2026.
Yu, G.-I., Jeong, J. S., Kim, G.-W., Kim, S., and Chun, B.-G. Orca: A Distributed Serving System for Transformer-Based Generative Models. In 16th USENIX Symposium on Operating Systems Design and Implementation, pp. 521–538, 2022.
Yu, P. and Chowdhury, M. Fine-Grained GPU Sharing Primitives for Deep Learning Applications. In Proceedings of Machine Learning and Systems, volume 2, pp. 98–111, 2020.
Zhang, S., Chen, Q., Cui, W., Zhao, H., Xue, C., Zheng, Z., Lin, W., and Guo, M. Improving GPU Sharing Performance through Adaptive Bubbleless Spatial-Temporal Sharing. In Proceedings of the Twentieth European Conference on Computer Systems, pp. 573–588, 2025a.
Zhang, Y., Du, H., Cao, C., and Xu, J. Loquetier: A Virtualized Multi-LoRA Framework for Unified LLM Fine-tuning and Serving. In Advances in Neural Information Processing Systems, volume 38, pp. 65600–65625, 2025b.
Zhong, Y., Liu, S., Chen, J., Hu, J., Zhu, Y., Liu, X., Jin, X., and Zhang, H. DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving. In 18th USENIX Symposium on Operating Systems Design and Implementation, pp. 193–210, 2024.