SPARSE ACCELERATED RAPID TRIANGULAR ANALYSER
Specialised for the systems finite-element simulations produce, and tuned in many small, measured ways to keep every core busy, so the factorization runs close to the machine's limits on memory bandwidth and arithmetic, on the GPU or CPU. Self-contained, with no external maths libraries, and callable from Python, C/C++, Rust, MATLAB and Julia.
Every part of the solve is designed and measured for mesh problems: the analysis plans the whole factorization once, and the schedule keeps every core doing useful arithmetic, on the GPU or on the CPU.
Config for ordering, supernodes, front geometry and dispatch widthsThe same four steps in each interface: analyze the sparsity pattern, factor, solve and release the GPU memory.
Config.SpartaSolver class used like decomposition, built as a MEX
file. Not yet tested in MATLAB.Solver type with \ and factorize!, calling the
library directly.pip install sparta-solver installs a prebuilt wheel on macOS, Linux
and Windows, with no compiler needed.import numpy as np from scipy.sparse import csc_matrix import sparta A = csc_matrix([[4.0, 1.0], [1.0, 3.0]]) b = np.array([1.0, 2.0]) F = sparta.analyze(A) # 1. analyze the pattern (CPU) F.factorize() # 2. build the factors (GPU) x = F.solve(b) # 3. find x (GPU) F.destroy() # 4. hand back the GPU memory
use sparta::{Analysis, Complex32, Config, Solver}; // The lower triangle of [[4, 1], [1, 3]], in CSC form. let analysis = Analysis::ldlt(2, &[0, 2, 3], &[0, 1, 1], &Config::default())?; let mut solver = Solver::new(analysis)?; solver.factor(&[4.0, 1.0, 3.0].map(|v| Complex32::new(v, 0.0)))?; let x = solver.solve(&[1.0, 2.0].map(|v| Complex32::new(v, 0.0)))?; solver.destroy();
#include "sparta.h" sparta_analysis *plan; sparta_solver *solver; sparta_analyze(n, col_ptr, row_index, SPARTA_SYMMETRIC, &config, &plan); sparta_solver_create(&plan, &solver); sparta_factor(solver, values); sparta_solve(solver, b, x); sparta_solver_free(solver);
A = sparse([4 1; 1 3]); b = [1; 2]; S = SpartaSolver(A); % 1-2. analyze and factor x = S \ b; % 3. solve % A sweep: same pattern, new values factorize(S, A2); x2 = S \ b; clear S % 4. free the GPU memory
using SPARTA, SparseArrays A = sparse([4.0 1; 1 3]) b = [1.0, 2] F = SPARTA.Solver(A) # 1-2. analyze and factor x = F \ b # 3. solve # A sweep: same pattern, new values factorize!(F, A2) x2 = F \ b close(F) # 4. free the GPU memory
Three EMerge models, each swept over frequency with SPARTA as the solver, once on its GPU path and once on its CPU path on the same machine. Times are the solve times EMerge itself reports, summed over the sweep: per frequency, the solver call that factors the system and solves it for every port or excitation. Meshing and assembly are not included.
Apple M4 Pro · 14-core CPU (10 performance + 4 efficiency) · 20-core GPU · 24 GB unified memory · macOS 26.6.2
Peak memory of the whole EMerge process: GPU 9.2 GB · CPU 12.1 GB
Peak memory of the whole EMerge process: GPU 7.1 GB · CPU 11.7 GB
Peak memory of the whole EMerge process: GPU 13.2 GB · CPU 10.8 GB
Median of three runs, each a fresh process, on the machine above. EMerge solves one frequency at a time and analyzes the sparsity pattern once, at the first frequency; every later frequency only refactors. The GPU factors in single precision (complex64), the CPU in double precision (complex128). On the coupled-line filter the two are within about 10%, most likely because in a closed box most of its matrix is real, which the CPU factors in cheaper real arithmetic, and because its thin planar geometry gives many small fronts.
One device-independent core; each build targets one GPU backend.
libvulkan1 and libnvidia-gl for your driver version.Interfaces: Python 3.9 or later with NumPy and SciPy, a Rust toolchain, a C11 or C++17 compiler, MATLAB R2018a or later with a C compiler, or Julia 1.9 or later.
SPARTA is open source under the GNU Affero General Public License (AGPL). Closed-source software needs a commercial licence.
The source code, the Python package, the C/C++, MATLAB and Julia bindings and the user guide are all in the repository.
pip install sparta-solverIncluding SPARTA in closed-source software, distributed or run as a service, needs a commercial licence from us. For official inquiries, email robertfennis@emerge-numerics.com.
Send an email ›SPARTA is released under the GNU Affero General Public License, version 3 or later. Software that includes SPARTA and is distributed, or offered to users over a network, must make its own source available under the AGPL too. The full terms are in the repository.
Closed-source software needs a commercial licence. Email robertfennis@emerge-numerics.com for official inquiries.
SPARTA needs no internet connection and sends no data anywhere. No matrices, results or usage data leave the machine.
On its own, a relative residual around 1e-5. With iterative refinement, the default in Python, it reaches double-precision accuracy on all but the most badly conditioned systems, and every solve reports how far it got.
Apple Silicon GPUs through Metal are supported. AMD and NVIDIA GPUs on Windows and Linux run through the Vulkan backend, built on the same device-independent core. On Linux, the NVIDIA driver needs its Vulkan part, which server and headless installs often leave out.