AxoNN: An asynchronous, message-driven parallel framework for extreme-scale deep learning

Siddharth Singh, Abhinav Bhatele

TL;DR

This paper introduces AxoNN, a novel parallel deep learning framework that significantly boosts training efficiency for massive neural networks. By employing asynchronous, message-driven execution and an intelligent memory optimization strategy, AxoNN achieves substantial speedups and reduces GPU memory requirements, enabling researchers to train larger models faster and more cost-effectively.

What Problem Does This Paper Address?

Training state-of-the-art deep learning models, particularly large transformer architectures, has become increasingly challenging due to their enormous memory footprints, often exceeding the DRAM capacity of modern hardware accelerators like GPUs. This necessitates efficient parallel training strategies on large GPU clusters. Existing frameworks often rely on synchronous communication patterns or static scheduling, leading to GPU idle time and suboptimal hardware utilization, especially at extreme scales. Furthermore, the sheer size of these models requires a vast number of GPUs, exacerbating communication-to-computation ratios and further hindering performance.

Methods

AxoNN tackles these challenges with a multi-pronged approach:

  • Asynchronous, Message-Driven Execution: Instead of rigid synchronization steps, AxoNN uses a message-driven scheduler that triggers operations as their data dependencies are met. This allows for overlapping computation and communication, minimizing GPU idle time.
  • MPI-based Communication Backend: The framework leverages CUDA-aware MPI with GPU-Direct for point-to-point communication in the inter-layer parallel phase. This choice is motivated by MPI's support for non-blocking primitives and higher intra-node bandwidth compared to alternatives like NCCL.
  • Hybrid Parallelism: AxoNN combines inter-layer parallelism (sharding layers across GPUs within a group) and data parallelism (replicating the model across groups of GPUs). This creates a hierarchical structure for efficient scaling.
  • Intelligent Memory Optimization: A key innovation is the use of CPU memory as a scratch space to offload and intelligently prefetch model parameters and optimizer states. This drastically reduces GPU memory consumption, allowing more parameters to be stored per GPU.
  • NCCL for Collective Communication: For the data-parallel phase's all-reduce operations, NCCL is used due to its superior performance in collective communication.

Datasets

The paper uses the wikitext-103 dataset for training and evaluation. This dataset consists of approximately 100 million English words sourced from over 28,000 Wikipedia articles.

Key Insights and Ideas

  • Asynchrony is Key for Extreme Scale: The paper strongly advocates for asynchronous, message-driven execution as crucial for overcoming communication bottlenecks in large-scale distributed training, a departure from the prevalent synchronous approaches.
  • CPU Memory as a Scalable Resource: Offloading optimizer states and parameters to the CPU is a surprisingly effective strategy to dramatically reduce GPU memory pressure, enabling larger models or more efficient use of existing hardware.
  • MPI's Advantage for Point-to-Point: While NCCL is standard for collective operations, the paper demonstrates MPI's suitability and performance benefits for asynchronous point-to-point communication in the inter-layer parallel phase.
  • Hybrid Parallelism Hierarchy: The structured approach of combining inter-layer parallelism within groups and data parallelism across groups provides a robust scaling mechanism.

Key Results

  • Significant Speedups: AxoNN achieved training time reductions of 22-37 days (15-25% speedup) compared to the state-of-the-art (DeepSpeed) on large transformer models.
  • Improved GPU Throughput: The framework achieved a per-GPU throughput of 49.4-54.78% of theoretical peak on NVIDIA V100 GPUs.
  • Memory Reduction: The memory optimization algorithm reduced GPU memory consumption by four times, allowing for four times more parameters per GPU.
  • Scalability: AxoNN demonstrated strong and weak scaling performance, outperforming Megatron-LM and DeepSpeed across various model sizes (12B to 100B parameters) and GPU counts (48 to 384 GPUs).
  • Training Validation: The implementation was validated by successfully training a GPT-2 small model to completion, showing identical loss curves to a single-GPU PyTorch implementation.

Limitations and Future Work

  • Limitations: The paper acknowledges that while the memory optimization significantly reduces GPU memory, it does not eliminate the need for large amounts of memory for activations. The performance gains from the memory optimization are more pronounced in the pipelining phase, with a trade-off of increased time in the data parallel phase.
  • Future Work: The authors express hope that AxoNN can be used to train models with over a trillion parameters on thousands of GPUs. They also plan to open-source the weights of their trained models to benefit the research community.

Summary updated

BibTeX
@inproceedings{singh2022axonn,
  author = {Siddharth Singh and Abhinav Bhatele},
  title = {{AxoNN: An asynchronous, message-driven parallel framework for extreme-scale deep learning}},
  booktitle = {IPDPS},
  year = {2022},
  doi = {10.1109/ipdps53621.2022.00065},
}
Figure