Skip to content

feat: require jax and jaxlib >=0.12.0,<0.13 - #216

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/jax-floor-0-12
Nov 12, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/jax-floor-0-12

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Phase 2 of #215. Research #213; decision PyAutoDNA decisions/jax-cpu-policy-2026-11.md, approved by the maintainer 2026-11-11.

Summary

  • Pins: jax>=0.12.0,<0.13 and jaxlib>=0.12.0,<0.13, with the existing platform markers. These replace >=0.7.0,<0.12.0,!=0.10.*,!=0.11.0. Both are pinned because jax 0.12.0 still accepts jaxlib 0.11.2.
  • Why: jax/jaxlib 0.11.2 deadlocks XLA:CPU likelihoods. A call never returns and the process sits at 0 % CPU. On RAL job 415009 it happened in 25/25 cells at 4 cores. 0.12.0 and 0.12.0.1 had 0 hangs in 30,000 calls with no flag.
  • No default XLA:CPU flag. None is needed on 0.12, and the eigen flag costs 18–50 % on pixelized likelihoods.
  • Colab: setup_colab installs with --no-deps, so it never upgraded Colab's preinstalled jax 0.11.1. The new _ensure_jax_floor() runs before anything imports jax. It reads versions from package metadata, upgrades jax/jaxlib/numpy (plus the matching jax-cuda12/13-plugin on GPU runtimes), and raises ColabRestartRequired asking for one runtime restart. On the second run the floor is met and setup continues.
  • README: the "JAX compatibility" section is rewritten. numpy ≥ 2.2; x86-64 needs a Haswell (2013) or newer CPU; Intel macOS still installs the NumPy path.

Phase-1 validation on jax 0.12.0.1 (details on #215)

  • 0 hangs in 15 runs of the previously hanging scripts at 4 cores, no flag.
  • CPU unit suites: Nerves, Array, Galaxy and Lens pass. Fit's local failures are an xdist race.
  • GPU, CUDA 12 and 13: blackjax, optax, nufftax and jaxnnls run on the device. The GPU-only failures are identical on 0.11.2.
  • Known regression (maintainer: proceed): jax.grad through zero-contour critical curves (a jax 0.12 custom_root transpose bug). Tracked in Mind draft/bug/autogalaxy/zero_contour_grad_fails_on_jax_0_12.md; the 2 scripts go NEEDS_FIX in phase 3.

Merge order (release work)

Merge with PyAutoHands (release.yml pins) and PyAutoHeart#332 (validation pins). Then, right after, the workspace PRs: their smoke_install.sh asserts jax <0.12 and must move to 0.12, plus the un-quarantine, re-pins and NEEDS_FIX entries. Then the library floors autonerves>2026.11.9.1.

API Changes

No Python API change. Install requirement change: jax/jaxlib ≥ 0.12.0,< 0.13 (numpy ≥ 2.2 effective). New public name: autonerves.setup_colab.ColabRestartRequired.

Test Plan

  • test_dependency_policy.py: the new truth table (0.11.2 ✗, 0.12.0 / 0.12.0.1 ✓, 0.13 ✗; markers preserved).
  • test_setup_colab.py: the floor gate is a no-op when met; upgrades and asks for a restart for old jax/jaxlib/numpy; picks the right CUDA plugin; runs before the GPU probe imports jax.
  • Nerves suite: 307 passed locally.
  • CI (installs jax 0.12 from the new pins).

🤖 Generated with Claude Code

jax/jaxlib 0.11.2 deadlocks XLA:CPU likelihoods (every call at 4 cores on
RAL job 415009); 0.12.0 and 0.12.0.1 ran 30,000 calls with no hang and no
XLA flag (PyAutoNerves#213, PyAutoDNA decisions/jax-cpu-policy-2026-11.md,
approved 2026-11-11). Pin jaxlib too: jax 0.12.0 still accepts jaxlib 0.11.2.
Replaces the 0.7 floor and the 0.10.* / 0.11.0 exclusions; platform markers
kept. No default XLA:CPU flag.

Colab: the setup cell installs with --no-deps and so never upgraded Colab's
preinstalled jax 0.11.1. _ensure_jax_floor now reads versions from package
metadata (before anything imports jax), upgrades jax/jaxlib/numpy (and the
matching jax-cuda plugin on GPU runtimes) and asks for one runtime restart.

README 'JAX compatibility' rewritten (numpy >=2.2, Haswell+ x86-64).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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