MoE Parallel Folding: Heterogeneous Parallelism Mappings for Efficient Large-Scale MoE Model Training with Megatron Core

Dennis Liu, Zijie Yan, Xin Yao, Tong Liu, Vijay Korthikanti, Evan Wu, Shiqing Fan, Gao Deng, Hongxiao Bai, Jianbin Chang, Ashwath Aithal, Michael Andersch, Mohammad Shoeybi, Jiajie Yao, Chandler Zhou, David Wu, Xipeng Li, June YangarXiv 2025 · DOI

Abstract

Training massive Mixture of Experts (MoE) models requires a delicate balance between memory constraints and communication bottlenecks. We present MoE Parallel Folding, a novel technique that decouples parallelism strategies for Attention and MoE layers. By optimizing these layers independently and "folding" communication-intensive tasks into high-bandwidth hardware domains, we achieve up to 49.3% Model FLOPs Utilization (MFU) on large-scale clusters.

Introduction

Mixture of Experts (MoE) architectures have become a standard for scaling Large Language Models (LLMs) to trillions of parameters without a linear increase in computational cost. However, the introduction of Expert Parallelism (EP) alongside traditional Tensor (TP), Data (DP), and Pipeline (PP) parallelism creates significant communication overhead. Traditionally, all layers in a Transformer block share the same parallelism mapping, which is suboptimal because Attention layers operate on sequences while MoE layers operate on individual tokens.

Methodology

MoE Parallel Folding

The core innovation is the decoupling of parallelism configurations between dense Attention layers and sparse MoE layers. This "folding" mechanism allows the Attention layer to utilize one strategy (e.g., sequence splitting) while the MoE layer utilizes another (e.g., expert splitting).

Figure 1: Illustration of MoE Parallel Folding, showing the mapping between Attention layer parallelism (DP, TP, CP) and MoE layer Expert Parallelism (EP).

By aligning these mappings, the framework ensures that the most intensive "All-to-All" communication remains within the high-bandwidth NVLink domain (intra-node), minimizing reliance on slower inter-node connections.

Flexible Token Dispatcher

To support this decoupled architecture, we implemented a 5-D Hybrid Parallelism dispatcher (TP, EP, CP, DP, PP). It features a sub-sequence-based token-dropping strategy that enables local decision-making, significantly reducing global communication latency without compromising model convergence.

Experimental Results

We evaluated the framework using several MoE architectures, including Mixtral 8x22B and Qwen2-57B-A14B, across up to 1,024 NVIDIA H100 GPUs.

Efficiency and Scalability

The implementation in NVIDIA’s Megatron-Core demonstrated substantial improvements over baseline methods like Fully Sharded Data Parallel (FSDP).

Figure 4: Model FLOPs Utilization (MFU) for Mixtral 8x22B across varying GPU counts, comparing Parallel Folding against baseline methods.

Key performance metrics include:

  • Peak Efficiency: 49.3% MFU for Mixtral 8x22B.
  • Linear Scaling: Performance scales efficiently up to 1,024 GPUs.
  • FP8 Throughput: Achieving 631.7 TFLOPS on Mixtral 8x22B, representing a 1.3x speedup over BF16.

Discussion and Conclusion

While Parallel Folding significantly boosts efficiency for coarse-grained MoE models, fine-grained architectures (with many small experts) still face challenges due to smaller matrix multiplication (GEMM) sizes. Future research will focus on kernel optimization for these fine-grained experts and extending 5-D parallelism to even larger models and longer context windows (up to 128K tokens).

Summary updated

BibTeX
@misc{liu2025moe,
  author = {Dennis Liu and Zijie Yan and Xin Yao and Tong Liu and Vijay Korthikanti and Evan Wu and Shiqing Fan and Gao Deng and Hongxiao Bai and Jianbin Chang and Ashwath Aithal and Michael Andersch and Mohammad Shoeybi and Jiajie Yao and Chandler Zhou and David Wu and Xipeng Li and June Yang},
  title = {{MoE Parallel Folding: Heterogeneous Parallelism Mappings for Efficient Large-Scale MoE Model Training with Megatron Core}},
  year = {2025},
  eprint = {2504.14960},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.14960},
}
Figure