arXiv:2503.04398cs.LGcs.AI2025-03被引 10

通过模型数据协同调度,大幅减少MoE推理中的通信开销。

Semantic Parallelism: Redefining Efficient MoE Inference via Model-Data Co-Scheduling

  • 将专家与激活令牌共同调度到同一设备,减少跨设备通信。
  • 离线预调度专家集群,线上动态重批请求与重新分配令牌。
  • 适用于大规模MoE模型推理,提升推理吞吐量。

当前大型语言模型服务引擎采用专家并行(EP)实现大规模MoE模型的多设备推理,但其效率受限于设备间通信开销,因EP需使用昂贵的all-to-all通信来路由不在同一设备上的令牌至远程专家。现有方案将专家部署与请求/令牌调度视为独立问题,导致频繁通信、降低效率。本文提出语义并行(Semantic Parallelism),一种新型并行范式,通过模型-数据协同调度最小化EP架构下的通信成本。我们构建了Sem-MoE框架:(1) 离线模型调度,基于输入类别间的共激活倾向预先聚类并部署专家;(2) Attention-DP场景下的在线请求级调度,将请求重批至最可能激活对应专家的设备;(3) Attention-TP场景下的在线请求内调度,无缝融合令牌重排至原推理流水线,主动调整令牌分布以减少分散远程路由。我们将Sem-MoE集成至主流推理引擎SGLANG,实验表明该协同调度方法显著降低EP中的all-to-all通信量,相较现有方案实现更高推理吞吐量。

原文摘要 · Abstract (English)

Prevailing LLM serving engines employ expert parallelism (EP) to implement multi-device inference of massive MoE models. However, the efficiency of expert parallel inference is largely bounded by inter-device communication, as EP embraces expensive all-to-all collectives to route tokens to the remote experts if not collocating on the same GPU/NPU device. Nevertheless, state-of-the-art schemes treat expert device-placement and request (or token) device-scheduling as separate concerns, triggering excessive communication between them and compromising inference efficiency This paper proposes Semantic Parallelism, a novel parallelism paradigm that minimizes the steep communication costs in EP-centric MoE serving via model-data collaborative scheduling. We implement Semantic Parallelism in a framework called Sem-MoE. Sem-MoE maximally collocates experts and their activating tokens onto the same device using proactively modeled activation likelihood between them and introduces three key techniques: (1) Offline model scheduling, which preliminarily clusters and collocates experts onto devices based on their co-activation tendencies for certain classes of input. (2) Online inter-request data scheduling for Attention-DP setups, which proactively rebatches incoming requests onto the device that hosts experts most likely and frequently activated by the corresponding requests. (3) Online intra-request data scheduling for Attention-TP setups, which seamlessly fuses a token reshuffling procedure into the original inference pipeline and proactively reschedules tokens to devices to reduce dispersed remote routing. We build Sem-MoE into a prevailing LLM serving engine SGLANG. Experiments show our collaborative scheduling approach can effectively reduce the all-to-all communication volume in EP and achieve superior inference throughput compared to existing solutions.

MoE推理优化并行调度

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