Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

JAXMg

JAXMg: A multi-GPU linear solver in JAX

Docs PyPI Releases Build Tests

JAXMg

JAXMg brings distributed matrix solvers to JAX, allowing calculations to run across multiple GPUs and nodes. This enables solvers to scale to matrices near the combined memory capacity of the available GPUs, far beyond native JAX routines, while retaining a familiar JAX interface.

JAXMg currently provides a jittable API for the following routines:

  • potrs: Solves the system of linear equations $Ax=B$, where $A$ is an $N \times N$ symmetric or Hermitian positive-definite matrix, using a Cholesky decomposition. It can also return the log determinant of $A$.
  • lu_solve: Solves the system of linear equations $Ax=B$, where $A$ is an $N \times N$ general nonsingular matrix, using a pivoted LU decomposition.
  • syevd: Computes the eigenvalues $\lambda_i$ and optional eigenvectors $v_i$ of an $N \times N$ symmetric or Hermitian matrix $A$, satisfying $Av_i=\lambda_i v_i$.
  • gesvd: Computes the singular-value decomposition of an $M \times N$ matrix $A$ ($A = U \Sigma V^{\dagger}$), returning the singular values and optional left and right singular vectors.

How JAXMg works

JAXMg connects JAX to NVIDIA's distributed cuSOLVERMp routines through a native C++/CUDA backend.

Supply a JAX matrix sharded over a one- or two-axis device mesh, and JAXMg handles the local memory-layout conversion, redistribution into cuSOLVERMp's 2D block-cyclic layout, distributed numerical computation, and restoration of the result to its original JAX layout. The matrix data remains GPU-resident throughout, with in-place transformations and bounded scratch storage minimizing memory overhead.

The operations are implemented using:

For more details, see the API reference and the accompanying paper.

Deprecation notice: JAXMg 0.x, based on NVIDIA's deprecated cuSOLVERMg backend, has been superseded by JAXMg 1.0. Version 1.0 requires one Python process per GPU and removes potri; the previous API remains available with pip install "jaxmg<1". See the 0.0.9 release and 0.0.9 documentation.

Installation

Install the package with the extra matching your CUDA setup:

CUDA setup Command
CUDA 12 pip install "jaxmg[cuda12]"
Local CUDA 12 pip install "jaxmg[cuda12-local]"
CUDA 13 pip install "jaxmg[cuda13]"
Local CUDA 13 pip install "jaxmg[cuda13-local]"

Prebuilt Linux wheels are provided for x86_64 and aarch64. The supported NVIDIA GPU families are:

CUDA setup Supported GPUs
CUDA 12 V100, A100, H100/H200, and Blackwell GPUs
CUDA 13 A100, H100/H200, and Blackwell GPUs

Note: pip install jaxmg installs CPU-only JAX. Select one of the CUDA extras above when installing JAXMg for GPU use. See Installation for details.

Example

JAXMg runs with one Python process per GPU. After launching one process for each GPU, initialize distributed JAX before constructing the device mesh. See Distributed execution for launch details.

For JAX arrays A and b, a Cholesky solve and log-determinant calculation requires only the distributed mesh, array placement, and solver call:

import jax
from jax.sharding import NamedSharding, PartitionSpec as P
from jaxmg import potrs


jax.distributed.initialize()

mesh = jax.make_mesh((jax.process_count(), 1), ("pr", "pc"))
jax.set_mesh(mesh)

A = jax.device_put(A, NamedSharding(mesh, P("pr", "pc")))
b = jax.device_put(b, NamedSharding(mesh, P("pr", None)))

x, logdet = potrs(A, b, T_A=256, return_logdet=True)
Complete distributed example with validation

The following example constructs a diagonal system, distributes it over the available GPUs, solves it, and checks the result:

import jax
jax.config.update("jax_enable_x64", True)

import jax.numpy as jnp
from jax.sharding import PartitionSpec as P, NamedSharding
from jaxmg import potrs


jax.distributed.initialize()

T_A = 3
dtype = jnp.float64

num_procs = jax.process_count()
N = T_A * num_procs

A = jnp.diag(jnp.arange(N, dtype=dtype) + 1)
b = jnp.ones((N, 1), dtype=dtype)

mesh = jax.make_mesh((num_procs, 1), ("pr", "pc"))
jax.set_mesh(mesh)
a_sharding = NamedSharding(mesh, P("pr", "pc"))
b_sharding = NamedSharding(mesh, P("pr", None))
A = jax.device_put(A, a_sharding)
b = jax.device_put(b, b_sharding)

out, logdet = potrs(A, b, T_A=T_A, return_logdet=True)
out.block_until_ready()
logdet.block_until_ready()

expected_out = 1.0 / (jnp.arange(N, dtype=dtype) + 1)
expected_logdet = jnp.sum(jnp.log(jnp.arange(N, dtype=dtype) + 1))
is_correct = jnp.allclose(out.flatten(), expected_out) & jnp.allclose(
    logdet, expected_logdet
)
is_correct.block_until_ready()

if jax.process_index() == 0:
    print(out)
    print(logdet)
    print(is_correct)

On four ranks, this gives

[[1.        ]
 [0.5       ]
 [0.33333333]
 [0.25      ]
 [0.2       ]
 [0.16666667]
 [0.14285714]
 [0.125     ]
 [0.11111111]
 [0.1       ]
 [0.09090909]
 [0.08333333]]
19.987214495661885
True

as expected.

Call potrs or lu_solve directly for standard solves. For use inside a larger jax.jit-compiled function, see the advanced Cholesky and LU examples.

Projects that use JAXMg

  • JAXMg Benchmarks: Benchmarks for various Multi-GPUs setups.
  • JAXMg + Netket: Implementation of the MinSR Netket driver that uses JAXMg for inverting the S-matrix. Tested on Multi-node settings.
  • JAXMg for blurred sampling: Implementation of t-VMC that makes use JAXMg for inverting the QGT.

Citations

@misc{2601.14466,
Author = {Jacob Tutt and Roeland Wiersema},
Title = {JAXMg: A multi-GPU linear solver in JAX},
Year = {2026},
Eprint = {arXiv:2601.14466},
}

Acknowledgements

We acknowledge support from the Flatiron Institute. The Flatiron Institute is a division of the Simons Foundation.

Metadata

Release files for jaxmg 1.1.1rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for jaxmg 1.1.1rc1
File
jaxmg-1.1.1rc1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
jaxmg-1.1.1rc1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
jaxmg-1.1.1rc1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
jaxmg-1.1.1rc1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 Details
jaxmg-1.1.1rc1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
jaxmg-1.1.1rc1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
jaxmg-1.1.1rc1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
jaxmg-1.1.1rc1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details

Total release size: 27.6 MB

Release files / jaxmg-1.1.1rc1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL jaxmg-1.1.1rc1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.4 MB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5f3a02fe92fb7891c37a5abe163f2f44c7649277de10239c4243d8c9eccba829
BLAKE2b-256 checksum
How to use checksums
03ae4c7961a158373ecbfef2409d7a59db8e3db4b51a35aadb761900f13a5ff6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / jaxmg-1.1.1rc1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL jaxmg-1.1.1rc1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 3.5 MB
Tags CPython 3.14 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f9ec647f5276d697e87f60f222b20b8a2e93d7406b8cadc62a8a622ea24cf068
BLAKE2b-256 checksum
How to use checksums
6000aad77ce20ea1bd9644d995521273b6a2dbf026ed215da31e9b846accbf13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / jaxmg-1.1.1rc1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL jaxmg-1.1.1rc1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.4 MB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fbd7cc7e291298d720bcd5cad71af44295e4c045e2e9742c5c8b13fb845f2bf3
BLAKE2b-256 checksum
How to use checksums
6d58ff79c262dd0490f8265e8ccd16afb16493d6e3c4229fed6ee53246b00a1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / jaxmg-1.1.1rc1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL jaxmg-1.1.1rc1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 3.5 MB
Tags CPython 3.13 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
d914325fe8c1be7f952e6a4cfb3d2e92b8970ec0f4ef07b4949b3247911a2d05
BLAKE2b-256 checksum
How to use checksums
da39864173823eb6c7e94d625e390d62e28a83bd675f22f63f0f01768371c241
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / jaxmg-1.1.1rc1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL jaxmg-1.1.1rc1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.4 MB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6e4c2fc7fc2dfb24c388f93043c5d6fc0470c58f8a502c66c29705bdbd1512e9
BLAKE2b-256 checksum
How to use checksums
7dbb538e5f4fdc82f0b1a6aa66ab90d014790dcb7ab815a191ae21cb1c4a7d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / jaxmg-1.1.1rc1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL jaxmg-1.1.1rc1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 3.5 MB
Tags CPython 3.12 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
bc18b941a8ec124be53aff914c1055442068f47759437e57eb3c6840ef8b5f80
BLAKE2b-256 checksum
How to use checksums
1a14d39726316bb2207a384ef0d015081da4d182198a6b47febd25b7e62d29d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / jaxmg-1.1.1rc1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL jaxmg-1.1.1rc1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.4 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
42e5edb72612e8e8066cd58f92c38aea5305f48cb89214d1084ae84fc0bfe58c
BLAKE2b-256 checksum
How to use checksums
dd37c46e328b56f769326b4cc7c60c4c048d477b9f595f2c7f9d122469ef1e53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / jaxmg-1.1.1rc1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL jaxmg-1.1.1rc1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 3.5 MB
Tags CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f1af2bbab848697f663f5f6d815a3aa3cb11c22dd18ded3bfbc3f85005e8c9dd
BLAKE2b-256 checksum
How to use checksums
f43cacdfc2493c8b064a7ab042db7b2379e3b78dda88a318d81920fcff5cc4ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page