Abstract
The MPI_Allreduce collective operation is a core kernel of many parallel codebases, particularly for reductions over a single value per process. The commonly used allreduce recursive-doubling algorithm obtains the lower bound message count, yielding optimality for small reduction sizes based on node-agnostic performance models. However, this algorithm yields duplicate messages between sets of nodes. Node-aware optimizations in MPICH remove duplicate messages through use of a single master process per node, yielding a large number of inactive processes at each inter-node step. In this paper, we present an algorithm that uses the multiple processes available per node to reduce the maximum number of inter-node messages communicated by a single process, improving the performance of allreduce operations, particularly for small message sizes.
Introduction
In high-performance computing (HPC), the MPI_Allreduce operation—which combines data from all processes and distributes the result back to every participant—is a critical bottleneck for applications such as neural network training and large-scale linear solvers. As systems scale toward exascale, the communication overhead often dominates total execution time.
Traditional algorithms like recursive-doubling are "node-agnostic," treating every process as equidistant regardless of whether they reside on the same physical node or across a network. This leads to redundant, expensive messages being sent over the network. While existing "node-aware" solutions attempt to address this by using a single "master" process per node to handle network traffic, this approach leaves most processes idle and fails to fully utilize the node's available network injection bandwidth.
The NAP Allreduce Algorithm
The authors propose the Node-Aware Parallel (NAP) Allreduce algorithm to overcome these limitations. The key innovation of NAP is the parallelization of the inter-node communication step. Instead of relying on a single master process, NAP utilizes all available processes on a node to handle network communication simultaneously.
The algorithm follows a three-stage approach:
- Intra-node Reduction: Processes within a node use fast shared memory to combine their data. Unlike master-process approaches, the result of this local reduction is made available to every process on the node.
- Parallel Inter-node Communication: Every process on the node communicates with a different remote node in parallel. This effectively changes the number of network steps from $\log_2(n)$ to $\log_{ppn}(n)$, where $n$ is the number of nodes and $ppn$ is the number of processes per node.
- Final Intra-node Step: A final local exchange ensures that all processes receive the global result.
This approach minimizes the maximum number of inter-node messages any single process must handle, which is the primary cost driver for small data transfers where latency is the dominant factor.
Experimental Results
The researchers evaluated the NAP algorithm on the Blue Waters supercomputer, a Cray XE6/XK7 system. The benchmarks were conducted using up to 32,768 processes (2,048 nodes with 16 processes each), comparing NAP against standard recursive-doubling and the SMP-aware allreduce implementation in MPICH.
Key findings include:
- Significant Speedups: NAP achieved nearly a 2x speedup over standard recursive-doubling for small message sizes (e.g., a single double-precision value) at high process counts.
- Efficiency Range: The algorithm outperformed existing methods for message sizes up to approximately 2048 bytes.
- Scalability: As the number of processes increased, the performance gap between NAP and traditional methods widened, demonstrating its efficacy for future exascale systems.
Conclusion and Future Work
The NAP Allreduce algorithm exploits the physical hierarchy of modern supercomputers by shifting the communication burden to local shared-memory operations and parallelizing network injection. While highly effective for small-to-medium messages, the algorithm is eventually limited by the node's network injection hardware for larger data sizes (greater than 2KB).
Future work includes applying similar "node-aware parallel" logic to other collective operations, such as MPI_Allgather, and further optimizing the algorithm for heterogeneous architectures, including systems with multiple GPUs per node.
Summary updated