NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

An Efficient 2D Method for Training Super-Large Deep Learning Models

Qifan Xu, Shenggui Li, Chaoyu Gong, Yang YouIPDPS 2021 · DOI

Introduction

The rapid scaling of Large Language Models (LLMs) to hundreds of billions or even trillions of parameters has created a significant memory challenge. These models exceed the capacity of individual GPUs, necessitating model parallelism—the distribution of model components across multiple devices. The current industry standard, Megatron-LM, employs 1D partitioning. While effective for weights, 1D partitioning requires each device to maintain a full copy of intermediate activations. This redundancy creates a memory bottleneck that limits batch sizes and increases communication overhead as the number of GPUs scales.

The Optimus Framework: 2D Model Parallelism

To address these limitations, we introduce Optimus, a 2D-partitioning paradigm designed to eliminate activation redundancy. Optimus organizes GPUs into a $q \times q$ logical mesh and leverages the SUMMA (Scalable Universal Matrix Multiplication Algorithm) to partition both model parameters and activations.

The Optimus framework applies 2D partitioning to the MLP layer, utilizing the SUMMA algorithm to replace global all-reduce operations with localized communication.

Key technical innovations include:

  • 2D Activation Partitioning: By partitioning activations across the device mesh, Optimus ensures that no single device stores the entire activation tensor, significantly reducing the memory footprint per GPU.
  • SUMMA-based Operations: Transformer blocks, specifically the MLP and Self-Attention layers, are adapted for SUMMA. This approach utilizes localized "broadcast" and "reduce" operations within the rows and columns of the GPU mesh, avoiding the network congestion associated with global "all-reduce" calls.
  • Optimized Memory Management: To mitigate memory fragmentation in frameworks like PyTorch, Optimus implements manual pre-allocation and reuse of memory buffers for forward and backward passes.
Visualization of the 2D matrix multiplication and communication patterns within the GPU mesh.

Theoretical and Practical Scaling

Optimus offers superior theoretical scalability compared to 1D methods. The framework's isoefficiency—the rate at which problem size must grow relative to the number of processors ($p$) to maintain efficiency—is $O((\sqrt{p} \log p)^3)$. In contrast, 1D partitioning requires a growth rate of $O(p^3)$. Furthermore, by restricting communication to mesh rows and columns, Optimus reduces interconnect contention.

Experimental Results

The framework was evaluated on the TACC Frontera supercomputer using NVIDIA Quadro RTX 5000 GPUs. Benchmarks focused on the core Transformer architecture to measure throughput and memory limits.

Compared to Megatron-LM on a 64-GPU cluster, Optimus achieved:

  • 1.48x Training Throughput: Faster overall training speeds due to reduced communication overhead.
  • 1.78x Inference Speed: Significant improvements in single forward pass latency.
  • 8x Maximum Batch Size: The elimination of activation redundancy allowed for much larger batches without encountering "out of memory" errors.
  • Improved Strong Scaling: Optimus demonstrated increasing efficiency as more GPUs were added to a fixed-size problem, a rare feat in parallel computing.

Conclusion and Future Work

Optimus provides a scalable path for training the next generation of massive AI models. Future research will focus on adapting 2D partitioning for Mixture of Experts (MoE) architectures, further fusing operations to minimize temporary memory usage, and automating the partitioning process for diverse neural network topologies.

Summary updated

BibTeX
@inproceedings{xu2021efficient,
  author = {Qifan Xu and Shenggui Li and Chaoyu Gong and Yang You},
  title = {{An Efficient 2D Method for Training Super-Large Deep Learning Models}},
  booktitle = {IPDPS},
  year = {2021},
  doi = {10.1109/ipdps54959.2023.00031},
}
Figure