Synthesizing Collective Communication Algorithms for Heterogeneous Networks with TACCL

Aashaka Shah, Vijay Chidambaram, Meghan Cowan, Saeed Maleki, Madan Musuvathi, Todd Mytkowicz, Jacob Nelson, Olli Saarikivi, Rachee Singh

Abstract

Machine learning models are increasingly being trained across multiple GPUs and servers. In this setting, data is transferred between GPUs using communication collectives such as AlltoAll and AllReduce, which can become a significant bottleneck in training large models. Thus, it is important to use efficient algorithms for collective communication. We develop TACCL, a tool that enables algorithm designers to guide a synthesizer into automatically generating algorithms for a given hardware configuration and communication collective. TACCL uses a novel communication sketch abstraction to get crucial information from the designer to significantly reduce the search space and guide the synthesizer towards better algorithms. TACCL also uses a novel encoding of the problem that allows it to scale beyond single-node topologies. We use TACCL to synthesize algorithms for three collectives and two hardware topologies: DGX-2 and NDv2. We demonstrate that the algorithms synthesized by TACCL outperform the Nvidia Collective Communication Library (NCCL) by up to 6.7x. We also show that TACCL can speed up end-to-end training of Transformer-XL and BERT models by 11%--2.3x for different batch sizes.

Introduction: The Communication Bottleneck

As deep learning models scale to billions of parameters, they outgrow the memory capacity of individual GPUs. Training these massive models necessitates distributed systems where hundreds of GPUs are interconnected via a mix of high-bandwidth links like NVLink and standard network interfaces like InfiniBand. In these environments, the performance of collective communication—operations where data is shared or reduced across all participating nodes—often becomes the primary bottleneck.

Common collective communication primitives: AllGather, AllToAll, and AllReduce.

Standard libraries, such as the Nvidia Collective Communication Library (NCCL), typically employ generic algorithms like rings or trees. While robust, these "one-size-fits-all" strategies often fail to exploit the specific, often irregular, hardware topologies of modern data centers. This mismatch leads to underutilized links and increased GPU idle time.

The TACCL Synthesis Pipeline

To address these inefficiencies, we present TACCL (Topology Aware Collective Communication Library). TACCL is a synthesis tool that automatically generates optimized communication algorithms tailored to specific hardware configurations.

The TACCL synthesis pipeline, from input sketches to backend implementation.

The synthesis process is divided into three distinct stages:

  1. Routing: TACCL solves a relaxed Mixed Integer Linear Program (MILP) to determine the optimal paths for data chunks.
  2. Heuristic Ordering: Greedy algorithms are used to sequence chunk transfers, minimizing link contention.
  3. Contiguity and Exact Scheduling: A final MILP determines whether to batch chunks to reduce latency (the $\alpha$ cost) or send them individually to maximize pipelining efficiency.

A key innovation in TACCL is the Communication Sketch. This abstraction allows human designers to provide high-level guidance—such as restricting inter-node traffic to specific links—which significantly prunes the search space of what is otherwise an NP-hard problem.

Performance Evaluation

We evaluated TACCL on two prominent hardware platforms: the Nvidia DGX-2 (16 V100 GPUs via NVSwitch) and Azure NDv2 clusters (8-GPU nodes via InfiniBand). Our benchmarks focused on three core primitives: ALLGATHER, ALLTOALL, and ALLREDUCE.

Key Results:

  • Microbenchmark Speedups: TACCL-synthesized algorithms achieved up to a 6.7× speedup over NCCL for ALLGATHER on DGX-2 nodes. For ALLTOALL on Azure NDv2, TACCL improved performance by up to 66%.
  • End-to-End Training: Integrating TACCL into PyTorch resulted in significant training speedups for large-scale models. Transformer-XL and BERT training times were reduced by 11% to 2.3×, depending on the batch size.
  • Scalability: Unlike previous synthesis tools limited to small node counts, TACCL successfully generated algorithms for clusters of up to 128 GPUs.

Discussion and Future Work

TACCL demonstrates that combining human intuition (via sketches) with automated solver precision can produce communication algorithms that far exceed the performance of hand-tuned libraries. By moving away from rigid ring-based topologies, TACCL better utilizes the heterogeneous bandwidth available in modern clusters.

Future work aims to reduce synthesis time—currently around 11 hours for 128 GPUs—to enable more dynamic optimization. Additionally, we plan to incorporate support for advanced "fused" GPU instructions to further close the performance gap in specific ALLREDUCE scenarios where NCCL's specialized kernels remain highly competitive.

Summary updated

BibTeX
@misc{shah2021synthesizing,
  author = {Aashaka Shah and Vijay Chidambaram and Meghan Cowan and Saeed Maleki and Madan Musuvathi and Todd Mytkowicz and Jacob Nelson and Olli Saarikivi and Rachee Singh},
  title = {{Synthesizing Collective Communication Algorithms for Heterogeneous Networks with TACCL}},
  year = {2021},
  eprint = {2111.04867},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.04867},
}

Loading related content...

Figure