Abstract
Algebraic Multigrid (AMG) is one of the most used iterative algorithms for solving large sparse linear equations $Ax=b$. In AMG, the coarse grid is a key component that affects the efficiency of the algorithm, the construction of which relies on the strong threshold parameter $\theta$. This parameter is generally chosen empirically, with a default value in many current AMG solvers of 0.25 for 2D problems and 0.5 for 3D problems. However, for many practical problems, the quality of the coarse grid and the efficiency of the AMG algorithm are sensitive to $\theta$; the default value is rarely optimal, and sometimes is far from it. Therefore, how to choose a better $\theta$ is an important question. In this paper, we propose a deep learning based auto-tuning method, AutoAMG($\theta$) for multiscale sparse linear equations, which are widely used in practical problems. The method uses Graph Neural Networks (GNNs) to extract matrix features, and a Multilayer Perceptron (MLP) to build the mapping between matrix features and the optimal $\theta$, which can adaptively output $\theta$ values for different matrices. Numerical experiments show that AutoAMG($\theta$) can achieve significant speedup compared to the default $\theta$ value.
1. Introduction
Solving large, sparse linear equations ($Ax = b$) is a fundamental bottleneck in scientific computing, spanning fields from fluid dynamics to radiation physics. The Algebraic Multigrid (AMG) algorithm is a popular choice for these problems due to its efficiency. However, AMG’s practical performance relies heavily on the "coarsening" step, which is controlled by the strong threshold ($\theta$) parameter.
Traditionally, $\theta$ is selected based on empirical rules of thumb—typically 0.25 for 2D problems and 0.5 for 3D problems. While these defaults suffice for simple cases, they often fail for "multiscale" matrices where coefficients vary significantly due to material discontinuities or anisotropy. In such scenarios, the relationship between $\theta$ and solver iterations is not smooth; it is a jagged landscape where minor changes in $\theta$ can cause the solver to either converge rapidly or stall completely.
Finding the optimal $\theta$ manually via grid search is computationally prohibitive for every new problem. This paper introduces AutoAMG($\theta$), a deep learning-based pipeline that adaptively selects the optimal $\theta$ for a given matrix.
2. Methodology
The AutoAMG($\theta$) framework treats the sparse matrix as a graph and utilizes a specialized neural network architecture to predict the optimal threshold.
2.1 Model Architecture
The pipeline consists of two primary components: feature extraction and parameter mapping.
- Feature Extraction (GCIN): Standard Graph Neural Networks (GNNs) like GCN or GIN often struggle with the numerical instability inherent in multiscale matrices. To address this, we developed the Graph Convolutional Isomorphism Network (GCIN). GCIN combines the expressive power of GIN with a specialized normalization strategy in the "Readout" function to handle the wide range of values found in scientific datasets.
- Mapping to $\theta$: The high-dimensional features extracted by the GCIN are passed through a Multilayer Perceptron (MLP) that directly outputs the predicted optimal $\theta$.
2.2 Training
The model is trained using supervised learning. Ground truth optimal $\theta$ values are obtained through exhaustive grid searches on a representative set of smaller sample matrices. The network is optimized to minimize the Mean Squared Error (MSE) between its predictions and these optimal values.
3. Experimental Results
We evaluated AutoAMG($\theta$) on several challenging datasets, including 2D/3D diffusion equations and high-fidelity 3D radiation diffusion equations from inertial confinement fusion simulations (featuring up to 6.29 million rows).
3.1 Performance Gains
AutoAMG($\theta$) consistently outperformed empirical defaults across all test cases:
- 2D Diffusion: 1.81x speedup over $\theta = 0.25$.
- 3D Diffusion: 4.47x speedup over $\theta = 0.5$.
- 3D Radiation Diffusion: A significant 11.63x speedup compared to the default value.
3.2 Efficiency and Generalization
The inference overhead is negligible; the GNN requires approximately 0.26 seconds to predict $\theta$, which is trivial compared to the tens of seconds saved during the solver phase. Furthermore, the model demonstrates strong small-to-large generalization: a network trained on matrices with thousands of rows successfully predicts optimal parameters for matrices with millions of rows, suggesting it learns scale-invariant local connectivity patterns.
4. Conclusion
AutoAMG($\theta$) demonstrates that deep learning can effectively replace empirical heuristics in scientific computing. By leveraging GNNs to understand matrix structure, we can significantly accelerate AMG solvers for complex multiscale problems. Future work will explore auto-tuning other critical AMG components, such as smoothing and interpolation operators, to develop fully autonomous linear solvers.
Summary updated