Optimizing Mixture-of-Experts Inference Time Combining Model Deployment and Communication Scheduling

Jialong Li, Shreyansh Tripathi, Lakshay Rastogi, Yiming Lei, Rui Pan, Yiting XiaarXiv 2024

Abstract

As machine learning models scale in size and complexity, their computational requirements become a significant barrier. Mixture-of-Experts (MoE) models alleviate this issue by selectively activating relevant experts. Despite this, MoE models are hindered by high communication overhead from all-to-all operations, low GPU utilization due to the synchronous communication constraint, and complications from heterogeneous GPU environments. This paper presents Aurora, which optimizes both model deployment and all-to-all communication scheduling to address these challenges in MoE inference. Aurora achieves minimal communication times by strategically ordering token transmissions in all-to-all communications. It improves GPU utilization by colocating experts from different models on the same device, avoiding the limitations of synchronous all-to-all communication. We analyze Aurora's optimization strategies theoretically across four common GPU cluster settings: exclusive vs. colocated models on GPUs, and homogeneous vs. heterogeneous GPUs. Aurora provides optimal solutions for three cases, and for the remaining NP-hard scenario, it offers a polynomial-time sub-optimal solution with only a 1.07x degradation from the optimal. Aurora is the first approach to minimize MoE inference time via optimal model deployment and communication scheduling across various scenarios. Evaluations demonstrate that Aurora significantly accelerates inference, achieving speedups of up to 2.38x in homogeneous clusters and 3.54x in heterogeneous environments. Moreover, Aurora enhances GPU utilization by up to 1.5x compared to existing methods.

Introduction

Mixture-of-Experts (MoE) models have emerged as a powerful architecture for scaling Large Language Models (LLMs) efficiently. By selectively activating only a small subset of "experts" for each input token, they decouple model capacity from computational cost. However, this efficiency is often offset by significant communication overhead. During inference, tokens must be routed to their assigned experts across different GPUs, necessitating intensive "all-to-all" communication phases that frequently become the primary performance bottleneck.

The MoE Inference Bottleneck

The standard MoE inference pipeline consists of four main stages: the Gating network, a first all-to-all communication phase, Feed-Forward Network (FFN) computation by experts, and a second all-to-all communication phase for aggregation.

The MoE inference pipeline, illustrating the critical all-to-all communication phases between GPUs.

As illustrated in Figure 1, the all-to-all phases require tokens to be shuffled across the network. This process suffers from three major issues:

  1. Network Contention: Uneven token distributions lead to bandwidth bottlenecks.
  2. Low GPU Utilization: Synchronous barriers force GPUs to sit idle while waiting for network transfers to complete.
  3. Hardware Heterogeneity: Real-world clusters often mix different GPU generations, making uniform load balancing ineffective.

The Aurora Framework

Aurora addresses these bottlenecks by treating model deployment (expert placement) and communication scheduling (token transmission order) as a joint optimization problem. The goal is to minimize total inference time by maximizing the overlap between computation and communication.

Overview of the Aurora framework, showing optimization strategies and results across four deployment scenarios.

As shown in Figure 2, Aurora provides a comprehensive solution for four distinct cluster settings. It introduces several key innovations:

  • Cross-Model Expert Colocation: Unlike traditional methods that pack experts from the same model together, Aurora colocates experts from different models. This allows one model to utilize the GPU for computation while another utilizes the network, effectively "hiding" communication latency.
  • Optimal Communication Scheduling: Aurora employs a polynomial-time algorithm to order token transmissions, ensuring that bandwidth contention at the receivers is minimized.
  • Heterogeneity-Aware Assignment: In clusters with mixed GPU types, Aurora strategically assigns the most "popular" (high-load) experts to the most powerful hardware.

Key Results and Insights

Aurora was evaluated using production MoE traces and realistic token distributions. The system demonstrated significant performance gains:

  • Inference Speedup: Aurora achieved up to 2.38× speedup in homogeneous clusters and 3.54× speedup in heterogeneous environments compared to standard baselines.
  • GPU Utilization: By interleaving computation and communication across different models, Aurora improved GPU utilization by up to 1.5× over state-of-the-art solutions like Lina.
  • Robustness: The framework proved resilient to real-world variability; even with 75% noise in traffic statistics, performance only degraded by 15.8%.

Conclusion

Aurora represents a significant advancement in MoE inference optimization. By co-optimizing deployment and scheduling, it overcomes the inherent synchronization and communication barriers of MoE architectures. Its ability to provide near-optimal solutions in heterogeneous environments makes it particularly valuable for modern, diverse data center infrastructures.

Summary updated

BibTeX
@misc{li2024optimizing,
  author = {Jialong Li and Shreyansh Tripathi and Lakshay Rastogi and Yiming Lei and Rui Pan and Yiting Xia},
  title = {{Optimizing Mixture-of-Experts Inference Time Combining Model Deployment and Communication Scheduling}},
  year = {2024},
  eprint = {2410.17043},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.17043},
}
Figure