LIBRA: Enabling Workload-Aware Multi-Dimensional Network Topology Optimization for Distributed Training of Large AI Models

William Won, Saeed Rashidi, Sudarshan Srinivasan, Tushar KrishnaISPASS 2024

TL;DR

As AI models grow, communication between processing units becomes a major bottleneck. This paper introduces LIBRA, a framework that intelligently designs multi-dimensional network topologies to optimize communication bandwidth for specific AI workloads, leading to significant speedups and cost savings.

What Problem Does This Paper Address?

Training massive AI models, like the latest Large Language Models (LLMs), requires distributing the computation and model weights across thousands of specialized processors (NPUs). This distributed training, while necessary, creates a communication bottleneck: the constant exchange of gradients and activations between NPUs can overwhelm the network, slowing down the entire training process. Current AI systems often use 2D network fabrics, but these have limitations in scaling bandwidth efficiently. The paper addresses the challenge of designing multi-dimensional network fabrics that can offer higher bandwidth and better cost-efficiency, but crucially, how to optimize the bandwidth allocation across these multiple dimensions for specific AI workloads at design time. Simply increasing bandwidth everywhere isn't optimal; it requires a workload-aware approach to avoid under- or over-provisioning resources.

Methods

The core of this work is the LIBRA framework, a design-time optimization tool. LIBRA takes into account:

  • Target Workloads: Specific AI models (e.g., LLMs like GPT-3, MSFT-1T, or vision/recommendation models like ResNet-50, DLRM).
  • Fabric Technology Options: Different types of network building blocks (e.g., Ring, Fully-Connected, Switch) that can be combined to form multi-dimensional topologies.
  • Design Constraints: User-defined limitations on total bandwidth, per-NPU bandwidth, or total network cost.

LIBRA works by:

  1. Estimating Training Time: It models the end-to-end training time as a function of network bandwidth, considering communication patterns dictated by the AI model's parallelization strategy (e.g., Tensor Parallelism, Data Parallelism).
  2. Estimating Network Cost: It uses a configurable cost model to assign dollar values to different network components.
  3. Optimization: It employs a Quadratic Programming (QP) solver to find the optimal network bandwidth configuration that either maximizes training performance (PerfOptBW) or maximizes performance per unit cost (PerfPerCostOptBW), while satisfying all design constraints.

A key aspect is LIBRA's ability to model multi-rail collective communication algorithms, which are essential for efficient data exchange in multi-dimensional networks.

Datasets

The paper doesn't use traditional "datasets" in the sense of training data for AI models. Instead, it focuses on benchmark AI models to evaluate its framework. These include:

  • Large Language Models (LLMs): Turing-NLG, GPT-3, MSFT-1T.
  • Other Models: ResNet-50, DLRM (used for recommendation systems).

The paper evaluates LIBRA's performance across various multi-dimensional network topologies (e.g., 3D-4K, 4D-4K, 3D-512, 3D-1K, 4D-2K) and bandwidth configurations.

Key Insights and Ideas

  • Multi-dimensional Networks are Key: Simply scaling up bandwidth in existing 2D networks is insufficient. Multi-dimensional networks offer a path to significantly higher aggregate bandwidth per NPU.
  • Workload-Awareness is Crucial: The optimal network topology and bandwidth allocation are highly dependent on the specific AI model and its training strategy. A one-size-fits-all approach is inefficient.
  • Bandwidth Allocation Matters: Under- or over-provisioning bandwidth in any dimension of a multi-dimensional network can lead to significant performance degradation and resource underutilization. LIBRA's design-time optimization addresses this.
  • Cost-Performance Trade-offs: LIBRA can optimize for raw performance (PerfOptBW) or for the best performance per dollar (PerfPerCostOptBW), allowing designers to balance these critical factors.
  • Co-design Opportunities: LIBRA's framework can be used to explore co-optimization of network design with parallelization strategies and even runtime optimizations (like TACOS and Themis), leading to further gains.

Key Results

  • Significant Speedups: LIBRA's PerfOptBW optimization achieved an average speedup of 1.23x (up to 2.00x max) over a baseline "EqualBW" configuration (where bandwidth is distributed equally across dimensions).
  • Impressive Perf-per-Cost: PerfPerCostOptBW delivered even higher gains, with an average perf-per-cost benefit of 5.40x (up to 12.24x max) over EqualBW.
  • Workload-Specific Benefits: Larger models (LLMs) showed greater performance benefits from LIBRA's optimization, while smaller models benefited more from perf-per-cost improvements.
  • Group Optimization: Optimizing a network for a group of diverse workloads simultaneously resulted in near-optimal performance across all, with an average slowdown of only 1.01x compared to individually optimized networks.
  • Runtime Integration: Combining LIBRA with runtime optimizers like Themis yielded substantial improvements, with a LIBRA-designed network showing a 2.24x training speedup and a 4.77x better perf-per-cost.

Limitations and Future Work

  • Model Simplifications: The current LIBRA modeling primarily focuses on network bandwidth and disregards link latencies or NPU compute performance implications. While justified by the communication-bound nature of large model training, this is a simplification.
  • Design-Time Focus: LIBRA is a design-time tool. While it can inform runtime optimizations, it doesn't perform runtime scheduling itself.
  • Future Work: The authors suggest exploring more intricate modeling of communication and compute, incorporating more advanced parallelization strategies, and further investigating co-optimization with runtime systems. They also highlight the potential for LIBRA to handle even higher dimensional networks (beyond 4D).

Summary updated

Abstract

As model sizes in machine learning continue to scale, distributed training is necessary to accommodate model weights within each device and to reduce training time. However, this comes with the expense of increased communication overhead due to the exchange of gradients and activations, which become the critical bottleneck of the end-to-end training process. In this work, we motivate the design of multi-dimensional networks within machine learning systems as a cost-efficient mechanism to enhance overall network bandwidth. We also identify that optimal bandwidth allocation is pivotal for multi-dimensional networks to ensure efficient resource utilization. We introduce Libra, a framework specifically focused on optimizing multi-dimensional fabric architectures. Through case studies, we demonstrate the value of Libra, both in architecting optimized fabrics under diverse constraints and in enabling co-optimization opportunities.
BibTeX
@inproceedings{won2024libra,
  author = {William Won and Saeed Rashidi and Sudarshan Srinivasan and Tushar Krishna},
  title = {{LIBRA: Enabling Workload-Aware Multi-Dimensional Network Topology Optimization for Distributed Training of Large AI Models}},
  booktitle = {ISPASS},
  year = {2024},
  url = {https://openreview.net/forum?id=sz3Yp4bPoH},
}

Loading related content...

Figure