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

TopoOpt: Optimizing the Network Topology for Distributed DNN Training

Weiyang Wang, Moein Khazraee, Zhizhen Zhong, Zhijao Jia, Dheevatsa Mudigere, Ying Zhang, Anthony Kewitsch, Manya GhobadiarXiv 2022

TL;DR

This paper introduces TOPOOPT, a novel system that co-optimizes network topology and parallelization strategies for distributed deep neural network (DNN) training. By treating the network topology as a tunable parameter alongside computation and communication, TOPOOPT achieves significant speedups (up to 3.4x) compared to traditional approaches, making DNN training more efficient.

What Problem Does This Paper Address?

Deep neural network (DNN) training is becoming increasingly computationally intensive, demanding distributed systems with high performance. Traditional data center networks, often using Fat-tree topologies, are designed for general-purpose workloads and struggle with the unique, traffic-intensive demands of DNN training. Specifically, the communication overhead of DNN training grows dramatically with the number of workers, and the traffic patterns are highly dependent on the parallelization strategies used. Existing solutions focus on optimizing computation and communication but neglect the crucial dimension of network topology, leading to suboptimal performance.

Methods

TOPOOPT tackles this challenge by proposing a co-optimization framework that jointly optimizes network topology and parallelization strategy. The core of their approach is an alternating optimization technique. This involves iteratively:

  1. Optimizing the parallelization strategy: Using a Markov Chain Monte Carlo (MCMC) search (similar to FlexFlow) to find the best parallelization strategy for a given network topology, considering communication costs.
  2. Optimizing the network topology: Feeding the traffic demands from the optimized parallelization strategy to a TOPOLOGYFINDER algorithm. This algorithm constructs an efficient network topology and routing plan.

The TOPOLOGYFINDER algorithm has several key components:

  • Degree Distribution: It intelligently distributes the available network degree (number of connections per server) between AllReduce and Model Parallel (MP) traffic sub-topologies, prioritizing AllReduce.
  • AllReduce Sub-topology: It uses a novel group theory-inspired algorithm called TotientPerms to find optimal ring-AllReduce permutations. This leverages the "mutability" of AllReduce traffic, allowing for flexible server labeling to improve MP traffic performance.
  • MP Sub-topology: It employs a Blossom maximum weight matching algorithm to find optimal connections for MP transfers.
  • Routing: A modified Coin Change algorithm is used for routing AllReduce traffic, and k-shortest path routing for MP traffic.

The system also incorporates host-based forwarding for RDMA traffic, allowing servers to act as relays, and uses optical circuit switches (OCS) or patch panels for reconfigurable direct-connect fabrics.

Datasets

The paper uses six representative DNN models for evaluation: DLRM, CANDLE, BERT, NCF, ResNet50, and VGG. These models are representative of those used in production clusters at Meta. The paper does not introduce new benchmarks but rather uses these established models to evaluate their proposed system.

Key Insights and Ideas

  • Traffic Mutability: The most surprising insight is the "mutability" of AllReduce traffic. Unlike MP traffic, which has fixed data dependencies, AllReduce traffic patterns can be rearranged by permuting server labels without affecting correctness. This property is key to TOPOOPT's ability to optimize for both AllReduce and MP traffic simultaneously.
  • Topology as a First-Class Citizen: The paper strongly advocates for treating network topology not as a fixed constraint but as a tunable parameter that can be co-optimized with parallelization strategies for significant performance gains.
  • Demand-Aware Networking for DNNs: DNN training workloads are long-running and have predictable traffic patterns once the parallelization strategy is set. This makes them ideal candidates for demand-aware, reconfigurable network fabrics, unlike more dynamic traditional data center workloads.
  • TotientPerms for Efficient AllReduce: The use of group theory to generate optimal ring permutations for AllReduce traffic is a novel algorithmic contribution that efficiently balances load and reduces hop counts.

Key Results

  • Significant Speedup: TOPOOPT reduces DNN training iteration time by up to 3.4x compared to similar-cost Fat-tree interconnects.
  • Cost-Effectiveness: TOPOOPT is, on average, 3.2x cheaper than an ideal full bisection bandwidth Fat-tree.
  • Improved Performance on Shared Clusters: In shared cluster environments, TOPOOPT improves average iteration time by 1.7x and tail iteration time by 3x compared to Fat-tree.
  • Impact of Server Degree: Increasing server degree significantly benefits TOPOOPT, especially for network-heavy models like DLRM and CANDLE, leading to near-linear performance improvements.
  • Host-Based Forwarding Trade-offs: While enabling host-based forwarding is crucial for TOPOOPT's flexibility, it introduces a "bandwidth tax" that can degrade performance under heavy all-to-all traffic conditions, though this is mitigated by increasing server degree.

Limitations and Future Work

  • Traffic Pattern Assumption: TOPOOPT's current approach assumes that traffic patterns do not change within training iterations. This might not hold for certain models like Graph Neural Networks (GNNs) or Mixture-of-Experts (MoE) models.
  • Dynamic Reconfiguration Latency: While OCSs offer faster reconfiguration than patch panels, their latency (around 10ms) is still too high for dynamic topology changes within training iterations. The paper suggests that future, faster reconfigurable switches will be essential for truly elastic scenarios.
  • Dynamic Scheduling and Elasticity: The current system is optimized for long-lasting jobs where server assignments are static. Supporting dynamic job arrivals and departures, or elastic scaling of jobs, would require augmenting the optimization space to include dynamic scheduling, which is identified as a challenging future research problem.
  • Failure Handling: While TOPOOPT can recover from single link failures by reconfiguring the topology, permanent failures would require a fast optical switch to reconfigure.
  • RDMA Forwarding Overhead: The current implementation of host-based RDMA forwarding incurs a performance penalty, although it is negligible for small amounts of forwarded traffic. Future work aims to offload this forwarding to the NIC itself.

Summary updated

BibTeX
@misc{wang2022topoopt,
  author = {Weiyang Wang and Moein Khazraee and Zhizhen Zhong and Zhijao Jia and Dheevatsa Mudigere and Ying Zhang and Anthony Kewitsch and Manya Ghobadi},
  title = {{TopoOpt: Optimizing the Network Topology for Distributed DNN Training}},
  year = {2022},
  eprint = {2202.00433},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.00433},
}
Figure