Skip to content

feat: raise the JAX floor to 0.12.0 (jax and jaxlib) for this release #215

Closed

Description

@Jammy2211

Overview

jax/jaxlib 0.11.2, which users resolve today, deadlocks XLA:CPU likelihoods: a call never returns and the process sits at 0 % CPU. On RAL (job 415009) it hung in 25/25 cells at 4 cores, intermittently at 8, never at 16. jax 0.12.0 and 0.12.0.1 had 0 hangs in 30,000 calls with no XLA flag. The FFT part is upstream jax-ml/jax#41265, fixed by openxla/xla#50091 in 0.12.0. Research PyAutoNerves#213 is complete; the maintainer approved the recommendation on 2026-11-11 (PyAutoDNA decisions/jax-cpu-policy-2026-11.md, merged in PyAutoDNA#5). This task raises the floor to jax>=0.12.0,<0.13 and jaxlib>=0.12.0,<0.13 for this release, after a Heart validation.

Plan

  • Phase 1, validate first (no requirement change): a Heart PR moves the jax-compatibility.yml matrix to 0.12.0/0.12.0.1 and the workspace-validation.yml pins to >=0.12.0,<0.13, validated by dispatching on the PR branch. Re-run the quarantined jax_likelihood scripts on jax 0.12 at 4 cores. GPU unit suites and smoke on jax 0.12 (CUDA 12, and 13 if available). blackjax, optax, nufftax and jaxnnls import and run. Any hang on 0.12 stops the work and is recorded on PyAutoNerves#213.
  • Phase 2, PyAutoNerves: the new pins (platform markers kept), the witnesses comment and the README "JAX compatibility" section (numpy ≥ 2.2, x86-64 Haswell+). setup_colab.py names jax/jaxlib/numpy (and the matching CUDA plugin on GPU runtimes) and tells the user to restart the runtime when needed. No default XLA:CPU flag.
  • Phase 3, consumer guard + un-quarantine: autonerves>2026.11.9.1 in PyAutoFit, PyAutoArray, PyAutoGalaxy and PyAutoLens (Read the Docs reads red until publish); remove the passing scripts from no_run.yaml.
  • Phase 4, release: release validate on the new source (Colab check F red until publish), then the maintainer's version choice and approval, publish, /review_release.
  • Out of scope: eigen-flag workaround removal, the Heart hang guard (existing drafts).

Tier: judge — merge mode: human /prm (authorized in session: "/prm each phase when green"; release itself human-required)

Detailed implementation plan

Maintainer decisions (2026-11-11)

  • Colab: upgrade jax/jaxlib (≥0.12.0,<0.13), numpy (≥2.2) and the matching jax-cuda plugin on GPU runtimes, and prompt a runtime restart if they were already imported.
  • Consumer floor: autonerves>2026.11.9.1 (strictly newer than the last published, permissive Nerves).

Affected Repositories

  • PyAutoNerves (primary), PyAutoHeart, PyAutoFit, PyAutoArray, PyAutoGalaxy, PyAutoLens, autolens_workspace_test, autogalaxy_workspace_test

Branch Survey

Repository Current Branch Dirty? Claim
PyAutoHeart main clean free
PyAutoNerves main clean free
PyAutoFit main clean free
PyAutoArray / PyAutoGalaxy / PyAutoLens main clean claimed by magnification-maps-wiring (Lens#818): phase 3 blocked until resolved
autolens_workspace_test / autogalaxy_workspace_test main clean free

Suggested branch: feature/jax-floor-0-12

Implementation Steps

  1. Heart: .github/workflows/jax-compatibility.yml jax: ['0.9.2', '0.11.2'] → ['0.12.0', '0.12.0.1']; workspace-validation.yml lines ~293/366/608 → "jax>=0.12.0,<0.13" "jaxlib>=0.12.0,<0.13". Leave the eigen flag at ~427 (out of scope). Review heart/checks/colab_pip_freeze.snapshot.txt (jax 0.11.1, numpy 2.1.3) and colab_gate.py.
  2. Phase-1 runs: Heart workflows dispatched on the PR branch; local reruns at 4 cores (taskset), repeated, of autolens_workspace_test multi_dataset/jax_likelihood/{delaunay_mge,delaunay,shared_preloads}.py and autogalaxy_workspace_test multi_dataset/jax_likelihood/{rectangular,delaunay}.py; GPU venv on jax 0.12 + CUDA plugins: library unit suites and GPU smoke; blackjax/optax/nufftax/jaxnnls import and run.
  3. Nerves: pyproject.toml lines 35–41; README §"JAX compatibility" (~119–131); autonerves/setup_colab.py package list + restart message; tests.
  4. Libraries: autonerves>2026.10.4.1 → >2026.11.9.1 in four pyprojects; workspace no_run.yaml entries removed for passers.
  5. Release: pyauto-brain release validate → ingest → human version/approval → publish → /review_release.

Key Files

  • PyAutoNerves/pyproject.toml, README.md, autonerves/setup_colab.py
  • PyAutoHeart/.github/workflows/{jax-compatibility,workspace-validation}.yml, heart/checks/colab_pip_freeze.snapshot.txt, heart/checks/colab_gate.py
  • {PyAutoFit,PyAutoArray,PyAutoGalaxy,PyAutoLens}/pyproject.toml
  • autolens_workspace_test/config/build/no_run.yaml, autogalaxy_workspace_test/config/build/no_run.yaml

Original Prompt

Click to expand starting prompt

Raise the JAX floor to 0.12.0 (jax and jaxlib) after a Heart validation

Type: feature
Target: PyAutoNerves
Repos:

  • PyAutoNerves
  • PyAutoHeart
    Priority: high
    Consequence: judge

Source: research PyAutoNerves#213 (decision PyAutoDNA decisions/jax-cpu-policy-2026-11.md, evidence RAL 415009 + laptop pilot, DNA research records). Filed 2026-11-10/11 from the research close-out; needs /intake to formalise.

Why

jax/jaxlib 0.11.2 (today's resolved version and "recommended baseline") deadlocks XLA:CPU likelihoods: on RAL at 4 cores every reproducer hung on the first call (25/25 cells), intermittent at 8 cores, none at 16. jax 0.12.0 and 0.12.0.1 passed 100/100 cells per setting (0 hangs in 30,000 calls) with no flag. The FFT-pool part is upstream jax#41265, fixed by openxla/xla#50091 in 0.12.0.

What

  1. Heart validation on jax 0.12 first: full library unit suites + workspace smoke on CPU and GPU (CUDA 12/13 plugins), including blackjax, optax, nufftax, jaxnnls; rerun autolens_workspace_test multi_dataset/jax_likelihood/delaunay_mge.py, delaunay.py, shared_preloads.py, rectangular.py (all hung in release-integrate on 0.11.2, delaunay_mge even with the eigen flag).
  2. PyAutoNerves pyproject: jax>=0.12.0,<0.13 AND jaxlib>=0.12.0,<0.13 (both: jax 0.12.0 accepts jaxlib 0.11.2), replacing the 0.7 floor and the 0.10.*/0.11.0 exclusions; README "JAX compatibility" + "recommended baseline" updated. numpy floor becomes 2.2; x86-64 needs Haswell+.
  3. Do NOT add a default XLA:CPU flag: the eigen flag costs +18-50 % per call on pixelized likelihoods on 0.12.

Activity

  1. Jammy2211 commented on Nov 11, 2026

    @Jammy2211
    CollaboratorAuthor

    Phase 1 validation, 2026-11-11: one real jax 0.12 regression found; the work is paused

    No hangs on jax 0.12.0.1.

    • Quarantined jax_likelihood scripts at 4 cores, no XLA flag, 3 repeats each: 0 hangs in 15 runs.
      • Pass: autolens_workspace_test shared_preloads.py; autogalaxy_workspace_test rectangular.py, delaunay.py.
      • Value-pin failures from PyAutoArray#683, not jax: autolens_workspace_test delaunay_mge.py (+18.418) and delaunay.py (+18.419), i.e. 2 × 9.2103. Missed by the pseudo-det rebaseline while quarantined.
    • CPU unit suites on jax 0.12.0.1: Nerves 301, Array 2408, Galaxy 1469, Lens 1021 all pass. Fit: 4242 pass; its local failures are a pytest-xdist output-dir race (40/41 pass serially; the remaining one also fails on 0.11.2).
    • GPU (RTX 2060), CUDA 12 and CUDA 13 plugins: blackjax, optax, nufftax and jaxnnls run on the device. Galaxy passes in full. Array (4) and Lens (1) failures are identical on jax 0.11.2 on the same GPU, so they're pre-existing GPU numerics, not 0.12.
    • Workspace smoke on jax 0.12, after fixing Heart#332 so the pin holds (first run 43034177136 had been downgraded to 0.11.2): 134/136 jobs green.

    Regression (jax 0.12 only, passes on 0.11.2): gradients through zero-contour critical curves.

    • autogalaxy_workspace_test misc/latent/zero_contour_compat_jax.py (the vmap(grad(...)) line).
    • autolens_workspace_test misc/jax_assertions/critical_curves_zero_contour_jit_grad.py.
    • AssertionError in jax/_src/lax/lax.py::_unbroadcast (assert not aval.shape or len(x_shape) == len(aval.shape)). It is raised from _mul_transpose_left in the eval_jaxpr transpose of the tangent solve that jax_zero_contour 2.0.0 (latest; tangent_solve_rev) passes to lax.custom_root.
    • Rewriting the tangent solve with explicit jnp.broadcast_arrays does not change it, so this looks like a jax 0.12 custom_root transpose regression. Forward contours, jit and vmap still work.

    The floor raise (phase 2) is held pending a decision on this.

  2. Jammy2211 commented on Nov 12, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped in 2026.11.12.1 (release run 43222979602, all jobs green; the attempt-1 wiki-currency failure was a PyPI index propagation race and passed on rerun).

    • PyPI: autonerves 2026.11.12.1 requires jax>=0.12.0,<0.13 and jaxlib>=0.12.0,<0.13; autofit, autoarray, autogalaxy and autolens require autonerves>=2026.11.9.1.post1. A fresh pip install autolens==2026.11.12.1 resolves jax/jaxlib 0.12.0.1.
    • Release validation (TestPyPI dev87601): 818 pass / 0 fail / 0 timeout. Fresh workspace smoke on main: 136/136.
    • Merged: PyAutoNerves#216, PyAutoHands#336, PyAutoHeart#332, PyAutoFit#1770, PyAutoArray#689, PyAutoGalaxy#702, PyAutoLens#824, autolens_workspace_test#364, autogalaxy_workspace_test#135, euclid_strong_lens_modeling_pipeline#126.
    • Follow-ups (Mind record complete/2026/11/jax-floor-0-12.md): zero-contour gradient on jax 0.12 (bug draft); PyAutoCTI floor; Heart jax-compatibility matrix manifest; RAL venv upgrade (maintainer); eigen-flag removal and the Heart hang guard can now start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions