Benchmark to measure the ability of AI models or harnesses to write fast, accurate, and general numerical solvers for large sparse linear systems.
See the codeLinearSolverBench measures the ability of an AI model or a harness to write fast, accurate, and general numerical solvers for large sparse linear systems in C. The goal is to:
Large systems of linear equations underpin some of the most important scientific and engineering problems across multiple domains. Some examples, together with problem families represented in the SuiteSparse Matrix Collection, include (but not limited to):
These applications do not all produce the same kind of matrices.
Algorithmic progress in solving linear systems directly translates into advances in respective fields and is a net positive for society. Therefore, it is imperative to invest human and computational resources on discovering novel algorithms for our toughest problems. Large language models make it possible for the first time to do this at scale.
The language of choice is C with HYPRE as the main linear algebra library. HYPRE is one of the most widely used library, both in academia and industry, for building high-preformance solvers for large sparse linear systems and offers excellent low-level primitives, APIs, and stock preconditioning and solver algorithms that can be used to build novel solver algorithms. In other words, it offers the best batteries-included search space for a model or an agent without having to invent a new DSL for this task.
The benchmark currently supports the following families of matrices:
| Family | Input systems |
|---|---|
ns_mesh_pde | Nonsymmetric SuiteSparse mesh and PDE matrices; scored by the number of cases solved |
magnetic_diffusion_flash | Captured magnetic diffusion replays from FLASH; scored by speedup over the fixed reference |
Python 3.12, a C/C++ compiler, CMake, Ninja, Git, and nm are required.
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
linear-solver-bench run solver.c --family ns_mesh_pde --venue local \
--case ss-225-rademacher-0
Here, solver.c is your candidate source file. The fixed solver at
reference/solver.c shows the interface but uses HYPRE
operations reserved for the reference, so it cannot be run as a candidate.
The local venue is mainly for testing. Its first run downloads the selected
inputs and builds the HYPRE runtime; both are cached under
~/.cache/linear-solver-bench.
Configure your Modal account, then select the Modal venue:
linear-solver-bench run solver.c --family ns_mesh_pde --venue modal \
--output result.json
linear-solver-bench run solver.c --family magnetic_diffusion_flash --venue modal \
--output magnetic-diffusion-result.json
Candidates are one C file exporting solver_create. See
reference/solver.c for the interface and read
BENCHMARK.md for the ABI, allowed HYPRE operations, timing
boundary, and accuracy rules.
linear-solver-bench submit solver.c --name my-solver \
--family ns_mesh_pde --submitter 'Your Name' \
--output my-solver-submission
Commit the generated three-file directory and open a pull request. Private test data and leaderboard are maintained outside this repository.
Benchmark code is Apache-2.0. HYPRE-derived declarations retain their MIT notice. SuiteSparse matrices retain their original attribution; see the benchmark-family README files.
1 commits
Python
82.0%
C++
11.8%
C
5.4%
Benchmark to measure the ability of AI models or harnesses to write fast, accurate, and general numerical solvers for large sparse linear systems.
See the codeLinearSolverBench measures the ability of an AI model or a harness to write fast, accurate, and general numerical solvers for large sparse linear systems in C. The goal is to:
Large systems of linear equations underpin some of the most important scientific and engineering problems across multiple domains. Some examples, together with problem families represented in the SuiteSparse Matrix Collection, include (but not limited to):
These applications do not all produce the same kind of matrices.
Algorithmic progress in solving linear systems directly translates into advances in respective fields and is a net positive for society. Therefore, it is imperative to invest human and computational resources on discovering novel algorithms for our toughest problems. Large language models make it possible for the first time to do this at scale.
The language of choice is C with HYPRE as the main linear algebra library. HYPRE is one of the most widely used library, both in academia and industry, for building high-preformance solvers for large sparse linear systems and offers excellent low-level primitives, APIs, and stock preconditioning and solver algorithms that can be used to build novel solver algorithms. In other words, it offers the best batteries-included search space for a model or an agent without having to invent a new DSL for this task.
The benchmark currently supports the following families of matrices:
| Family | Input systems |
|---|---|
ns_mesh_pde | Nonsymmetric SuiteSparse mesh and PDE matrices; scored by the number of cases solved |
magnetic_diffusion_flash | Captured magnetic diffusion replays from FLASH; scored by speedup over the fixed reference |
Python 3.12, a C/C++ compiler, CMake, Ninja, Git, and nm are required.
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
linear-solver-bench run solver.c --family ns_mesh_pde --venue local \
--case ss-225-rademacher-0
Here, solver.c is your candidate source file. The fixed solver at
reference/solver.c shows the interface but uses HYPRE
operations reserved for the reference, so it cannot be run as a candidate.
The local venue is mainly for testing. Its first run downloads the selected
inputs and builds the HYPRE runtime; both are cached under
~/.cache/linear-solver-bench.
Configure your Modal account, then select the Modal venue:
linear-solver-bench run solver.c --family ns_mesh_pde --venue modal \
--output result.json
linear-solver-bench run solver.c --family magnetic_diffusion_flash --venue modal \
--output magnetic-diffusion-result.json
Candidates are one C file exporting solver_create. See
reference/solver.c for the interface and read
BENCHMARK.md for the ABI, allowed HYPRE operations, timing
boundary, and accuracy rules.
linear-solver-bench submit solver.c --name my-solver \
--family ns_mesh_pde --submitter 'Your Name' \
--output my-solver-submission
Commit the generated three-file directory and open a pull request. Private test data and leaderboard are maintained outside this repository.
Benchmark code is Apache-2.0. HYPRE-derived declarations retain their MIT notice. SuiteSparse matrices retain their original attribution; see the benchmark-family README files.
1 commits
Python
82.0%
C++
11.8%
C
5.4%