[Paper Review] Matrix-free GPU implementation of a preconditioned conjugate gradient solver for anisotropic elliptic PDEs
This paper presents a matrix-free, GPU-accelerated Preconditioned Conjugate Gradient (PCG) solver for anisotropic elliptic PDEs arising in numerical weather prediction. By exploiting vertical anisotropy, using matrix-free stencil evaluation, loop fusion, and optimized memory access, the method achieves high throughput and reduced global memory bandwidth, outperforming both sequential CPU and matrix-explicit GPU implementations on large-scale problems.
Many problems in geophysical and atmospheric modelling require the fast solution of elliptic partial differential equations (PDEs) in "flat" three dimensional geometries. In particular, an anisotropic elliptic PDE for the pressure correction has to be solved at every time step in the dynamical core of many numerical weather prediction models, and equations of a very similar structure arise in global ocean models, subsurface flow simulations and gas and oil reservoir modelling. The elliptic solve is often the bottleneck of the forecast, and an algorithmically optimal method has to be used and implemented efficiently. Graphics Processing Units have been shown to be highly efficient for a wide range of applications in scientific computing, and recently iterative solvers have been parallelised on these architectures. We describe the GPU implementation and optimisation of a Preconditioned Conjugate Gradient (PCG) algorithm for the solution of a three dimensional anisotropic elliptic PDE for the pressure correction in NWP. Our implementation exploits the strong vertical anisotropy of the elliptic operator in the construction of a suitable preconditioner. As the algorithm is memory bound, performance can be improved significantly by reducing the amount of global memory access. We achieve this by using a matrix-free implementation which does not require explicit storage of the matrix and instead recalculates the local stencil. Global memory access can also be reduced by rewriting the algorithm using loop fusion and we show that this further reduces the runtime on the GPU. We demonstrate the performance of our matrix-free GPU code by comparing it to a sequential CPU implementation and to a matrix-explicit GPU code which uses existing libraries. The absolute performance of the algorithm for different problem sizes is quantified in terms of floating point throughput and global memory bandwidth.
Motivation & Objective
- To address the performance bottleneck of elliptic solvers in numerical weather prediction (NWP) models, which are computationally expensive due to anisotropic, flat 3D geometries.
- To develop a high-performance, memory-efficient PCG solver for anisotropic elliptic PDEs on GPUs, targeting operational NWP and geophysical modeling workloads.
- To reduce global memory bandwidth and access overhead through matrix-free implementation and loop fusion in the PCG algorithm.
- To demonstrate superior performance over both sequential CPU and matrix-explicit GPU implementations using standard CUDA libraries.
Proposed method
- A matrix-free approach is used to avoid explicit matrix storage, recalculating local stencils on-the-fly during matrix-vector products.
- A physics-informed preconditioner is constructed based on the strong vertical anisotropy of the elliptic operator, improving convergence.
- Loop fusion is applied to interleave multiple PCG operations (e.g., vector updates, dot products, matrix-vector products) into single kernel kernels to reduce memory traffic.
- The implementation uses CUDA kernels with thread-blocks mapping to horizontal grid planes, enabling coalesced memory access and efficient parallelization.
- Global reductions for dot products and norms are performed via BLAS calls on 2D horizontal vectors, minimizing communication cost.
- The solver is designed for scalability, with potential extension to multi-GPU systems via halo exchange, minimizing data transfer overhead.
Experimental results
Research questions
- RQ1How can matrix-free and loop-fused GPU kernels reduce global memory access and improve performance in solving anisotropic elliptic PDEs?
- RQ2What performance gains can be achieved by exploiting vertical anisotropy in the preconditioner for atmospheric and oceanic PDEs?
- RQ3How does the matrix-free GPU PCG solver compare in throughput and memory bandwidth to a matrix-explicit GPU implementation using CUDA libraries?
- RQ4To what extent does loop fusion reduce runtime in the PCG algorithm on GPU architectures?
- RQ5Can the proposed implementation scale efficiently to multi-GPU clusters with minimal inter-device communication?
Key findings
- The matrix-free GPU PCG solver achieves significantly higher floating-point throughput and lower global memory bandwidth usage than both the sequential CPU and matrix-explicit GPU implementations.
- Loop fusion reduces runtime by minimizing redundant memory accesses and improving memory coalescing in the PCG kernel.
- The matrix-free approach eliminates the need for storing large sparse matrices, reducing global memory footprint and improving memory access efficiency.
- The solver demonstrates high performance on large 3D anisotropic problems typical in NWP and subsurface flow simulations, with strong scaling observed on the aquila supercomputer.
- The preconditioner effectively exploits vertical anisotropy, enabling convergence in around 100 iterations, which is competitive with multigrid methods.
- The implementation is shown to be highly efficient in terms of power consumption and absolute performance, making it suitable for operational weather and climate models.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.