Tutel: Adaptive Mixture-of-Experts at Scale

Changho Hwang, Wei Cui, Yifan Xiong, Ziyue Yang, Ze Liu +10 more
6/7/2022
362 citations
cs.DCcs.CLcs.CV
moe

Official code: microsoft/Swin-Transformer (16,083 stars, Python, MIT, last commit 2024-07-24). 1 more implementation below.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
microsoft/Swin-TransformerOfficial16,083PythonMIT2024-07-24
microsoft/TutelOfficial1,028CMIT2026-11-06
MIT

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows".

16,0832,210Python, CudaMar 25, 20212 years agoMIT
ade20kimage-classificationimagenetmask-rcnnmscoco+3 more
microsoft/TutelOfficial100%
PyTorchMIT

Tutel MoE: Optimized Mixture-of-Experts Library, Support GLM/Kimi/Gpt/DeepSeek/Qwen using FP8/NVFP4/MXFP4

1,028112C, PythonAug 6, 20213 weeks agoMIT
deepseekllmmixture-of-expertsmoepytorch

Similar Papers

Cite this paper

@article{hwang2022tutel,
  title  = {Tutel: Adaptive Mixture-of-Experts at Scale},
  author = {Changho Hwang and Wei Cui and Yifan Xiong and Ziyue Yang and Ze Liu and Han Hu and Zilong Wang and Rafael Salas and Jithin Jose and Prabhat Ram and Joe Chau and Peng Cheng and Fan Yang and Mao Yang and Yongqiang Xiong},
  year   = {2022},
  eprint = {2206.03382},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.03382}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2206.03382.svg)](https://codeofpaper.com/paper/2206.03382)

Discussion