EpiLoRA:将多个LoRA适配器融合为低精度通用矩阵乘法以用于服务与强化学习
EpiLoRA: Fusing Many LoRA Adapters into Low-Precision GEMMs for Serving and RL
AI总结:
EpiLoRA是vLLM引擎的插件,通过将多个LoRA适配器融合为低精度GEMM,在单适配器下解码速度优于vLLM、SGLang等,多租户下吞吐量更高,还支持27B模型在单48GB GPU上的LoRA强化学习训练。
摘要:
低秩适配器(LoRA)使一个基础模型能够服务多个微调变体:多租户引擎保留一份基础模型副本,并对每个租户拥有各自适配器的请求进行批处理。随着基础模型转向8位(FP8)和4位格式,它们的通用矩阵乘法(GEMM)变得更高效,但适配器并非如此:引擎将它们作为独立的小型GPU内核与GEMM并行运行,其延迟在每个解码步骤中所占比例越来越大。适配器会将其输入下投影至低秩后再上投影,我们的关键发现是,GEMM仅在其尾声阶段(即写入输出的最终阶段)需要下投影。因此,作为vLLM引擎插件的EpiLoRA会先启动下投影,再将低精度GEMM作为依赖内核启动,该内核会同时流式传输其权重,并在其尾声阶段添加每个租户的上投影。在NVIDIA Hopper GPU上,对于单个适配器,EpiLoRA的每token解码时间比vLLM最快配置低达24%,且比SGLang和TensorRT-LLM更快;对于多租户,在我们测试的大多数GPU-模型对中,其适配器内核的吞吐量高于vLLM。该低精度基础模型还可用于训练:在引擎的FP8权重上计算的LoRA强化学习训练器无需16位副本,因此27B模型可在一块48GB GPU上训练,而随后将激活值保持为16位的引擎消除了生成训练数据的模型与被训练模型之间的大部分剩余不匹配。
英文摘要:
Low-rank adapters (LoRA) let one base model serve many fine-tuned variants: multi-tenant engines keep a single copy of the base and batch the requests of many tenants, each with its own adapter. As base models move to 8-bit (FP8) and 4-bit formats, their general matrix multiplications (GEMMs) become cheaper, but the adapters do not: engines run them as separate small GPU kernels beside the GEMM, whose latency takes a growing share of every decoding step. An adapter projects its input down to a low rank and back up, and our key observation is that the GEMM needs the down-projection only in its epilogue, the final stage in which it writes its output. EpiLoRA, a plugin for the vLLM engine, therefore launches the down-projection first and the low-precision GEMM as a dependent kernel that streams its weights meanwhile and adds every tenant's up-projection in its epilogue. On NVIDIA Hopper GPUs, EpiLoRA decodes for a single adapter with up to 24% lower time per token than vLLM's fastest configuration, and faster than SGLang and TensorRT-LLM; with many tenants, its adapter kernels deliver more throughput than vLLM's on most GPU-model pairs we tested. The same low-precision base also trains: a LoRA reinforcement-learning trainer that computes on the engine's FP8 weights needs no 16-bit copy, so a 27B model trains on one 48 GB GPU, and an engine that then keeps activations in 16 bits removes most of the remaining mismatch between the model generating training data and the one trained.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。