Composable transformations of Python+NumPy: differentiate (jax.grad), compile (jax.jit), vectorize (jax.vmap), parallelize (jax.shard_map). Current version is 0.9.2 (Mar 2026). Requires Python >=3.11. Install requires extras — bare pip install jax gives CPU-only minimal build.
pip install jax[cpu]Verified import paths — ran on the pinned version, not inferred.
Core JAX pattern: compose grad, jit, vmap freely. All functions must be pure.
Always install with an extra: pip install 'jax[cpu]' or pip install 'jax[cuda12]'. Check https://jax.readthedocs.io/en/latest/installation.html for the current CUDA extras.
Always install together: pip install 'jax[cpu]' — this installs the matching jaxlib automatically. If pinning: pin both jax==X.Y.Z and jaxlib==X.Y.Z to the same version.
Pass all transform arguments by keyword: jax.jit(f, static_argnums=(0,)) not jax.jit(f, (0,)).
Migrate new multi-device code to jax.shard_map. Existing pmap code will continue to work for now but will not receive new features.
Install older versions from the JAX archive index: pip install 'jax[cpu]==X.Y.Z' -i https://us-python.pkg.dev/ml-oss-artifacts-published/jax/simple/
Use jax.debug.print() for debugging inside jit. Keep all side effects outside of transformed functions. Functions must be pure (same inputs → same outputs).
Use the .at[].set() / .at[].add() / .at[].mul() functional update API: x = x.at[0].set(1)
Enable 64-bit: jax.config.update('jax_enable_x64', True) — must be called before any JAX operations. Or use context manager: with jax.enable_x64(): ...Ensure both `jax` and `jaxlib` are correctly installed for your specific hardware (CPU, CUDA, ROCm) and Python version. For CPU only: `pip install --upgrade "jax[cpu]"`. For CUDA 12: `pip install --upgrade "jax[cuda12-local]"`.
Mark the problematic argument as static using `static_argnums` or `static_argnames` in `jax.jit`, or refactor the code to use JAX's structured control flow primitives like `jax.lax.cond` or `jax.lax.fori_loop` instead of native Python control flow for traced values.
Uninstall both `jax` and `jaxlib` completely, then reinstall compatible versions. It's often best to install the latest versions together, for example: `pip uninstall jax jaxlib` followed by `pip install --upgrade "jax[cpu]"` (or the appropriate GPU/TPU variant).
Either convert the non-hashable argument to a hashable type (e.g., a tuple instead of a list), or explicitly mark it as a static argument using `static_argnums` or `static_argnames` in the `jax.jit` or `jax.vmap` decorator. For example, `partial(func, static_arg=my_non_hashable_arg)` with `jax.jit(func, static_argnums=...)`.
Verify that your NVIDIA driver, CUDA Toolkit, and cuDNN versions are compatible with the specific `jaxlib` wheel you've installed by consulting the official JAX installation guide. Ensure `LD_LIBRARY_PATH` and `PATH` environment variables correctly point to your CUDA installation. If using a specific CUDA version, reinstall JAX using the corresponding `jax[cudaXX-local]` or `jax[cudaXX-pip]` extra.