Skip to content

fix: pin tfp-nightly for JAX Matern-kernel path (tfp 0.25.0 × jax 0.10.2 crash) - #386

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/matern-tfp-jax-compat
Jul 13, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/matern-tfp-jax-compat

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

The JAX Matern-kernel regularization path crashed at import for every user on the release-resolved stack. autoarray/inversion/regularization/matern_kernel.py (kv_xp) imports tensorflow_probability.substrates.jax for bessel_kve; the last stable tfp (0.25.0) references jax.interpreters.xla.pytype_aval_mappings, removed from modern JAX, so import crashes under jax 0.10.2. Surfaced by release-validation run 29266305445 (TestPyPI 2026.7.13.1.dev65501).

Fix

  • pyproject.toml (optional extra): tensorflow-probability==0.25.0 → tfp-nightly==0.26.0.dev20260713. No stable tfp is compatible (0.25.0 is the latest); the nightly restores modern-JAX support and installs via an explicit == pin (no --pre). Import name is unchanged, so matern_kernel.py needs no code edit.
  • matern_kernel.py: corrected the kv_xp docstring (it advertised a non-existent jax.scipy.special.kv fast-path) and pointed the ImportError at tfp-nightly. No behaviour change.

Why not the alternatives

  • Lower the jax cap — infeasible; pytype_aval_mappings is gone by jax 0.9.2 and autoconf[jax] floors jax>=0.7.
  • Drop tfp / use jax.scipy — jax.scipy.special has no kv/kve, and nu is a continuous free prior, so no closed-form shortcut. Vendoring tfp's bessel_kve is the durable fix, filed as a follow-up.

Verification

  • Reproduced the crash clean-env (jax 0.10.2 + tfp 0.25.0); confirmed tfp-nightly computes bessel_kve(0.5,1.0)=1.2533 on jax 0.10.2.
  • New parity assertion (in the paired autogalaxy_workspace_test PR): np-vs-JAX Matern regularization matrix at nu=0.5 and nu=1.7, jitted → passes.
  • pytest test_autoarray/ → 897 passed.

API Changes

None — public surface unchanged.

Fixes #385

🤖 Generated with Claude Code

https://claude.ai/code/session_01TDCsgNCXacXqiWAPTswWCt

… 0.10.2 crash)

The last stable tensorflow-probability (0.25.0) references
jax.interpreters.xla.pytype_aval_mappings, removed from modern JAX, so it
crashes at import under the resolved jax>=0.7 stack — breaking every
Matern-kernel pixelization on the JAX backend (release-validation run
29266305445). Swap the pin to tfp-nightly==0.26.0.dev20260713 (verified to
compute bessel_kve on jax 0.10.2) and correct the kv_xp docstring/ImportError.

Fixes #385

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TDCsgNCXacXqiWAPTswWCt
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 13, 2026
@Jammy2211
Jammy2211 merged commit 59a7802 into main Jul 13, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/matern-tfp-jax-compat branch July 13, 2026 18:42
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
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.

fix: Matern-kernel JAX crash — tfp 0.25.0 incompatible with jax 0.10.2

1 participant