Tradeoff to minimize extra-computations and stopping criterion tests for parallel iterative schemes

Olivier Beaumont, El Mostafa Daoudi, Nicolas Maillard, Pierre Manneback, Jean-Louis Roch2004

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:

  1. 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 index k where the stopping test is met. This phase requires k+1 tests and results in p^(k+1) iterations.
  2. Second Phase: A dichotomic search is employed to pinpoint the exact iteration niter where 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 p Choice: The optimal choice of the parameter p and the function f(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

Abstract

Parallel synchronous iterative algorithms are often penalized by global synchro- nization, due to the cost of stopping tests that are achieved. It is well known that such global synchronizations are expensive for parallel implementations on distrib- uted systems, especially on clusters of processors or computational grids, where the heterogeneity and the number of processors imply a large overhead for this global operation. The aim of this work is to propose a new control technique for the stopping tests, original to the best of our knowledge, which enables to reduce the number of global synchronization near to the optimum, while keeping the number of iterations close to the number performed by standard synchronous algorithm. The main advantage of the proposed technique is that the semantic of the sequential al- gorithm is not modified, so that convergence is preserved and identical outputs are guaranteed. Our method is based on an amortized technique inspired by Floyd's and Brent's algorithms to detect periodicity in a sequence.
BibTeX
@misc{beaumont2004tradeoff,
  author = {Olivier Beaumont and El Mostafa Daoudi and Nicolas Maillard and Pierre Manneback and Jean-Louis Roch},
  title = {{Tradeoff to minimize extra-computations and stopping criterion tests for parallel iterative schemes}},
  year = {2004},
}
Figure