arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.05066cs.LGcs.AIcs.CL
收藏

容量感知推理:减轻混合专家中的滞后效应

Capacity-Aware Inference: Mitigating the Straggler Effect in Mixture of Experts

University of Maryland, College Park(马里兰大学学院公园分校);The Hong Kong University of Science and Technology (Guangzhou)(香港科学与技术大学(广州))

Shwai He, Weilin Cai, Jiayi Huang, Ang Li

AI总结:

本文提出容量感知令牌丢弃和扩展丢弃方法,通过减少专家负载不平衡提升混合专家模型的推理效率和性能。

摘要:

混合专家(MoE)是一种通过稀疏专家激活来平衡性能和效率的扩展大语言模型的有效架构。然而,在专家并行性下,MoE因令牌到专家分配不平衡而面临推理效率低下问题,其中负载低的专家完成计算后必须等待负载高的专家,导致全局延迟。我们定义这种现象为\textbf{\textit{滞后效应}},因为最负担的专家决定了整体推理延迟。为解决此问题,我们首先提出\textit{\textbf{容量感知令牌丢弃}},通过丢弃超载专家的多余令牌来强制专家容量限制,有效减少负载不平衡,对性能影响极小(例如,OLMoE上实现30%的加速,仅0.9%的性能下降)。接着,鉴于存在负载低的专家仍远低于容量阈值,我们引入\textit{\textbf{容量感知扩展丢弃}},允许令牌在强制严格本地容量约束前包含额外的本地专家在候选集中,从而改善负载平衡并提升未充分利用专家的利用率。在语言和多模态MoE模型上的广泛实验验证了我们方法的有效性,实现了专家利用率、模型性能和推理效率的显著提升,例如将Expanded Drop应用于Mixtral-8×7B-Instruct可获得0.2%的平均性能提升和1.85×的推理加速。代码已发布于:https://github.com/CASE-Lab-UMD/Capacity-Aware-MoE。

英文摘要:

The Mixture of Experts (MoE) is an effective architecture for scaling large language models by leveraging sparse expert activation to balance performance and efficiency. However, under expert parallelism, MoE suffers from inference inefficiencies due to imbalanced token-to-expert assignment, where underloaded experts complete computations early but must wait for overloaded experts, leading to global delays. We define this phenomenon as the \textbf{\textit{Straggler Effect}}, as the most burdened experts dictate the overall inference latency. To address this, we first propose \textit{\textbf{Capacity-Aware Token Drop}}, which enforces expert capacity limits by discarding excess tokens from overloaded experts, effectively reducing load imbalance with minimal performance impact (e.g., $30\%$ speedup with only $0.9\%$ degradation on OLMoE). Next, given the presence of low-load experts remaining well below the capacity threshold, we introduce \textit{\textbf{Capacity-Aware Expanded Drop}}, which allows tokens to include additional local experts in their candidate set before enforcing strict local capacity constraints, thereby improving load balance and enhancing the utilization of underused experts. Extensive experiments on both language and multimodal MoE models demonstrate the effectiveness of our approach, yielding substantial gains in expert utilization, model performance, and inference efficiency, e.g., applying Expanded Drop to Mixtral-8$\times$7B-Instruct yields a {0.2\%} average performance improvement and a {1.85$\times$} inference speedup. The code is released at: https://github.com/CASE-Lab-UMD/Capacity-Aware-MoE.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑