Add optional JAX backend, migrate Poetry->uv, and benchmark JAX vs NumPy#19
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).