TL;DR
ScMoE (Shortcut-connected Mixture of Experts) is a novel architecture that eliminates the communication bottleneck in distributed MoE models by decoupling expert routing from the current layer's computation. By using representations from the preceding layer to trigger "All-to-All" communication, ScMoE enables up to 100% overlap between communication and computation. This results in speedups of up to 1.49× in training and 1.82× in inference without sacrificing model quality.
What Problem Does This Paper Address?
Mixture of Experts (MoE) models are the current gold standard for scaling Large Language Models (LLMs). They allow for massive parameter counts without a proportional increase in computational cost per token. However, scaling these models across multiple GPUs requires Expert Parallelism (EP), where different "experts" reside on different devices.
The Achilles' heel of EP is the All-to-All communication overhead. To process a token, the system must send it to the GPU where its assigned expert lives and then bring the result back.
As shown above, this communication can consume over 50% of the total execution time, creating a massive bottleneck. Existing optimizations like pipelining only partially hide this latency because of a strict sequential dependency: you cannot start the communication until the current layer has calculated exactly which expert a token needs.
Methods
The authors propose ScMoE, which breaks this sequential dependency by introducing a "shortcut" from the preceding layer.
The ScMoE Architecture
In a standard MoE, the gating network uses the current layer's hidden state to route tokens. ScMoE instead uses the hidden state from the preceding layer (the "shortcut") to make routing decisions for the current MoE module. This allows the system to start the All-to-All communication for the experts simultaneously with the current layer's backbone computation (like Self-Attention).
The architecture effectively creates two parallel streams:
- The Backbone Stream: Processes the current layer's representations using Self-Attention and a shared expert (a standard MLP).
- The MoE Stream: Uses the shortcut representation to perform gating, All-to-All dispatch, expert computation, and All-to-All combine.
Adaptive Scheduling
Because different hardware and models have different computation-to-communication ratios, the authors implement an Adaptive Operators Scheduling strategy. This dynamically places the expert computation at the optimal point within the execution timeline to maximize overlap.
Key Insights and Ideas
- Representation Similarity: The core insight is that hidden representations in adjacent Transformer layers are highly similar (often having a cosine similarity near 1.0). This means the preceding layer's state is an excellent proxy for routing tokens in the current layer.
- Determinate Expert Migration: For memory-constrained inference (where experts are offloaded to CPU), ScMoE allows for "determinate" prefetching. Unlike speculative methods that guess which expert to load, ScMoE knows exactly which expert is needed much earlier in the pipeline, reducing migration costs by up to 75%.
- Top-1 + Shared Expert $\approx$ Top-2: ScMoE effectively acts like a Top-2 MoE (one shared expert + one routed expert) but with the communication profile of a Top-1 MoE. This maintains high model quality while drastically reducing the time spent waiting for data.
Key Results
The researchers evaluated ScMoE across both vision (SwinV2-MoE on ImageNet-1K) and language domains (GPT-2, GPT-3, and LLaMA2-based MoE models).
- Significant Speedups: In communication-intensive scenarios (8× A30-PCIe), ScMoE achieved a 1.49× speedup in training and 1.82× in inference compared to the standard Top-2 MoE baseline.
- Full Overlap: In multi-node distributed environments, ScMoE achieved 100% overlap of communication with computation, effectively "hiding" the communication cost entirely.
- Comparable Quality: On ImageNet-1K, ScMoE reached 79.38% accuracy (vs. 79.33% for Top-2 MoE). In language tasks, ScMoE consistently matched or slightly outperformed standard MoE architectures across zero-shot benchmarks like HellaSwag, PIQA, and WinoGrande.
Limitations and Future Work
- Hyperparameter Sensitivity: The shortcut connection introduces new architectural dynamics that may require more specialized hyperparameter tuning to reach absolute peak performance.
- Placement Frequency: The benefits of ScMoE are most pronounced when MoE layers are interspersed (e.g., every other layer). If an MoE module is placed in every layer, the potential overlap window for each layer is smaller.
- Extreme Parameter Sharing: The authors suggest future work could explore sharing a single MoE module across even more layers (e.g., 4 or 8 layers) to further improve parameter efficiency.
Summary updated