推理优先,训练在后:基于LayerLoom的层粒度LoRA协同服务
Inference First, Training Underneath: Layer-Granular LoRA Co-Serving with LayerLoom
AI总结:
该研究提出LayerLoom,将LoRA微调反向传播按层粒度调度附加到推理前向,在RTX 4090上使Llama-3.1-8B的联合SLO达成率提升13.5-21.8%,微调吞吐量相当或更高。
摘要:
在同一GPU上同时服务和微调大语言模型,可利用推理突发间隙的空闲算力进行训练,而低秩适配(LoRA)使这种协同部署成本低廉,因为两种工作负载共享同一冻结的基础权重副本。难点在于微调的反向传播,这在推理中没有对应环节。当前协同服务系统按每次服务迭代调度反向传播工作:每次迭代有固定的反向传播预算,期间到达的请求需等待其完成,因此当负载激增时,微调会决定推理延迟。我们发现,LoRA微批次的反向传播可分解为推理前向传播访问的相同权重上的层级任务,这允许按层而非迭代粒度调度反向传播工作。基于此观察,LayerLoom将同层反向传播任务附加到推理前向传播,在每层仅运行与在途请求的延迟 slack 允许的数量。为在每层保持就绪任务,LayerLoom维护跨层交错的微调微批次波前,并通过将微批次状态卸载到主机内存并在调度器计划使用的层之前预取,限制波前的激活内存。融合内核通过单次读取每个基础权重为配对的前向和反向GEMM提供服务。由于迭代的所有反向传播工作在其前向传播内完成,新请求可如连续批处理般加入下一次迭代。在运行Llama-3.1-8B的RTX 4090 GPU上,基于突发生产轨迹,LayerLoom较现有工作将联合服务水平目标(SLO)达成率提升13.5-21.8个百分点,微调吞吐量相当或高达12%,且达到相同的训练损失。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。