arXiv:2410.17954cs.AIcs.CL2024-10中稿 · DAC'26, Mixture-of…被引 7

通过预测专家使用和动态调度,显著降低MoE模型显存占用。

ExpertFlow: Efficient Mixture-of-Experts Inference via Predictive Expert Caching and Token Scheduling

  • 用Transformer预测各层专家使用情况,一次前向计算完成路由预估。
  • 按相似路由分组令牌,提升专家利用率,减少重复加载。
  • 动态缓存只加载必要专家,运行时修正错误预测,适合单卡部署。

稀疏混合专家(MoE)模型在相同计算量下可超越密集大语言模型,因其每令牌仅激活少量专家。然而,叠加多个专家模块带来巨大参数内存开销,导致在单GPU等内存受限环境难以部署。离线存储机制虽可缓解问题,但现有方法存在局限:静态缓存忽略输入依赖的路由行为,而提前训练专用模型预测专家使用则常不准确或需高昂训练成本。本文提出ExpertFlow,一个轻量级MoE推理系统,包含三个协同组件:1)基于Transformer的路由路径预测器,在单次前向传播中估计所有MoE层的专家使用;2)令牌调度器,将具有相似预测路由的令牌分组以提高专家利用率;3)预测性专家缓存,仅加载所需专家并运行时纠正误判。三者结合实现高效专家加载与执行,在单张GPU上相较强基线将显存使用降低高达93.72%,推理吞吐提升最高达10倍。

原文摘要 · Abstract (English)

Sparse Mixture-of-Experts (MoE) models can outperform dense large language models at similar computation by activating only a small set of experts per token. However, stacking many expert modules introduces substantial parameter memory, which makes MoE models difficult to deploy in memory-constrained environments such as single-GPU devices. Offloading alleviates this issue by storing inactive experts in CPU memory and loading them on demand, but existing methods remain limited: static caches disregard input-dependent routing, and methods that train separate models to predict expert usage ahead of time are often inaccurate or require significant training cost. We propose ExpertFlow, a lightweight MoE inference system that addresses this routing dependency through three coordinated components: 1) a transformer-based routing path predictor that estimates expert usage across all MoE layers in a single forward pass, 2) a token scheduler that groups tokens with similar predicted routes to improve expert utilization, and 3) a predictive expert cache that loads only the required experts while correcting mispredictions at runtime. Together, these components enable efficient expert loading and execution, reducing GPU memory usage by up to 93.72% and improving inference throughput by up to 10x over strong offloading baselines on a single GPU.

MoE推理优化缓存调度

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。