JAXMg: A multi-GPU linear solver in JAX
Roeland Wiersema
TL;DR
The paper tackles the challenge of scaling dense linear algebra across multiple GPUs within JAX, focusing on solving large SPD systems and eigenvalue problems that exceed single-GPU memory. It introduces JAXMg, a JAX interface to NVIDIA cuSOLVERMg via an XLA FFI, exposing JIT-compatible primitives for potrs, potri, and syevd on distributed GPUs using a 1D block-cyclic data layout. Key design elements include 1D cyclic data distribution and memory-management strategies for SPDM/MPDM modes, enabling in-JAX execution while delegating compute to cuSOLVERMg. Benchmark results on an 8-GPU node show improved scalability and higher throughput than native single-GPU cuSOLVER routines, enabling larger matrices and preserving JAX's composability in end-to-end workflows.
Abstract
Solving large dense linear systems and eigenvalue problems is a core requirement in many areas of scientific computing, but scaling these operations beyond a single GPU remains challenging within modern programming frameworks. While highly optimized multi-GPU solver libraries exist, they are typically difficult to integrate into composable, just-in-time (JIT) compiled Python workflows. JAXMg provides multi-GPU dense linear algebra for JAX, enabling Cholesky-based linear solves and symmetric eigendecompositions for matrices that exceed single-GPU memory limits. By interfacing JAX with NVIDIA's cuSOLVERMg through an XLA Foreign Function Interface, JAXMg exposes distributed GPU solvers as JIT-compatible JAX primitives. This design allows scalable linear algebra to be embedded directly within JAX programs, preserving composability with JAX transformations and enabling multi-GPU execution in end-to-end scientific workflows.
