Accelerating MoE Model Inference with Expert Sharding

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Balmau, Oana, Kermarrec, Anne-Marie, Pires, Rafael, Santo, André Loureiro Espírito, de Vos, Martijn, Vujasinovic, Milos
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866912270010810368
author Balmau, Oana
Kermarrec, Anne-Marie
Pires, Rafael
Santo, André Loureiro Espírito
de Vos, Martijn
Vujasinovic, Milos
author_facet Balmau, Oana
Kermarrec, Anne-Marie
Pires, Rafael
Santo, André Loureiro Espírito
de Vos, Martijn
Vujasinovic, Milos
contents Mixture of experts (MoE) models achieve state-of-the-art results in language modeling but suffer from inefficient hardware utilization due to imbalanced token routing and communication overhead. While prior work has focused on optimizing MoE training and decoder architectures, inference for encoder-based MoE models in a multi-GPU with expert parallelism setting remains underexplored. We introduce MoEShard, an inference system that achieves perfect load balancing through tensor sharding of MoE experts. Unlike existing approaches that rely on heuristic capacity factors or drop tokens, MoEShard evenly distributes computation across GPUs and ensures full token retention, maximizing utilization regardless of routing skewness. We achieve this through a strategic row- and column-wise decomposition of expert matrices. This reduces idle time and avoids bottlenecks caused by imbalanced expert assignments. Furthermore, MoEShard minimizes kernel launches by fusing decomposed expert computations, significantly improving throughput. We evaluate MoEShard against DeepSpeed on encoder-based architectures, demonstrating speedups of up to 6.4$\times$ in time to first token (TTFT). Our results show that tensor sharding, when properly applied to experts, is a viable and effective strategy for efficient MoE inference.
format Preprint
id arxiv_https___arxiv_org_abs_2503_08467
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Accelerating MoE Model Inference with Expert Sharding
Balmau, Oana
Kermarrec, Anne-Marie
Pires, Rafael
Santo, André Loureiro Espírito
de Vos, Martijn
Vujasinovic, Milos
Machine Learning
Artificial Intelligence
Distributed, Parallel, and Cluster Computing
Mixture of experts (MoE) models achieve state-of-the-art results in language modeling but suffer from inefficient hardware utilization due to imbalanced token routing and communication overhead. While prior work has focused on optimizing MoE training and decoder architectures, inference for encoder-based MoE models in a multi-GPU with expert parallelism setting remains underexplored. We introduce MoEShard, an inference system that achieves perfect load balancing through tensor sharding of MoE experts. Unlike existing approaches that rely on heuristic capacity factors or drop tokens, MoEShard evenly distributes computation across GPUs and ensures full token retention, maximizing utilization regardless of routing skewness. We achieve this through a strategic row- and column-wise decomposition of expert matrices. This reduces idle time and avoids bottlenecks caused by imbalanced expert assignments. Furthermore, MoEShard minimizes kernel launches by fusing decomposed expert computations, significantly improving throughput. We evaluate MoEShard against DeepSpeed on encoder-based architectures, demonstrating speedups of up to 6.4$\times$ in time to first token (TTFT). Our results show that tensor sharding, when properly applied to experts, is a viable and effective strategy for efficient MoE inference.
title Accelerating MoE Model Inference with Expert Sharding
topic Machine Learning
Artificial Intelligence
Distributed, Parallel, and Cluster Computing
url https://arxiv.org/abs/2503.08467