Mist: Efficient Distributed Training of Large Language Models via Memory-Parallelism Co-Optimization

Zhanda Zhu, Christina Giannoula, Muralidhar Andoorveedu, Qidong Su, Karttikeya Mangalam, Bojian Zheng, Gennady Pekhimenko

Introduction

Training massive Large Language Models (LLMs) like LLaMA-3.1-405B is a monumental task, requiring millions of GPU hours and a sophisticated array of optimization strategies. Engineers must navigate a complex landscape of parallelism types (Data, Tensor, and Pipeline) and memory-saving techniques (Activation Checkpointing, ZeRO redundancy elimination, and CPU Offloading). The primary challenge lies in the deep interconnection between these choices; for instance, offloading data to the CPU can free up GPU memory to enable more efficient parallelism. However, the search space for an optimal configuration is astronomically large, and existing systems often fail to account for computation-communication overlap or the inherent imbalances in training pipelines.

The Landscape of Distributed Training

Existing automatic distributed training systems often struggle with three main issues: ignoring the potential for overlapping computation and communication, slow simulation times for evaluating configurations, and failing to account for the "pipeline bubble" or initialization overheads that cause imbalances between microbatches.

Comparison of Mist with existing distributed training frameworks across parallelism, offloading, and auto-tuning capabilities.

As shown in the table above, while frameworks like Megatron-LM and DeepSpeed provide robust parallelism support, they often lack the comprehensive auto-tuning or integrated offloading capabilities that Mist provides to navigate the vast optimization search space.

Methods: Memory-Parallelism Co-Optimization

Mist introduces three core innovations to streamline LLM training:

  1. Fine-Grained Overlap-Centric Scheduling: Mist orchestrates memory optimizations to maximize the "hiding" of communication time behind computation. For example, it overlaps activation swapping to the CPU with the computation of subsequent layers.
  2. Symbolic-Based Performance Analysis: To avoid slow simulations, Mist uses a "symbolic" pass to generate mathematical expressions for predicting runtime and memory usage. This allows it to evaluate configurations over 100,000 times faster than traditional methods.
  3. Imbalance-Aware Hierarchical Tuning: Mist employs a two-step optimization process. It first optimizes individual pipeline stages (intra-stage) and then uses Mixed Integer Linear Programming (MILP) to stitch them together (inter-stage), specifically accounting for the slower first and last microbatches in a pipeline.

Evaluation and Key Results

Mist was evaluated using GPT-3, LLaMA, and Falcon architectures at scales ranging from 1.3B to 22B parameters. Testing was conducted on both high-end NVIDIA A100 (NVLink) and mid-range NVIDIA L4 (PCIe) systems.

Visualization of the incremental speedups achieved through Mist's various tuning strategies compared to baseline configurations.

The system achieved an average speedup of 1.28× (up to 1.73×) over manually-tuned Megatron-LM and 1.27× (up to 2.04×) over the automatic system Aceso. These gains were particularly pronounced on memory-constrained PCIe-based systems, demonstrating Mist's ability to extract maximum performance from diverse hardware. Furthermore, Mist's symbolic approach allows it to find optimal training plans for 22B parameter models in minutes, a task that takes hours or fails in previous systems.

Key Insights

  • Memory as a Lever: Memory optimizations are not just for fitting models; they are tools to enable faster parallelism by reducing pipeline idle time.
  • Microbatch Imbalance: Accounting for the extra overhead in the first microbatch (e.g., parameter all-gathering) is crucial for accurate tuning.
  • Symbolic Efficiency: Transforming performance modeling into symbolic equations drastically accelerates the search for optimal configurations.

Limitations and Future Work

Mist currently relies on static computational graphs, which may limit its application to dynamic models like Mixture of Experts (MoE). It also assumes identical layers within pipeline stages. Future work will address these constraints and the engineering challenges of preventing data races during complex overlaps.

Summary updated

BibTeX
@inproceedings{zhu2025mist,
  author = {Zhanda Zhu and Christina Giannoula and Muralidhar Andoorveedu and Qidong Su and Karttikeya Mangalam and Bojian Zheng and Gennady Pekhimenko},
  title = {{Mist: Efficient Distributed Training of Large Language Models via Memory-Parallelism Co-Optimization}},
  booktitle = {EuroSys},
  year = {2025},
}
Figure