Skip to content

Add optional JAX backend, migrate Poetry->uv, and benchmark JAX vs NumPy#19

Merged
sm00thix merged 1 commit into
mainfrom
jax-backend
Jun 30, 2026
Merged

Add optional JAX backend, migrate Poetry->uv, and benchmark JAX vs NumPy#19
sm00thix merged 1 commit into
mainfrom
jax-backend

Conversation

@sm00thix

Copy link
Copy Markdown
Owner

JAX backend: optional backend="jax" (Literal, default "numpy") routing array ops through numpy/jax.numpy so per-fold training_XTX/XTY/XTX_XTY/statistics trace under jax.jit and batch over folds with jax.vmap on CPU/GPU/TPU. Trace-safe (tracer-gated raises keyed on val_indices, maximum/where std clamp, auto x64); numpy backend byte-identical and perf-neutral. Type hints admit jax values (FloatDType via a TYPE_CHECKING npt.DTypeLike alias). Tests parametrized over both backends + jit/vmap trace tests + degenerate-fold + jax-absent ImportError.

Tooling: migrate Poetry->uv (PEP 621 [project], hatchling, PEP 735 dependency-groups; uv.lock replaces poetry.lock; ruff replaces flake8 for the build lint); version 3.1.6 -> 3.2.0.

Benchmarks: optional jax backend + JAX execution-mode variants (no-/cold-/warm-JIT, CPU/GPU); two new multi-threaded CVMatrix-only figures (NumPy vs warm JAX; JIT modes).

JAX backend: optional backend="jax" (Literal, default "numpy") routing array ops
through numpy/jax.numpy so per-fold training_XTX/XTY/XTX_XTY/statistics trace under
jax.jit and batch over folds with jax.vmap on CPU/GPU/TPU. Trace-safe (tracer-gated
raises keyed on val_indices, maximum/where std clamp, auto x64); numpy backend
byte-identical and perf-neutral. Type hints admit jax values (FloatDType via a
TYPE_CHECKING npt.DTypeLike alias). Tests parametrized over both backends + jit/vmap
trace tests + degenerate-fold + jax-absent ImportError.

Tooling: migrate Poetry->uv (PEP 621 [project], hatchling, PEP 735 dependency-groups;
uv.lock replaces poetry.lock; ruff replaces flake8 for the build lint); version
3.1.6 -> 3.2.0.

Benchmarks: optional jax backend + JAX execution-mode variants (no-/cold-/warm-JIT,
CPU/GPU); two new multi-threaded CVMatrix-only figures (NumPy vs warm JAX; JIT modes).
@sm00thix
sm00thix merged commit be24c11 into main Jun 30, 2026
@sm00thix
sm00thix deleted the jax-backend branch June 30, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant