Moe training system improves gpu memory use and speeds up models

BaGuaLu-2: Taming Dynamic Memory Fluctuation for Efficient MoE Model Training over 10,000 GPUs

Distributed, Parallel, and Cluster Computing

Summary

Large language models use a method called Mixture-of-Experts (MoE) to grow bigger, but this causes unpredictable memory needs during training that slow things down or cause crashes. The authors created BaGuaLu-2, a system that dynamically manages GPU memory more precisely, adapting instantly to changes instead of guessing in advance. This approach improves training speed and stability, letting models with over a trillion parameters run efficiently on thousands of GPUs. BaGuaLu-2 does this without extra delays from managing memory, outperforming other leading systems.

What this means in practice

  • For machine learning engineers: Train extremely large Mixture-of-Experts models more efficiently on vast GPU clusters by dynamically adjusting memory allocation per batch.
  • For cloud infrastructure teams: Optimize GPU resource use in large-scale AI training centers by reducing memory over-provisioning and preventing out-of-memory crashes.

Authors

Mingshu Zhai, Minkun Guo, Hongrui Lian, Shuangyu Li, Qi Zhang, Chen Hu, Xiawei Du, Yuyang Jin, Zan Zong, Jidong Zhai

Abstract

Fine-grained Mixture-of-Experts (MoE) is the de facto architecture for scaling large language models. However, dynamic expert load imbalance causes severe memory fluctuations that degrade training efficiency. Existing systems rely on static memory provisioning: they either over-provision, leaving GPU memory idle during normal execution, or under- provision, inviting out-of-memory crashes and costly manual rollbacks when load spikes occur. To address these challenges, we propose BaGuaLu-2, a large-scale MoE training system that eliminates this dilemma through flexible provisioning. By transforming memory allocation from a static, one-time tuning choice into a continuous and fine-grained control. BaGuaLu-2 grants exact activation memory on demand for each training batch. Furthermore, it offsets any dynamic management overhead through system optimizations. BaGuaLu-2 demonstrates exceptional scalability, training a model with 1040 billion parameters across 12,288 GPUs while sustaining over 2 EFlops at 35% MFU. Compared with state-of-the-art systems, BaGuaLu-2 delivers 1.14x and 1.13x average throughput improvements over Megatron-Kuai and AdaPipe, respectively.