TL;DR
This paper tackles the performance bottleneck of global synchronizations in parallel iterative algorithms, which are crucial for checking convergence. The authors introduce a novel "p-amortized" control technique that significantly reduces the number of these expensive synchronizations, bringing them close to the theoretical minimum, while ensuring the algorithm's output remains identical to the standard sequential version.
What Problem Does This Paper Address?
Parallel synchronous iterative algorithms, commonly used in scientific computing, repeatedly perform calculations until a convergence criterion is met. This criterion is typically checked using a "stopping test." In parallel environments, especially on distributed systems like clusters or grids, these stopping tests often require a "global synchronization." This means all processors must communicate and agree on the test result, which is a very expensive operation, especially as the number of processors increases. This overhead can severely degrade performance. The problem is to reduce the frequency of these costly global synchronizations without altering the algorithm's convergence properties or the final results.
Methods
The paper proposes a new "p-amortized" control technique. This method is inspired by algorithms for detecting periodicity in sequences (Floyd's and Brent's). Instead of checking the stopping criterion after every single iteration, the p-amortized method performs these checks at "amortized" steps, defined by a function f(i) and a parameter p (where 1 < p < 2).
The technique is divided into two phases:
- First Phase: Stopping tests are performed at steps
p^f(0), p^f(1), ..., p^f(k). The algorithm stops this phase at the first indexkwhere the stopping test is met. This phase requiresk+1tests and results inp^(k+1)iterations. - Second Phase: A dichotomic search is employed to pinpoint the exact iteration
niterwhere convergence occurred, within the interval[p^f(k), p^(f(k+1))]. This phase involves re-computing intermediate iterations but only performing a stopping test at the midpoint of the search interval.
The paper analyzes different choices for the function f(i) (e.g., i^a, log i, i/log* i) to optimize for either minimal synchronization cost or minimal iteration cost.
Datasets
Not discussed in the paper. The evaluation is based on theoretical analysis and a synthetic benchmark.
Key Insights and Ideas
- Amortization is Key: The core idea is to "amortize" the cost of expensive global synchronizations over multiple iterations. By performing tests less frequently but strategically, the overall cost can be drastically reduced.
- Preserving Semantic: A crucial aspect is that the proposed method doesn't change the underlying iterative algorithm's structure or its convergence behavior. This ensures that the final results are identical to those obtained by the standard, non-optimized algorithm.
- Trade-off Optimization: The paper highlights that there's a trade-off between the number of synchronizations and the number of extra computations. Different choices of the function
f(i)allow tuning this trade-off to suit specific needs. - Near-Optimal Synchronization: The p-amortized method can reduce the number of synchronizations to be asymptotically close to the theoretical lower bound of
log(niter), which is a significant improvement over checking every iteration.
Key Results
The theoretical analysis shows that the p-amortized method can determine the exact number of iterations niter with a number of stopping tests that is asymptotically close to log(niter). Simultaneously, the number of performed iterations remains close to the optimal niter + o(niter).
Experimental results on a synthetic benchmark, using a template MPI program, demonstrated a clear gain in execution time due to reduced synchronization. For instance, with a "Reduced Allgather" optimization, a gain of approximately 2 seconds was observed, and the authors suggest this gain would be amplified on larger, less interconnected systems. The k-step algorithm with a small k also showed promising results in terms of saved synchronization time.
Limitations and Future Work
- Theoretical Focus: While a synthetic benchmark was used, the primary contribution is theoretical. Real-world applications might introduce complexities not fully captured by the model.
- Parameter
pChoice: The optimal choice of the parameterpand the functionf(i)depends on factors like the expected number of iterations (niter) and the relative costs of computation (tcomp) versus synchronization (tsynch). - Future Work: The paper suggests that further exploration of different functions
f(i)and their impact on performance, as well as testing on more complex real-world applications, would be valuable. The authors also imply that the robustness of these methods in the face of varying hardware performance and communication latencies is a key advantage for future implementations.
Summary updated