EfficientMoE: Optimizing Mixture-of-Experts Model Training With Adaptive Load Balance
Mixture-of-Experts (MoE) efficiently trains large models by using sparse activation to lower costs, selecting a few experts based on data characteristics. However, it faces challenges such as All-to-All communication overhead and load imbalance, with most optimizations targeting dynamic graphs rather than the more efficient static graphs. This study identifies two key challenges in training MoE on static graphs: 1) excessive All-to-All communication (up to 75% of iteration time) and load imbalance (70% of tokens handled by two experts) between experts due to the sparse structure of the MoE model and the token distribution; and 2) inefficient zero-padding for static shapes, leading to unnecessary computational overhead(wasting approximately 50% of resources). Thus, EfficientMoE, a scheduling method based on expert load and data characteristics, is introduced. EfficientMoE first designs a sampler to collect real-time information about token distribution, expert load, etc. It constructs a load prediction model to evaluate expert load. Subsequently, EfficientMoE proposes a dynamic schedule strategy for experts with evaluated expert load, reducing All-to-All communication and addressing load-balancing issues. Additionally, an expert capacity model is proposed to set different capacities for replicas of hot experts before static graph compilation, minimizing computation and storage overhead caused by significant padding. This study implements EfficientMoE in MindSpore and uses 32 Ascend AI accelerators to train an MoE model with 21 billion parameters and evaluate its validity. EfficientMoE demonstrated an improvement of 30% in model training time, approximately 12% reduction in communication time, and saved 35% computational resources across different clusters, compared with Switch transformers, and the Fastermoe method for static graphs.
Authors
- Wei Ye (ORCID: https://orcid.org/0000-0003-4905-2015)
- Yan Zeng (ORCID: https://orcid.org/0000-0003-2026-417X)
- Shengnan Wang (ORCID: https://orcid.org/0000-0003-2995-9832)
- Mei Yang (ORCID: https://orcid.org/0000-0002-4233-7889)
- Chengchuang Huang
- Wenqi Shi (ORCID: https://orcid.org/0000-0002-9528-0257)
- Teng Su (ORCID: https://orcid.org/0009-0005-9517-2845)
- Lifu Zhang (ORCID: https://orcid.org/0000-0002-3533-9966)
Institutions
- Huawei Technologies (China) (CN)
- Hangzhou Dianzi University (CN)
Publication Details
- Journal
- IEEE Transactions on Parallel and Distributed Systems
- Published
- 2025-02-06
- DOI
- https://doi.org/10.1109/tpds.2025.3539297
- Citations
- 4
- Primary Topic
- Gaussian Processes and Bayesian Inference
- Type
- article
- Field-Weighted Citation Impact
- 9.92