Skip to main content

UMFPACK FFI bindings for JAX - high-performance sparse direct solver

Project description

UMFPACK JAX FFI Extension

High-performance UMFPACK sparse direct solver with XLA FFI bindings for JAX. This eliminates the ~100ms pure_callback overhead when using UMFPACK within JAX's JIT-compiled code.

Prerequisites

macOS (Homebrew)

brew install suite-sparse nanobind

Ubuntu/Debian

sudo apt install libsuitesparse-dev
pip install nanobind

Fedora/RHEL

sudo dnf install suitesparse-devel
pip install nanobind

Build and Install

From this directory:

pip install .

Or for development:

pip install -e . -v

Usage

Once installed, VAJAX will automatically detect and use the FFI-based UMFPACK solver instead of the pure_callback version:

from vajax.sparse import umfpack_jax

# Check if FFI version is available
if umfpack_jax.is_available():
    print("Using FFI-based UMFPACK")

# Solve sparse system Ax = b (CSR format)
x = umfpack_jax.solve(csr_indptr, csr_indices, csr_data, b)

Performance

Operation pure_callback FFI
Solve overhead ~100ms ~0.1ms
c6288 solve ~117ms ~17ms
Newton-Raphson iteration ~120ms ~20ms

The FFI version reduces per-solve overhead from ~100ms to ~0.1ms by eliminating Python callback marshaling, GIL acquisition, and host synchronization.

API

solve(indptr, indices, data, b) -> x

Solve Ax = b where A is in CSR format.

dot(indptr, indices, data, x) -> b

Compute b = A @ x (sparse matrix-vector multiply).

solve_transpose(indptr, indices, data, b) -> x

Solve A^T x = b (transpose solve, needed for autodiff).

clear_cache()

Clear the cached symbolic factorization. Call when switching between matrices with different sparsity patterns.

Architecture

The extension uses XLA FFI (Foreign Function Interface) to register UMFPACK operations directly as XLA custom calls, following the same pattern as klujax (KLU solver for JAX).

Key optimizations:

  • Symbolic factorization cached for repeated solves
  • CSR→CSC conversion done in C++ (UMFPACK requires column-major)
  • No Python callback overhead within JIT-compiled code
  • Thread-safe with mutex-protected cache

License

Same license as VAJAX (Apache 2.0).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl (13.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_aarch64.whl (5.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

umfpack_jax-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (711.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl (13.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_aarch64.whl (5.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

umfpack_jax-0.1.5-cp311-cp311-macosx_11_0_arm64.whl (711.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 811bceb33c286c55254a0340aa459b8ea2be781c2d23d3a89488d79d315dd8ca
MD5 4bf67d6afaf26737f20404eef18f1845
BLAKE2b-256 893826ed04671866388e5344de91042360430a628d8154729c3277a49faf49e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on ChipFlow/vajax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6c03fc64ee5a065b570cef99aa95ab67cae98b090ec186dfef6b475046385146
MD5 8508b35581b59757c8460b76d5dc6d28
BLAKE2b-256 897f648053b78bdf3204f19d064e5e7dc715489359d427f2030412699c341317

See more details on using hashes here.

Provenance

The following attestation bundles were made for umfpack_jax-0.1.5-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: release.yml on ChipFlow/vajax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file umfpack_jax-0.1.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for umfpack_jax-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3a972497af50f1c9785cb6bc6adbfc5389a09d4a1bab6ab28f321b7867d4ba5
MD5 4430c705200b7fa8fe12e9e36925a7e7
BLAKE2b-256 ab5ad85e249d8c64294449e2cf3c27403848bd2c6aefe5cf7b3719df8b76e0de

See more details on using hashes here.

Provenance

The following attestation bundles were made for umfpack_jax-0.1.5-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on ChipFlow/vajax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 230a63458d20ddf920188cc64b1df47962adcec28be4f6f0f1e950cda8f6fd78
MD5 4c40611773d631f0c90d89a5b8c5d284
BLAKE2b-256 ac2766c072454515e7f0adf57ef2225efb18c825c3a0c7e95c2a36e93392f634

See more details on using hashes here.

Provenance

The following attestation bundles were made for umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: release.yml on ChipFlow/vajax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0d681febcee0a37023048be1ffc747647530ed13498d6d62d92b4a84cf9405cb
MD5 7d45837bb23a3823661a2711e5513396
BLAKE2b-256 5b933718686c5a6202432da6d1423a7cf7d62dbdd9103189a8d835fa3bf485d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for umfpack_jax-0.1.5-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: release.yml on ChipFlow/vajax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file umfpack_jax-0.1.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for umfpack_jax-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 197d96e909237e93e0e5d5ee5b1e6a47e81ebddbd3ea283b9b98b08c7e552f96
MD5 c1d1a35f7f736433a1f64579167d655b
BLAKE2b-256 4ea590d6490482fc6fe439cb1f5351a7347cc23517e35a2b5352d0430677575c

See more details on using hashes here.

Provenance

The following attestation bundles were made for umfpack_jax-0.1.5-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on ChipFlow/vajax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page