Abstract
Collective operations are among the most important communication operations in shared- and distributed-memory parallel applications. In this paper, we analyze the tradeoffs between energy, memory, and runtime of different algorithms to implement such operations. We show that each existing algorithms have varying behavior and no algorithm exists that is optimal in all three regards. We also show examples where of three different algorithms solving the same problem, each algorithm is best in a different metric. We conclude by posing the challenge to explore the resulting tradeoffs in a more structured manner.
Introduction
In high-performance computing (HPC), collective communication operations—such as Broadcast, Allreduce, and Barrier—are fundamental to the performance of parallel applications. Traditionally, the optimization of these operations has focused almost exclusively on minimizing execution time. However, the modern computing landscape is shifting. Large-scale systems are increasingly constrained by power budgets, and the advent of network offloading allows communication tasks to be handled by Network Interface Cards (NICs), which possess significantly less memory than host CPUs.
This paper addresses the need for a multi-objective optimization framework that considers runtime, energy consumption, and memory usage. We demonstrate that the fastest algorithm is rarely the most energy-efficient or memory-light, necessitating a structured approach to selecting algorithms based on specific hardware constraints.
Modeling Framework
To evaluate these tradeoffs, we employ three analytical models to provide a generalized framework:
- Runtime (LogGP): A standard model in parallel computing that accounts for Latency ($L$), overhead ($o$), the gap between messages ($g$), and bandwidth ($G$).
- Energy: Energy is modeled as a combination of static leakage and dynamic costs. Dynamic energy is calculated as a fixed cost per message ($e$) plus a cost per byte transported ($E$).
- Memory: For offloaded operations, memory usage is measured by the number of message descriptors required, where each descriptor has a constant size ($d$).
Algorithm Analysis
We apply these models to various classes of algorithms, including flat trees, $k$-ary regular trees, and irregular trees (e.g., Binomial and Fibonacci trees), as well as Butterfly networks.
As shown in Figure 3, different tree topologies lead to varying runtime complexities. For instance, a flat tree (a) minimizes the number of hops but increases the overhead at the root. Binary trees (b and c) distribute this overhead but increase latency due to the deeper structure. Furthermore, the distinction between non-personalized and personalized communication significantly impacts the message count and, consequently, the energy and memory footprint.
Key Tradeoffs
- Butterfly vs. Trees: For operations like Allreduce, the Butterfly algorithm offers superior performance but at the cost of higher dynamic energy consumption and increased memory requirements per node.
- Offloading Constraints: Offload engines often require "constant-space" algorithms. Our analysis shows that these memory-efficient algorithms can be up to 2x slower than their less memory-constrained counterparts, a tradeoff necessary for hardware compatibility.
- Pipelining: While pipelining improves bandwidth utilization by breaking messages into segments, it causes memory consumption to grow linearly with the number of segments, potentially exceeding NIC capacity.
Results and Conclusion
Our case study using InfiniBand parameters ($L=6\mu s, o=4.7\mu s, G=0.73ns/B$) and estimated energy costs ($e=16.5pJ, E=8.1nJ/B$) confirms that no single algorithm is optimal across all metrics. For an 8-byte Allreduce, the Butterfly algorithm was fastest, Binomial trees were most energy-efficient due to lower message overhead, and Binary trees were most memory-efficient.
We conclude that future HPC research must move beyond single-metric optimization. There is a critical need for automated mechanisms to identify Pareto-optimal algorithms that balance runtime, energy, and memory according to the specific requirements of the target architecture.
Summary updated