MoE模型在中等批量下用推测解码可实现超2倍加速。
MoESD: Unveil Speculative Decoding's Potential for Accelerating Sparse MoE

- 提出新方法让稀疏MoE模型利用推测解码加速推理
- 在中等批量下实现最高2.29倍加速,理论与实验一致
- 引入'目标效率'指标,帮助识别加速瓶颈,适合部署优化者
大型语言模型(LLM)在众多应用中取得显著进展,其中专家混合(MoE)模型展现出巨大潜力。相比传统稠密模型,MoE可在更低计算量下实现更好性能。推测解码(SD)是一种广泛使用的无精度损失推理加速技术,但以往被认为仅对稠密模型有效。本文首次证明,在中等批量条件下,MoE反而比稠密模型更受益于SD;随着MoE变得愈发稀疏(当前主流趋势),SD有效加速的批量范围也更广。为定量分析SD中的权衡,我们基于理论推导建立了可靠模型。尽管现有研究多关注提升接受率,但工作负载与模型结构变化仍可能导致加速效果下降,即使接受率很高。为此,我们提出新指标‘目标效率’,全面刻画此类影响,助力研究人员定位系统瓶颈。针对私有部署等场景,本工作揭示了加速MoE推理的新路径,现有方案在此面临挑战。不同GPU上的实验表明,Qwen2-57B-A14B在中等批量下最高可提速2.29倍,并验证了理论预测。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have achieved remarkable success across many applications, with Mixture of Experts (MoE) models demonstrating great potential. Compared to traditional dense models, MoEs achieve better performance with less computation. Speculative decoding (SD) is a widely used technique to accelerate LLM inference without accuracy loss, but it has been considered efficient only for dense models. In this work, we first demonstrate that, under medium batch sizes, MoE surprisingly benefits more from SD than dense models. Furthermore, as MoE becomes sparser -- the prevailing trend in MoE designs -- the batch size range where SD acceleration is expected to be effective becomes broader. To quantitatively understand tradeoffs involved in SD, we develop a reliable modeling based on theoretical analyses. While current SD research primarily focuses on improving acceptance rates of algorithms, changes in workload and model architecture can still lead to degraded SD acceleration even with high acceptance rates. To address this limitation, we introduce a new metric 'target efficiency' that characterizes these effects, thus helping researchers identify system bottlenecks and understand SD acceleration more comprehensively. For scenarios like private serving, this work unveils a new perspective to speed up MoE inference, where existing solutions struggle. Experiments on different GPUs show up to 2.29x speedup for Qwen2-57B-A14B at medium batch sizes and validate our theoretical predictions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。