通过分拆专家模块降低大模型推理成本,适合突发负载的云函数部署。
Remoe: Towards Efficient and Low-Cost MoE Inference in Serverless Computing
- 将专家模块分配到CPU或独立云函数,减少内存占用。
- 实验显示推理成本降低57%,冷启动延迟减少47%。
- 适合追求低成本、高弹性部署的大模型服务场景。
混合专家(MoE)因其稀疏激活机制成为大语言模型主流架构,能有效扩展模型容量。同时,具备弹性伸缩和按使用计费特性的无服务器计算,非常适合部署具有突发性负载的MoE模型。然而,由于专家数量庞大,参数缓存导致推理成本高昂,且受输入依赖的专家激活模式影响,单纯模型分割难以缓解此问题。为此,我们提出Remoe,一种面向无服务器计算的异构MoE推理系统。Remoe将非专家模块部署于GPU,专家模块部署于CPU,进一步将低频激活的专家卸载至独立的无服务器函数,以降低内存开销并实现并行执行。我们引入三项关键技术:(1) 基于输入语义相似性的相似提示搜索(SPS)算法,用于预测专家激活模式;(2) 主模型预分配(MMP)算法,基于最坏情况估计确保服务等级目标(SLO);(3) 联合内存与副本优化框架,结合拉格朗日对偶与最长处理时间(LPT)算法。我们在Kubernetes上实现Remoe,并在多个大语言模型基准测试中评估。结果表明,相较于现有最佳基线,Remoe推理成本最高降低57%,冷启动延迟减少47%。
原文摘要 · Abstract (English)
Mixture-of-Experts (MoE) has become a dominant architecture in large language models (LLMs) due to its ability to scale model capacity via sparse expert activation. Meanwhile, serverless computing, with its elasticity and pay-per-use billing, is well-suited for deploying MoEs with bursty workloads. However, the large number of experts in MoE models incurs high inference costs due to memory-intensive parameter caching. These costs are difficult to mitigate via simple model partitioning due to input-dependent expert activation. To address these issues, we propose Remoe, a heterogeneous MoE inference system tailored for serverless computing. Remoe assigns non-expert modules to GPUs and expert modules to CPUs, and further offloads infrequently activated experts to separate serverless functions to reduce memory overhead and enable parallel execution. We incorporate three key techniques: (1) a Similar Prompts Searching (SPS) algorithm to predict expert activation patterns based on semantic similarity of inputs; (2) a Main Model Pre-allocation (MMP) algorithm to ensure service-level objectives (SLOs) via worst-case memory estimation; and (3) a joint memory and replica optimization framework leveraging Lagrangian duality and the Longest Processing Time (LPT) algorithm. We implement Remoe on Kubernetes and evaluate it across multiple LLM benchmarks. Experimental results show that Remoe reduces inference cost by up to 57% and cold start latency by 47% compared to state-of-the-art baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。