[Paper Review] HetuMoE: An Efficient Trillion-scale Mixture-of-Expert Distributed Training System
HetuMoE is a high-performance, distributed Mixture-of-Experts (MoE) training system built on Hetu that supports multiple gating strategies and accelerates training on commodity GPU clusters. It introduces hierarchical AllToAll communication and optimized kernels, achieving up to 8.1× speedup over DeepSpeed-MoE under the switch gate with a batch size of 32.
As giant dense models advance quality but require large amounts of GPU budgets for training, the sparsely gated Mixture-of-Experts (MoE), a kind of conditional computation architecture, is proposed to scale models while keeping their computation constant. Specifically, the input tokens are routed by the gate network and only activates part of the expert network. Existing MoE training systems only support part of mainstream MoE models (e.g. Top k) training under expensive high-bandwidth GPU clusters. In this paper, we present HetuMoE, a high-performance large-scale sparse MoE training system built on Hetu. HetuMoE provides multiple gating strategies and efficient GPU kernel implementations. To further improve the training efficiency on commodity GPU clusters (e.g, with only 1 NiC), we introduce the hierarchical AllToAll communication that combines hierarchical networks and aggregating messages. Compared with existing state-of-the-art MoE systems, HetuMoE obtains at least 15% speedup. Specifically, HetuMoE outperforms DeepSpeed-MoE up to 8.1x under the switch gate with a batch size of 32. Our code is available at: https://github.com/PKU-DAIR/Hetu.
Motivation & Objective
- To address the inefficiency and limited scalability of existing MoE training systems on commodity GPU clusters.
- To support diverse mainstream gating strategies such as Switch, GShard, Top-k, and others in a single framework.
- To reduce communication bottlenecks in distributed MoE training by optimizing AllToAll communication on low-bandwidth networks.
- To achieve state-of-the-art training performance without relying on high-speed interconnects like NVLink or InfiniBand.
- To enable efficient, scalable, and practical training of trillion-parameter MoE models on standard GPU clusters.
Proposed method
- Introduces a hierarchical AllToAll communication pattern that combines intra-node and inter-node communication to aggregate small messages and improve bandwidth utilization.
- Employs optimized GPU kernels for key MoE operations, including Top-k gating, layout transformation, and AllToAll, with algorithmic improvements for k=1 and k=2.
- Uses a two-level data layout transformation: first grouping tokens by expert within a node, then performing AllToAll across nodes to reduce per-communication message size.
- Leverages Hetu’s distributed deep learning framework to natively support MoE training with minimal code changes and high performance.
- Supports multiple gating strategies including Switch, GShard, M6, BASE Layer, Hash Layer, SAM, and Dense-to-Sparse, enabling broad model compatibility.
- Optimizes the entire MoE training pipeline: gate computation, layout transform, inter-GPU communication, expert processing, and reverse layout transform.
Experimental results
Research questions
- RQ1Can a MoE training system achieve high performance on commodity GPU clusters without requiring high-bandwidth interconnects like NVLink or InfiniBand?
- RQ2How effective is hierarchical AllToAll communication in reducing communication overhead in multi-node MoE training?
- RQ3To what extent can kernel-level optimizations for Top-k gating and layout transformation improve MoE training efficiency?
- RQ4How does HetuMoE compare in performance to state-of-the-art systems like DeepSpeed-MoE, FastMoE, and Tutel across different gating strategies and batch sizes?
- RQ5Can a unified system efficiently support a wide range of MoE gating strategies while maintaining high training throughput?
Key findings
- HetuMoE achieves at least a 15% speedup over existing MoE systems across various configurations and gating strategies.
- Under the switch gate with a batch size of 32, HetuMoE outperforms DeepSpeed-MoE by up to 8.1× in training speed.
- The hierarchical AllToAll optimization achieves 1.66× speedup in a 4×8 GPU setting and 2× speedup in an 8×8 GPU setting compared to vanilla AllToAll.
- The optimized Top-k kernel in HetuMoE improves performance by 25% on average compared to PyTorch’s implementation for k=1 and k=2.
- The layout transform kernel in HetuMoE achieves over 26% improvement over state-of-the-art implementations.
- HetuMoE successfully supports diverse MoE gating strategies including Switch, GShard, M6, BASE Layer, Hash Layer, SAM, and Dense-to-Sparse, enabling broad model compatibility.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.