Multi-Level GNN Preconditioner for Solving Large Scale Problems

Matthieu Nastorg, Jean-Marc Gratien, Thibault Faney, Michele Alessandro Bucci, Guillaume Charpiat, Marc SchoenauerWorkshops @ IPDPS 2024

TL;DR

This paper introduces DDM-GNN, a novel hybrid solver that combines Graph Neural Networks (GNNs) with multi-level Domain Decomposition methods to efficiently solve large-scale Partial Differential Equations (PDEs). By leveraging GNNs for local sub-problem solving and a Conjugate Gradient method for global convergence, DDM-GNN offers a scalable and accurate approach that can be integrated into existing HPC frameworks.

What Problem Does This Paper Address?

Solving Partial Differential Equations (PDEs) is fundamental to many scientific and engineering simulations, but it often requires immense computational resources, especially for large-scale problems. While High-Performance Computing (HPC) has made strides, adapting legacy codes to leverage parallel GPU computations remains a challenge. Traditional numerical solvers guarantee accuracy but can be slow and struggle with scalability. Conversely, Machine Learning (ML) models, particularly Graph Neural Networks (GNNs), can harness GPU power and learn from unstructured data like meshes, but they often suffer from limited generalization and accuracy, especially on problems outside their training distribution or at scales beyond their design. This paper aims to bridge this gap by creating a hybrid solver that combines the strengths of both traditional and data-driven methods.

Methods

The core innovation is the DDM-GNN preconditioner, which integrates a GNN model into a multi-level Domain Decomposition (DD) framework. This approach builds upon the Additive Schwarz Method (ASM), a common DD technique. Instead of using traditional solvers for the local sub-problems within the ASM, DDM-GNN employs a Deep Statistical Solver (DSS), a GNN-based approach designed for solving PDEs on unstructured grids.

Here's how it works:

  1. Domain Decomposition: The global computational domain is divided into smaller, overlapping sub-domains.
  2. GNN for Local Solvers: For each sub-domain, a DSS model (trained on similar PDE problems) is used to solve the local Poisson problem. This leverages the parallel processing capabilities of GPUs.
  3. Krylov Method for Global Convergence: A Conjugate Gradient (CG) method is used as the outer solver. The DDM-GNN preconditioner acts on the residual of the CG method, providing a correction that significantly speeds up convergence.
  4. Multi-Level Approach: To ensure scalability, a two-level DD strategy is employed, including a coarse-grid correction, which helps the method scale well with an increasing number of sub-domains.
  5. DSS Model Adaptation: The DSS model is adapted to use node distances as edge attributes, allowing it to handle graphs of varying sizes and shapes more effectively than previous DSS versions. This also means the linear system generation is only needed for training, not for inference.

Datasets

The paper generates its own dataset for training and evaluation.

  • Training Data: Random 2D domains are created using GMSH to discretize them into unstructured triangular meshes with 6000-8000 nodes. Poisson problems are solved on these meshes with random forcing and boundary functions. The dataset consists of local Poisson problems extracted from the iterations of a two-level ASM preconditioned CG solver.
  • Benchmark Data: For performance evaluation, larger meshes are generated by increasing the radius of the training domains. These larger meshes are then partitioned into sub-meshes of approximately 1000 nodes.

Key Insights and Ideas

  • Hybridization is Key: The paper demonstrates that combining the robustness of traditional iterative solvers (like CG) with the speed and GPU-accelerated capabilities of GNNs for local problems is a powerful strategy for tackling large-scale PDEs.
  • GNNs as Efficient Preconditioners: GNNs, when integrated into a DD framework, can act as highly effective preconditioners, significantly reducing the number of iterations required for Krylov methods to converge.
  • Scalability Through DD: The multi-level Domain Decomposition approach is crucial for ensuring that the GNN-based solver remains scalable, both in terms of problem size and the number of sub-domains.
  • Generalization Beyond Training: The adapted DSS model shows promising generalization capabilities, performing well even on problems with sub-mesh sizes and geometries that differ from the training data.
  • Inference Bottleneck: A significant challenge identified is the performance of GNN inference engines in C++ for HPC applications, which currently lags behind specialized solvers.

Key Results

  • Convergence: The proposed PCG-DDM-GNN solver consistently converges to the desired precision (relative residual norm of 10⁻⁶) across various configurations and problem sizes.
  • Efficiency: DDM-GNN significantly reduces the number of iterations compared to a standard CG solver without preconditioning. The iteration count difference between DDM-GNN and DDM-LU (using a direct LU solver for local problems) is minimal, often less than 10 iterations.
  • Scalability: The method shows good scalability, with iteration counts being less sensitive to global problem size compared to traditional preconditioners like Incomplete Cholesky.
  • Performance: While the GNN-based approach is competitive in terms of iterations, the overall execution time is currently impacted by the efficiency of the GNN inference engine in C++. The paper highlights that the best performance (balancing accuracy and speed) was achieved with a DSS model corresponding to k=10 and d=10.
  • Out-of-Distribution Performance: The hybrid solver successfully handles large-scale, out-of-distribution problems (e.g., a Formula 1 mesh) with precision levels lower than those used for training the DSS model.

Limitations and Future Work

  • Inference Engine Maturity: The primary limitation is the current state of C++ inference engines for GNNs in HPC. Existing engines are not yet mature enough to fully exploit the potential of GNNs for high-performance computing, leading to a significant portion of the execution time being spent on inference.
  • Future Work:
    • Improving Inference: Future work will focus on developing more efficient inference engines for GNN structures, potentially by contributing to projects like TensorRT or ONNX.
  • Industrial CFD Integration: The authors plan to integrate the DDM-GNN approach into industrial CFD codes (like OpenFOAM) to assess its impact on performance acceleration in real-world applications.
  • Further Hyperparameter Tuning: Continued exploration of DSS hyperparameters (k and d) could further optimize the trade-off between accuracy and inference speed.

Summary updated

BibTeX
@inproceedings{nastorg2024multi,
  author = {Matthieu Nastorg and Jean-Marc Gratien and Thibault Faney and Michele Alessandro Bucci and Guillaume Charpiat and Marc Schoenauer},
  title = {{Multi-Level GNN Preconditioner for Solving Large Scale Problems}},
  booktitle = {Workshops @ IPDPS},
  year = {2024},
}
Figure