Scalable and Efficient MoE Training for Multitask Multilingual Models

Young Jin Kim, Ammar Ahmad Awan, Alexandre Muzio, Andrés Felipe Cruz-Salinas, Liyang Lu, Amr Hendy, Samyam Rajbhandari, Yuxiong He, Hany Hassan AwadallaarXiv 2021

TL;DR

This paper introduces DeepSpeed MoE, a system that enables training trillion-parameter Mixture-of-Experts (MoE) models efficiently by combining novel parallelism techniques and memory optimization. They demonstrate that this approach significantly improves sample efficiency and achieves state-of-the-art results on multitask multilingual language generation tasks, including machine translation.

What Problem Does This Paper Address?

The paper tackles the challenge of scaling deep learning models, particularly the trend towards ever-larger models that promise improved accuracy but come with prohibitive computational costs. While Mixture-of-Experts (MoE) models offer a path to larger models with sub-linear compute costs, their training and deployment present unique system and modeling hurdles. Existing MoE systems struggle with memory redundancy and require significant code refactoring for scaling. Furthermore, effectively training these massive models to achieve better sample efficiency and avoid overfitting remains an open question.

Methods

The authors introduce DeepSpeed MoE, a system designed to overcome these challenges. Its key components include:

  • Multi-dimensional Parallelism: DeepSpeed MoE orchestrates five forms of parallelism (Data Parallelism, Tensor Slicing, Expert Parallelism, ZeRO, and ZeRO-Offload) to scale both expert and non-expert parameters. This allows for training models that far exceed the memory capacity of individual GPUs.
  • ZeRO (Zero Redundancy Optimizer): This technique partitions optimizer states, parameters, and gradients across devices, eliminating redundancy and freeing up significant GPU memory.
  • ZeRO-Offload: An extension of ZeRO that offloads optimizer states and gradients to CPU memory, further pushing the boundaries of model scale beyond GPU memory limits.
  • Random Token Selection (RTS): A novel training method to address biased token selection in MoE models, leading to faster convergence and improved sample efficiency.
  • Aggregation of Experts (AoE): A technique to create larger MoE models by merging checkpoints, enabling efficient initialization for new models.
  • Expert Pruning: A method to compress MoE models for faster inference by selecting a subset of experts.

Datasets

The paper utilizes several datasets for training and evaluation:

  • WMT-10 benchmark dataset: Used for evaluating models on a small-scale machine translation single task.
  • In-house web-crawled parallel dataset: A large dataset comprising 43 million tokens and 293 billion monolingual tokens from CCNet, covering 50 languages, used for large-scale multitask training.
  • CCNet: Used for its extensive collection of monolingual data across 50 languages.
  • Wikilingua: A dataset for Natural Language Generation (NLG) tasks, part of the Gem Benchmark.
  • XY translation dataset: A large dataset of 704 language pairs for multilingual non-English centric translation.
  • CCMatrix: Used for fine-tuning on translation tasks.
  • XNLI dataset: Used for evaluating cross-lingual sentence representation capabilities.

Key Insights and Ideas

  • MoE is crucial for scaling: The paper strongly advocates for MoE architectures as the most viable path to dramatically increasing model size without a proportional increase in computational cost, making extremely large models feasible.
  • System-level innovation is key: Simply having a sparse architecture isn't enough. The paper highlights that overcoming the "device memory wall" requires sophisticated system-level solutions like ZeRO and ZeRO-Offload, which are critical for enabling trillion-parameter models.
  • Multitask learning amplifies MoE benefits: Combining MoE with multitask and multilingual training leads to more generalized models that perform better across a wider range of tasks, especially for low-resource languages.
  • Training efficiency matters: Novel training techniques like Random Token Selection are not just about accuracy but also about making the training process significantly faster and more sample-efficient, a critical factor for large models.
  • Pruning and aggregation offer practical advantages: The ability to prune experts for inference and aggregate them for initialization demonstrates the modularity and practical utility of MoE models beyond just raw performance.

Key Results

  • State-of-the-art performance: A 10-billion parameter Z-code M3 model trained on 50 languages achieved state-of-the-art results in Machine Translation (MT) and multilingual natural language generation.
  • Massive scale achieved: DeepSpeed MoE enabled training models with over 3.5 trillion parameters on 512 NVIDIA A100 GPUs, an 8x increase in model size compared to existing systems.
  • Improved sample efficiency: MoE models with 64 experts reached a target validation loss ten times faster than a dense model of equivalent size.
  • Significant BLEU score gains: Z-code M3 [10B] model showed significant BLEU score improvements, particularly for low-resource languages, compared to a dense baseline.
  • Faster convergence: Random Token Selection demonstrated faster convergence compared to other token assignment strategies.
  • Competitive performance with pruned models: Experts pruned from a larger checkpoint achieved competitive BLEU scores with much faster fine-tuning compared to training from scratch.

Limitations and Future Work

  • Future work on ZeRO-Offload: The authors plan to explore more efficient integration of ZeRO-Offload with Z-code M3 models to enable even larger base model sizes.
  • Resource utilization limits: They intend to examine the limits and returns of scaling MoE models while efficiently utilizing computational resources.
  • Expert utilization and routing: Future research will focus on improving expert utilization and routing algorithms for specific tasks and languages, as this was identified as a limiting factor for improving translation from English into other languages.
  • Comprehensive multitask validation: The paper suggests future work to perform comprehensive experiments to validate the utility of MLM and ELECTRA tasks for encoder-only downstream tasks.

Summary updated

BibTeX
@misc{kim2021scalable,
  author = {Young Jin Kim and Ammar Ahmad Awan and Alexandre Muzio and Andrés Felipe Cruz-Salinas and Liyang Lu and Amr Hendy and Samyam Rajbhandari and Yuxiong He and Hany Hassan Awadalla},
  title = {{Scalable and Efficient MoE Training for Multitask Multilingual Models}},
  year = {2021},
  eprint = {2109.10465},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.10465},
}
Figure