Skip to main content
QUICK REVIEW

[Paper Review] Tutel: Adaptive Mixture-of-Experts at Scale

Chang Ho Hwang, Wei Cui|arXiv (Cornell University)|Jun 7, 2022
Advanced Neural Network ApplicationsComputer Science31 citations
TL;DR

Tutel introduces a zero-cost-switch adaptive parallelism and pipelining framework for sparse MoE models, achieving significant speedups at scale while maintaining algorithmic equivalence to existing MoE formulations.

ABSTRACT

Sparsely-gated mixture-of-experts (MoE) has been widely adopted to scale deep learning models to trillion-plus parameters with fixed computational cost. The algorithmic performance of MoE relies on its token routing mechanism that forwards each input token to the right sub-models or experts. While token routing dynamically determines the amount of expert workload at runtime, existing systems suffer inefficient computation due to their static execution, namely static parallelism and pipelining, which does not adapt to the dynamic workload. We present Flex, a highly scalable stack design and implementation for MoE with dynamically adaptive parallelism and pipelining. Flex designs an identical layout for distributing MoE model parameters and input data, which can be leveraged by all possible parallelism or pipelining methods without any mathematical inequivalence or tensor migration overhead. This enables adaptive parallelism/pipelining optimization at zero cost during runtime. Based on this key design, Flex also implements various MoE acceleration techniques. Aggregating all techniques, Flex finally delivers huge speedup at any scale -- 4.96x and 5.75x speedup of a single MoE layer over 16 and 2,048 A100 GPUs, respectively, over the previous state-of-the-art. Our evaluation shows that Flex efficiently and effectively runs a real-world MoE-based model named SwinV2-MoE, built upon Swin Transformer V2, a state-of-the-art computer vision architecture. On efficiency, Flex accelerates SwinV2-MoE, achieving up to 1.55x and 2.11x speedup in training and inference over Fairseq, respectively. On effectiveness, the SwinV2-MoE model achieves superior accuracy in both pre-training and down-stream computer vision tasks such as COCO object detection than the counterpart dense model, indicating the readiness of Flex for end-to-end real-world model training and inference.

Motivation & Objective

  • Explain why MoE workloads are dynamic and challenging at exascale due to token routing and uneven expert workloads.
  • Propose a zero-overhead adaptive parallelism switching mechanism to unify and switch between DP, EP+DP+MP, and related configurations.
  • Develop adaptive pipelining and All-to-All strategies (including 2DH) that jointly optimize computation and communication.
  • Provide a practical, framework-agnostic MoE system (Tutel) with dynamic capacity factors and dynamic top-k routing support.
  • Demonstrate scalability and real-world effectiveness using SwinV2-MoE on large GPU clusters.

Proposed method

  • Analyze the dynamic workload characteristics of MoE layers and the impact on parallelism choices.
  • Derive a minimal, yet complete, set of parallelism strategies (DP and EP+DP+MP) necessary for optimal performance across configurations.
  • Introduce zero-cost switchable parallelism that reframes data layout so transitions incur O(1) overhead.
  • Develop adaptive pipelining that jointly selects pipelining degree and All-to-All algorithm (Linear vs 2DH) based on workload.
  • Build a dictionary (hash-map) of optimal parallelism/pipelining settings across capacity ranges to enable fast runtime decisions.
  • Implement fast encode/decode with sparse computation and Flexible All-to-All to reduce memory and communication overhead.

Experimental results

Research questions

  • RQ1How does MoE workload vary with training dynamics and capacity factor, and what are the implications for static vs dynamic parallelism?
  • RQ2Can we achieve zero-cost switching between parallelism strategies while preserving identical data layouts and algorithmic correctness?
  • RQ3What combination of data-parallel, model-parallel, and expert-parallel strategies yields best throughput under dynamic MoE workloads, and how can we adapt it at runtime?
  • RQ4How can adaptive pipelining and All-to-All algorithms (Linear vs 2DH) be jointly optimized to maximize throughput for MoE models at scale?
  • RQ5What are the practical performance gains of Tutel on real-world MoE models like SwinV2-MoE in training and inference?

Key findings

  • Tutel achieves up to 4.96x speedup for a single MoE layer over 16 GPUs and 5.75x over 2,048 GPUs compared with previous state-of-the-art.
  • End-to-end SwinV2-MoE training shows up to 1.55x speedup (training) and 2.11x speedup (inference) over Fairseq.
  • Adaptive parallelism switching (via DP and EP+DP+MP) provides throughput benefits that depend on capacity factor f, outperforming static strategies in diverse settings.
  • Adaptive pipelining yields improvements ranging from 9% to over 100% on average across 243 MoE model settings, with up to 599% improvement in worst-case scenarios.
  • Flexible All-to-All and fast encode/decode techniques reduce memory usage and improve throughput, enabling scalable sparse MoE implementations on large GPU clusters.
  • SwinV2-MoE with Tutel achieves superior accuracy on downstream CV tasks (e.g., COCO) compared to the dense baseline, indicating practical effectiveness of the approach.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.