A Multi-GPU Aggregation-Based AMG Preconditioner for Iterative Linear Solvers

Massimo Bernaschi, Alessandro Celestini, Flavio Vella, Pasqua D'Ambra

Abstract

We present an open-source sparse linear solver designed for heterogeneous parallel architectures. By extending the BootCMatchG library to a multi-GPU environment using a hybrid MPI-CUDA framework, we address the challenges of solving massive sparse linear systems. Our approach utilizes a decoupled aggregation strategy for Algebraic MultiGrid (AMG) preconditioning, which minimizes communication overhead while maintaining high computational efficiency. Experimental results on the Piz Daint supercomputer demonstrate that our solver achieves up to a 2.0x speedup in the solve phase compared to NVIDIA’s AmgX library, with robust scalability up to 100 nodes and 200 million unknowns.

Introduction

The solution of large, sparse linear systems of the form $Ax = b$ is a fundamental bottleneck in scientific simulations, ranging from climate modeling to structural mechanics. While the advent of Graphics Processing Units (GPUs) has significantly accelerated these computations, the memory requirements of modern problems often necessitate the use of multiple GPUs across distributed nodes.

Transitioning from a single-GPU to a multi-GPU environment introduces the "communication wall." Sparse matrix operations are characterized by irregular memory access patterns, making it difficult to overlap computation with the inter-node communication required by Message Passing Interface (MPI). This paper details the development of a multi-GPU version of the BootCMatchG library, designed to overcome these scaling hurdles through innovative data structures and aggregation strategies.

Methodology

The core of our solver is a Flexible Conjugate Gradient (FCG) method accelerated by an Algebraic MultiGrid (AMG) preconditioner. The efficiency of AMG on parallel systems depends heavily on the "coarsening" process, where the problem size is reduced across multiple levels.

Decoupled Aggregation

To avoid the high communication costs associated with global coarsening, we employ a decoupled aggregation strategy. In this model, each GPU independently performs aggregation on its local portion of the matrix. While this ignores potential connections between unknowns residing on different GPUs, our results show that the resulting loss in convergence speed is negligible compared to the massive gains in parallel efficiency. This approach simplifies the setup phase and allows for "embarrassingly parallel" execution across nodes.

Segmented CSR and Task Overlapping

We introduced a Segmented Compressed Sparse Row (CSR) data structure to optimize the Sparse Matrix-Vector Multiplication (SpMV) kernels. This structure explicitly separates local rows (those requiring only local GPU data) from boundary rows (those requiring data from neighboring GPUs). By using CUDA streams, we can initiate the transfer of boundary data via MPI while the GPU simultaneously processes the local rows. This effectively "hides" communication latency behind useful computation.

Optimized Galerkin Products

The generation of coarse-grid matrices involves triple-matrix products ($P^T A P$). We optimized these Galerkin products to ensure that at least one of the sparse matrix-matrix (SpMM) multiplications remains entirely local to the GPU, further reducing the need for expensive inter-node synchronization.

Experimental Results

The solver was evaluated using a 3D Poisson equation benchmark on the Piz Daint supercomputer, utilizing up to 100 nodes, each equipped with an NVIDIA Tesla P100 GPU.

Scalability and Efficiency

The solver demonstrated excellent weak scaling. When increasing the problem size in proportion to the number of GPUs (up to 200 million unknowns), the number of iterations required for convergence increased by only 36%, despite a 100-fold increase in problem scale.

Comparison with NVIDIA AmgX

In head-to-head performance tests, our solver (BCMG) consistently outperformed the industry-standard NVIDIA AmgX library. Specifically:

  • Solve Phase Speed: BCMG was between 1.6x and 2.0x faster than AmgX in the solve phase.
  • Operator Complexity: BCMG maintains a lower operator complexity than AmgX, meaning it requires less memory and fewer floating-point operations per iteration. This is a critical advantage for memory-bandwidth-bound GPU architectures.

Discussion and Limitations

The primary trade-off in our approach is the setup time. Because BCMG utilizes a sophisticated Maximum Weight Matching (MWM) algorithm for coarsening and performs explicit matrix products, the initial setup is slower than the simpler heuristics employed by AmgX. However, for applications where the same system must be solved repeatedly—such as in time-dependent physical simulations—the superior speed of the solve phase provides a significant net gain in performance.

Conclusion

The multi-GPU BootCMatchG library provides a highly efficient, open-source solution for large-scale sparse linear systems. By prioritizing local GPU efficiency and overlapping communication with computation, we have demonstrated that AMG preconditioners can scale effectively on modern heterogeneous clusters. Future work will focus on refining the coarsest-level solvers and implementing more robust smoothing operators to further enhance convergence rates.

Source Code: The library is available on GitHub at https://github.com/bootcmatch/BootCMatchGX.

Summary updated

BibTeX
@article{bernaschi2023multi,
  author = {Massimo Bernaschi and Alessandro Celestini and Flavio Vella and Pasqua D'Ambra},
  title = {{A Multi-GPU Aggregation-Based AMG Preconditioner for Iterative Linear Solvers}},
  journal = {IEEE TPDS},
  year = {2023},
  doi = {10.1109/tpds.2023.3287238},
}
Figure