JAX 0.12.1 was released on 18 November 2026. The version number suggests a small patch, but the changelog is long. It promotes Pallas out of jax.experimental, adds accurate new math primitives, changes how captured constants are compiled, removes the legacy GSPMD partitioner, and changes GPU memory preallocation. Some of these can change your results or break saved artefacts.
This guide is an upgrade checklist for ML engineers: what to test, what to change, and a few new APIs worth using.
Install and check
pip install -U "jax==0.12.1"
python -c "import jax; print(jax.__version__, jax.devices())"
For GPU or TPU, install with the extra that matches your hardware, as described in the JAX installation guide. Note that the next release will require ml_dtypes 0.7.0 or newer (it’s listed under Unreleased in the changelog), so it’s worth updating ml_dtypes now as well.
Breaking changes to check first
1. Constants are passed as inputs, not embedded
jax_use_simplified_jaxpr_constants is now True by default. Non-scalar arrays captured from outside a jitted function are now passed to the compiled executable as separate inputs instead of being embedded inline. The goal is smaller executables and no host copies during lowering.
This is the kind of code affected:
import jax
import jax.numpy as jnp
weights = jnp.ones((1024, 1024)) # captured from outer scope
@jax.jit
def predict(x):
return x @ weights # 'weights' is a captured constant
print(predict(jnp.ones((2, 1024))).shape)
For most programs the result is the same. If something breaks, the changelog points to its “constants” note for how to recognise and fix it. As a temporary workaround you can restore the old behaviour:
JAX_USE_SIMPLIFIED_JAXPR_CONSTANTS=False python train.py
The flag will be removed in a future release, so use it only to unblock yourself. A cleaner long-term pattern is to pass large arrays as explicit arguments:
@jax.jit
def predict(params, x):
return x @ params["w"]
2. GSPMD is gone, Shardy only
Support for the legacy GSPMD partitioner (jax_use_shardy_partitioner=False) has been removed. JAX always uses Shardy, which has been the default for about a year. The jax_use_shardy_partitioner flag is now a deprecated no-op; setting it to False is silently ignored.
If you use jax.experimental.custom_partitioning with rules that only implement the legacy GSPMD callbacks (instead of sharding_rule), they now raise NotImplementedError. Search your code:
grep -rn "custom_partitioning\|jax_use_shardy_partitioner" .
3. Serialized executables from 0.12.0 or older won’t load
jax.experimental.serialize_executable.serialize now writes format version 3. Loading executables saved with JAX 0.12.0 or earlier via deserialize_and_load raises ValueError. If you cache compiled executables on disk, clear that cache and re-serialise after upgrading. Plain JAX compilation caches aren’t mentioned here, but deleting caches is cheap insurance during an upgrade.
4. Random numbers can change
Two changes affect reproducibility:
jax.random.poissonwith the defaultmethod="exact"now keeps the first accepted sample per element, so draws don’t depend on sharding. This can change the integers drawn for multi-element arrays whenlam >= 10.jax.randomsamplers now propagateout_shardingper shard. Requesting anout_shardingthat shards non-key dimensions needs a partitionable generator (threefry2x32,rbgorunsafe_rbgwithjax_threefry_partitionable=True); otherwise you getNotImplementedError.
If you have golden-value tests on Poisson samples, expect them to need new reference values.
5. Signal processing defaults now match SciPy
jax.scipy.signal.welch and csd (and stft when you pass nperseg=None) now default nperseg to 256 when window is a string or tuple. Previously, inputs longer than 256 samples used the full signal length. Output shapes and values may change. If you depend on the old behaviour, set nperseg explicitly:
from jax.scipy.signal import welch
import jax.numpy as jnp
x = jnp.sin(jnp.linspace(0, 100, 4096))
f, pxx = welch(x, fs=100.0, nperseg=4096) # explicit: same shape as before
Behaviour changes that affect performance
GPU memory preallocation
On GPU, when neither XLA_CLIENT_MEM_FRACTION nor the older XLA_PYTHON_CLIENT_MEM_FRACTION is set, JAX now preallocates 75% of GPU memory at startup and lets the default pool grow up to available device memory for ordinary buffers. To keep the previous fixed limit:
export XLA_CLIENT_MEM_FRACTION=0.75
This matters if you share a GPU between processes, for example a notebook and a training job. Explicit XLA memory flags still take precedence.
Softmax custom derivative
The custom derivative rule for jax.nn.softmax (and jax.scipy.special.softmax) is now on by default, for better memory use and numerical stability during differentiation. To compare against the old behaviour:
jax.config.update("jax_softmax_custom_jvp", False)
Faster CPU log functions
On CPU, jax.lax.log and jax.lax.log1p now use vectorised kernels on x86-64 (AVX2/AVX-512) and ARM64 (NEON). The changelog reports speed-ups for float64 and float32, but notes that float64 CPU log maximum error relaxed from 0.5 to 1.5 ULPs, matching GPU. Tests that expect bit-exact float64 log results on CPU may see shifts of about 1 ULP. Use tolerances such as jnp.allclose instead of exact equality.
New APIs worth trying
Pallas under jax.pallas
Pallas, JAX’s kernel language, is now available under jax.pallas (with jax.pallas.tpu, jax.pallas.tpu_sc, jax.pallas.mosaic_gpu and jax.pallas.fuser). You need an explicit import:
import jax.pallas as pl # new location
# from jax.experimental import pallas as pl # still works
Existing jax.experimental.pallas imports remain valid, and triton and ops stay under jax.experimental.pallas for now.
Accurate trig with sinpi, cospi, tanpi
New jax.lax.sinpi, cospi and tanpi compute sin(pi * x) and friends more accurately than multiplying by pi first. They return exact values at integers and half-integers:
import jax.numpy as jnp
from jax import lax
x = jnp.arange(5.0)
print(jnp.sin(jnp.pi * x)) # tiny non-zero values from rounding
print(lax.sinpi(x)) # exact zeros at integers
JAX’s window functions (blackman, hamming, hanning), stft and Lanczos jax.image.resize now use them internally.
Fused multiply-add
jax.lax.fma(a, b, c) computes a * b + c with a single rounding where supported. jax.lax.fmuladd uses fused multiply-add when available and falls back safely otherwise:
a, b, c = jnp.float32(1.1), jnp.float32(2.2), jnp.float32(0.3)
print(lax.fmuladd(a, b, c))
Automatic histogram bins
jnp.histogram and jnp.histogram_bin_edges accept bins="sqrt" and bins="sturges", matching NumPy:
data = jax.random.normal(jax.random.key(0), (10_000,))
counts, edges = jnp.histogram(data, bins="sturges")
print(len(edges) - 1, "bins")
Template strings in jax.debug.print
On Python 3.14+, jax.debug.print accepts PEP 750 template strings, so debug lines read like normal f-strings:
@jax.jit
def step(x):
loss = jnp.mean(x ** 2)
jax.debug.print(t"loss = {loss}")
return loss
Gradients with logs
jax.grad and jax.value_and_grad have a new keyword-only with_logs option that returns backward-pass logs alongside gradients without calling jax.vjp yourself. With with_logs=True, grad returns (grad, logs), or (grad, aux, logs) when has_aux=True.
An important bug fix
The changelog notes a fix for separate jax.jit instances of the same function that differ only in static_argnums, static_argnames or keep_unused. They could share dispatch cache entries and return wrong results. If you create several jitted variants of one function this way, upgrading is strongly recommended.
Upgrade checklist
- Upgrade
jaxandjaxlibtogether, and updateml_dtypes. - Run tests; if constants-related failures appear, refactor to explicit arguments.
- Remove
jax_use_shardy_partitioner=Falseand port GSPMD-only custom partitioning rules. - Delete serialised executables and re-create them.
- Update golden values for Poisson sampling and for
welch/csd/stftoutputs, or pinnperseg. - Set
XLA_CLIENT_MEM_FRACTION=0.75if you need the old GPU memory limit. - Use tolerances, not exact equality, for CPU
float64log results.
Takeaway
JAX 0.12.1 is worth upgrading to for the jit cache bug fix alone, and Pallas under jax.pallas is a clear sign the kernel API is maturing. Just treat it as a minor release with real behaviour changes: run your tests, clear serialised executables, check GSPMD-only code and watch for changed random and signal-processing outputs.
