arXiv:2611.12475cs.LGNov 2026

Manuscript Offprint

arXiv:2611.12475

Learning to Select Sparse Linear Solvers with Convolutional Neural Networks

Artemis Pados, Alan Edelman, Emmanuel Lujan, Daniel Pickard, Felipe Tome, Christopher Rackauckas

Artemis Pados1,4^{1,4}, Alan Edelman2,5^{2,5}, Emmanuel Lujan2,6^{2,6}, Daniel Pickard3,7^{3,7}, Felipe Tome2,8^{2,8}, and Christopher Rackauckas2,9^{2,9}

1^{1}Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, USA.

2^{2}Computer Science & Artificial Intelligence Laboratory, Massachusetts Institute of Technology, USA.

3^{3}Department of Aeronautics and Astronautics, Massachusetts Institute of Technology, USA.

4^{4} apados@mit.edu 5^{5}edelman@mit.edu 6^{6}eljn@mit.edu 7^{7}pickard@mit.edu 8^{8}felipe0@mit.edu 9^{9}crackauc@mit.edu

Abstract—We investigate convolutional-neural-network (CNN) based automatic solver selection for sparse linear systems, a problem of practical importance where solver performance varies dramatically with matrix sparsity structure. A CNN is trained to regress log timing ratios between candidate solvers using spy plot images of matrix nonzero structure as input, achieving strong prediction accuracy on both held-out SuiteSparse matrices and real-world matrices from high-performance simulation codes.

Index Terms—Sparse matrices, linear systems, convolutional neural network, scientific computing

I. INTRODUCTION

Sparse linear systems of the form Ax=b\mathbf{A}\mathbf{x} = \mathbf{b} where A∈Rn×n\mathbf{A} \in \mathbb{R}^{n \times n} is a large sparse matrix arise throughout scientific computing, from finite element analysis and circuit simulation to fluid dynamics and structural mechanics applications. The efficiency of solving such systems is critical to the scientific application and the choice of direct solver can have a dramatic impact. For the same matrix, different solvers can vary in wall-clock time by orders of magnitude, ranging from milliseconds to several seconds [1].

Julia [2] has emerged as a leading language for high-performance scientific computing, combining the productivity of high-level languages with the performance of compiled code. Its LinearSolve.jl [3] package provides a unified interface to multiple high-performance direct sparse solvers. Despite this flexibility, current software, including MATLAB, Python/SciPy, and Julia, relies on fixed default backends regardless of the structural properties of the input matrix. This means that users who do not manually benchmark solvers on their specific matrices are likely leaving significant performance gains on the table.

In this paper, we propose the use of convolutional neural networks (CNNs) as a data-driven approach to automatic solver selection, trained to regress log timing ratios collected across a large corpus of sparse matrices from the SuiteSparse Matrix Collection [4]. Further, we release NeuralLinearSolve.jl 1^{1}, an open-source Julia package integrating the trained model bundled with frozen weights into the SciML ecosystem 2^{2} and the broader SMARTSOLVE effort [5] at the MIT Julia Lab, exposing solver recommendations via a single function call with no benchmarking or domain expertise required.