TL;DR
MegaScale-Omni is an industrial-grade training system designed to handle the highly dynamic workloads of training Multimodal Large Language Models (MLLMs) at scale. By decoupling resource allocation and parallelization between modality encoders and the LLM backbone, it eliminates severe hardware bottlenecks and delivers a $1.27\times$ to $7.57\times$ throughput improvement on clusters with thousands of GPUs.
What Problem Does This Paper Address?
Training modern MLLMs (models that process text, images, audio, and video) is a moving target. Production training recipes typically happen in multiple phases, constantly shifting the ratio of modality data (e.g., moving from text-heavy pretraining to video-heavy fine-tuning). Furthermore, sample lengths vary wildly both across and within modalities—short audio clips might be mixed with massive 512K-token text documents.
Existing training frameworks fall short because they statically couple the resource allocation and parallelization strategies of the encoders and the LLM backbone. For instance, treating encoders simply as embedding layers inside the LLM forces them to share the same parallelization layout. When encoder workloads spike, the first pipeline stage (PP0) becomes a massive compute and memory bottleneck, leading to severe throughput drops or Out-of-Memory (OOM) failures.
Methods
The authors introduce MegaScale-Omni, built on a novel architecture called encoder-LLM multiplexing. It colocates both encoder and LLM states across all available GPUs but completely decouples their execution strategies through three core innovations:
- Long-Short Sequence Parallelism (LSSP): Instead of statically splitting nodes into Data Parallel (DP) or Sequence Parallel (SP) groups, LSSP allows all nodes to temporally shift states. For each micro-batch, short samples are processed using highly concurrent DP, while samples exceeding a length threshold dynamically shift to Ulysses SP.
- Unified Representation (
EncoderAnchor): To avoid intrusive, hard-to-maintain modifications to shared LLM codebases, the system abstracts encoders as non-intrusive "anchors" hooked into the LLM pipeline. This enables an on-demand joint pipeline where encoder micro-batches are executed right before their outputs are needed by the LLM, drastically reducing peak activation memory. - Decentralized Grouped Reordering: To balance workloads without the massive communication overhead of global data reordering, MegaScale-Omni divides GPU ranks into local groups based on network topology. It uses the Karp partitioning algorithm to balance sample lengths within these local groups.
Datasets
The system was evaluated using a mix of open-source and production-grade datasets:
- Vision-Language: OpenImages, RefCOCOg, and BytedLong (an in-house production text dataset featuring document lengths up to 512K tokens).
- Triple-Modality: Extended the vision-language datasets by integrating LibriSpeech and GigaSpeech for speech/audio processing.
Key Insights and Ideas
- Temporal Shifting > Spatial Splitting: Dedicating specific nodes to specific parallelisms creates severe idle time when data distributions shift. Temporally shifting the entire cluster's state between DP and SP on a per-micro-batch basis ensures high GPU utilization regardless of data composition.
- On-Demand Execution Minimizes Footprint: Computing encoder representations right before the LLM backbone consumes them—rather than pre-computing the entire batch upfront—prevents activation memory from piling up, mitigating OOM risks.
- Homogeneous Encoder Assignment: Rather than assigning specific modalities to specific pipeline stages, every LLM pipeline stage is assigned an identical set of encoders. This balances out the computational heterogeneity inherent to different modalities (e.g., heavy convolutional layers in speech encoders vs. ViTs).
Key Results
- Throughput Multipliers: MegaScale-Omni consistently outperformed state-of-the-art baselines (including Megatron-LM, AutoParallel, and Optimus), showing speedups of up to $1.54\times$ on 64 GPUs, $3.30\times$ on 128 GPUs, $7.57\times$ on 256 GPUs, and $1.98\times$ on 512 GPUs.
- Robust MFU: The system improved Model Flops Utilization (MFU) by up to 23% across varying modality mixtures and demonstrated excellent scaling potential as sequence lengths increased.
- Production Proven: Successfully deployed on an in-house hyper-scale cluster with thousands of GPUs, maintaining a stable average training throughput of approximately 8 million tokens per second.
Limitations and Future Work
While MegaScale-Omni provides a highly resilient foundation for production workloads, the authors note that its current scheduling relies on uniform insertion across pipeline stages. They suggest that integrating more advanced, idealized dynamic scheduling algorithms could further minimize internal execution bubbles. Additionally, operating at a scale of thousands of GPUs revealed subtle real-world challenges—such as host memory fragmentation from activation offloading and loader state saving stragglers—which require ongoing, fine-grained engineering optimizations.
Summary updated