arXiv:2502.06643cs.LGcs.DC2025-02被引 39

优化专家模型部署,降低延迟并提升推理效率。

MoETuner: Optimized Mixture of Expert Serving with Balanced Expert Placement and Token Routing

  • 用整数规划联合优化专家分配、通信与计算开销。
  • 单机和多机推理分别提速9.3%和17.5%。
  • 适合大规模MoE模型的生产部署与高性能推理场景。

Mixture-of-Experts (MoE) 模型架构因其稀疏激活特性,在提升模型容量的同时降低了计算成本,成为高效扩展Transformer模型的有力方案。然而,随着模型规模扩大,需将MoE模型分布到多个GPU上,面临内存占用大带来的性能瓶颈。专家并行虽能分担负载,但存在令牌路由不均与专家激活失衡问题,导致通信尾延迟和处理效率下降。现有方法未能同时解决负载不均与通信偏斜两大挑战。本文提出基于整数线性规划(ILP)的专家放置优化方法,综合考虑令牌负载、通信与计算成本。利用层间令牌路由依赖性——某一层中路由至特定专家的令牌,在下一层通常仅路由至有限专家集合——实现更优的专家-设备分配。所提方法MoETuner可最小化跨GPU令牌传输成本,平衡各设备上的处理负载,从而降低尾延迟与端到端执行时间。实验表明,单节点与多节点推理分别获得9.3%与17.5%的端到端加速,验证了该优化在下一代MoE模型中的潜力。

原文摘要 · Abstract (English)

Mixture-of-Experts (MoE) model architecture has emerged as a promising solution for scaling transformer models efficiently, offering sparse activation that reduces computational costs while increasing model capacity. However, as MoE models scale, they need to be distributed across GPU devices, thus face critical performance bottlenecks due to their large memory footprint. Expert parallelism distributes experts across GPUs, however, faces key challenges including an unbalanced token routing and expert activation, resulting in communication tail latency and processing inefficiencies. While existing solutions address some of these issues, they fail to resolve the dual challenges of load imbalance and communication skew. The imbalance in token processing load across experts causes uneven processing times on different GPUs, while communication skew between GPUs leads to unbalanced inter-GPU data transfers. These factors degrade the performance of MoE models by increasing tail latency and reducing overall throughput. To address these limitations, we propose an Integer Linear Programming (ILP) formulation to optimize expert placement by jointly considering token load, communication, and computation costs. We exploit the property that there is a token routing dependency across layers, where tokens routed to a specific expert in one layer are likely to be routed to a limited set of experts in the subsequent layer. Our solution, MoETuner, offers an optimal expert-to-GPU assignment that minimizes inter-GPU token routing costs and balances token processing across devices, thereby reducing tail latency and end-to-end execution time. Experimental results demonstrate 9.3% and 17.5% of end-to-end speedups for single-node and multi-node inference respectively, showcasing the potential of our ILP-based optimization for offering expert parallel solutions for next-generation MoEs.

MoE模型专家并行推理优化整数规划

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