API reference¤
This page highlights the primary public functions from the jaxmg package.
Supported datatypes are jax.numpy.float32, jax.numpy.float64,
jax.numpy.complex64, and jax.numpy.complex128.
The routines accept ordinary JAX arrays sharded over a one- or two-axis device mesh. The fused C++/CUDA backend converts those arrays into cuSOLVERMp's column-major, 2D block-cyclic layout and restores the JAX-facing layout before returning.
Each routine provides three nested interfaces. The public function adds JIT
compilation and optional input donation to *_jit_ctx, which accepts global
arrays and applies jax.shard_map to *_shardmap_ctx. The latter operates on
local blocks inside a caller-owned shard map. Use the context interfaces when
compilation or sharding is already managed by the surrounding calculation.
Warning
Each solver requires a tile width T_A. Very small tiles can substantially
reduce solver performance. If a local shard dimension is not divisible by
T_A, JAXMg adds tile-aligned capacity before entering native code. Prefer
T_A >= 128 and choose a tile size that divides the local shard dimensions
when possible. See Choosing a Tile Size
for further guidance.
potrs¤
Multi-GPU Cholesky linear solver for symmetric (Hermitian) positive-definite matrices.
Solve for \(x\) using the Cholesky factors.
potrf¤
Multi-GPU Cholesky factorization of a symmetric (Hermitian) positive-definite matrix, without a solve.
Returns the lower-triangular factor \(L\).
lu_solve¤
Multi-GPU pivoted LU solver for general nonsingular matrices.
getrf¤
Multi-GPU pivoted LU factorization of a square matrix, without a solve.
Returns the packed factors and the pivot indices, in the format of
jax.scipy.linalg.lu_factor.
least_squares¤
Multi-GPU least-squares solver for overdetermined systems.
qr¤
Compute the reduced QR decomposition of a tall or square matrix:
where \(Q\) is \(M\times N\) and \(R\) is \(N\times N\) and upper triangular.
syevd¤
Multi-GPU eigensolver for symmetric (Hermitian) matrices.
Compute eigenvalues \(\Lambda\) and optionally eigenvectors \(V\) of a symmetric or Hermitian matrix.
gesvd¤
Compute the singular-value decomposition of an \(M \times N\) real or complex matrix \(A\) (\(A = U \Sigma V^{\dagger}\)), returning the singular values and independently selected left and right singular vectors in reduced or full form.
polar¤
Compute the polar decomposition of a tall or square matrix \(A\):
returning the polar factor \(U_p\) and optionally the Hermitian positive-semidefinite factor \(H\).