Revisiting the Time Cost Model of AllReduce
Dian Xiong, Li Chen, Youhe Jiang, Dan Li, Shuai Wang, Songtao Wang
TL;DR
This work updates the standard AllReduce time-cost model by introducing GenModel, which adds memory-access δ and incast ε terms to the traditional αβγ cost, yielding a more accurate end-to-end cost with T = Aα + Bβ + Cγ + Dδ + max(w-w_t,0) B ε. It then leverages GenModel to develop GenTree, a heuristic plan generator for tree-like topologies, and proves that optimal plan generation on arbitrary topologies is NP-hard. Through extensive real-world and simulated evaluations, GenModel demonstrates markedly improved predictive accuracy (≈2.6% vs up to ≈19.8% for αβγ) and GenTree delivers significant speedups over NCCL and other state-of-the-art approaches across various network configurations and scales (up to 7.4x in simulations, 1.65x on GPUs, and 2.4x on CPUs). The practical impact is a more reliable framework for designing and selecting AllReduce algorithms tailored to modern clusters, with open-source tools for fitting GenModel and running simulations to reproduce results.
Abstract
AllReduce is an important and popular collective communication primitive, which has been widely used in areas such as distributed machine learning and high performance computing. To design, analyze, and choose from various algorithms and implementations of AllReduce, the time cost model plays a crucial role, and the predominant one is the $(α,β,γ)$ model. In this paper, we revisit this model, and reveal that it cannot well characterize the time cost of AllReduce on modern clusters; thus must be updated. We perform extensive measurements to identify two additional terms contributing to the time cost: the incast term and the memory access term. We augment the $(α,β,γ)$ model with these two terms, and present GenModel as a result. Using GenModel, we discover two new optimalities for AllReduce algorithms, and prove that they cannot be achieved simultaneously. Finally, striking the balance between the two new optimalities, we design GenTree, an AllReduce plan generation algorithm specialized for tree-like topologies. Experiments on a real testbed with 64 GPUs show that GenTree can achieve 1.22$\times$ to 1.65$\times$ speed-up against NCCL. Large-scale simulations also confirm that GenTree can improve the state-of-the-art AllReduce algorithm by a factor of $1.2$ to $7.4$ in scenarios where the two new terms dominate.
