DistTrain: Addressing Model and Data Heterogeneity with Disaggregated Training for Multimodal Large Language Models

Zili Zhang, Yinmin Zhong, Yimin Jiang, Hanpeng Hu, Jianjian Sun, Zheng Ge, Yibo Zhu, Daxin Jiang, Xin Jin

TL;DR

Training massive multimodal large language models (LLMs) is hampered by the inherent heterogeneity of both model architectures and data. This paper introduces DistTrain, a novel disaggregated training system that tackles these challenges by separating model components and decoupling data preprocessing, leading to significantly improved training efficiency and throughput.

What Problem Does This Paper Address?

The integration of multiple modalities (text, image, audio) into LLMs, creating multimodal LLMs, brings about significant system challenges. Unlike traditional LLMs trained on homogeneous text data, multimodal LLMs involve diverse components like modality encoders, LLM backbones, and modality generators, each with varying computational demands and resource needs. This "model heterogeneity" leads to pipeline bubbles and GPU underutilization. Furthermore, multimodal datasets are often characterized by "data heterogeneity," where samples vary greatly in size and processing cost (e.g., a high-resolution image vs. a text snippet). This disparity, coupled with the monolithic approach of current training frameworks that tightly couple data preprocessing with training, creates stragglers and further degrades training efficiency. Existing frameworks like Megatron-LM, while powerful for LLMs, struggle to efficiently handle these combined challenges in the multimodal setting.

Methods

DistTrain introduces two core disaggregation techniques:

  • Disaggregated Model Orchestration: This technique separates the training of the modality encoder, LLM backbone, and modality generator into distinct "parallelism units." Each unit can be configured with its own optimal resource allocation (number of GPUs) and parallelism strategy (Tensor Parallelism, Pipeline Parallelism, Data Parallelism). This allows for adaptive orchestration, minimizing pipeline bubbles caused by model heterogeneity. The system formulates this as an optimization problem to minimize training time per iteration and uses a dedicated manager to find optimal configurations.
  • Disaggregated Data Preprocessing: This approach decouples data preprocessing from the main training pipeline. A producer-consumer model is employed, where dedicated CPU nodes handle preprocessing asynchronously, feeding preprocessed data to GPU nodes. This eliminates resource contention and enables flexible data reordering. DistTrain uses two levels of data reordering:
  • Intra-microbatch reordering: Balances computational load across data parallelism groups by reordering samples within a global batch.
  • Inter-microbatch reordering: Strategically orders microbatches to minimize pipeline bubbles by placing smaller microbatches strategically within the pipeline.

Datasets

The paper uses the LAION-400M dataset for training and evaluation. They generate training sequences by interleaving image and text tokens, creating sequences up to 8192 tokens long. This dataset is noted for its inherent data heterogeneity due to varying image and text subsequence sizes and counts.

Key Insights and Ideas

  • Heterogeneity is the core challenge: The paper clearly articulates that both model architecture differences and data variability are critical bottlenecks for multimodal LLM training, which are often overlooked by monolithic approaches.
  • Disaggregation unlocks efficiency: The core idea that breaking down monolithic systems into specialized, independently configurable components (both model parts and data processing) is key to overcoming complex system challenges.
  • Adaptive orchestration is crucial: Simply allocating resources proportionally to model size isn't enough. DistTrain's adaptive approach, informed by a performance model, is vital for finding optimal parallelism strategies.
  • Data reordering can hide latency: The insight that carefully reordering data samples, both within and between microbatches, can effectively mask the impact of data heterogeneity and reduce pipeline bubbles without additional computational overhead.
  • Decoupling preprocessing is a game-changer: Separating data preprocessing from GPU training significantly reduces its overhead, transforming it from a multi-second bottleneck to milliseconds.

Key Results

  • Improved MFU: DistTrain achieves 51.8%-54.7% Model FLOPs Utilization (MFU) in large-scale training, approaching the efficiency of unimodal LLM training.
  • Significant Throughput Gains: DistTrain outperforms Megatron-LM by up to 2.2x on training throughput.
  • Resource Efficiency: DistTrain can achieve these gains using fewer GPUs than Megatron-LM in some cases, freeing up resources for other tasks.
  • Reduced Preprocessing Overhead: Disaggregated data preprocessing reduces the overhead from seconds to milliseconds, making it negligible.
  • Effective Model Orchestration: The disaggregated model orchestration strategy leads to substantial improvements in MFU and throughput, especially for smaller models where data parallelism is higher.

Limitations and Future Work

  • Focus on Image/Text: While the paper states DistTrain is compatible with other modalities, the experiments primarily focus on image and text. Future work could explore its effectiveness with audio and other modalities.
  • Algorithm Complexity: While the paper mentions retrofitting the algorithm for VPP (Virtual Pipeline Parallelism), the current inter-microbatch reordering algorithm is specifically designed for the 1F1B pipeline scheme. Extending it to other pipeline schedules would be valuable.
  • Hardware Heterogeneity: The paper briefly mentions the potential for using heterogeneous hardware (e.g., placing less compute-intensive encoders on cheaper GPUs), but this is not extensively explored in the experimental evaluation. Further research could delve into optimizing for diverse hardware configurations.

Summary updated

BibTeX
@inproceedings{zhang2024disttrain,
  author = {Zili Zhang and Yinmin Zhong and Yimin Jiang and Hanpeng Hu and Jianjian Sun and Zheng Ge and Yibo Zhu and Daxin Jiang and Xin Jin},
  title = {{DistTrain: Addressing Model and Data Heterogeneity with Disaggregated Training for Multimodal Large Language Models}},
  booktitle = {SIGCOMM},
  year = {2024},
}
Figure