JAX is a Python library by Google for high-performance numerical computing, providing a NumPy-like interface with automatic differentiation and function transformations, capable of running on CPUs, GPUs, and TPUs. The `jax-cuda12-plugin` specifically provides NVIDIA GPU support for JAX, compatible with CUDA 12.x environments. JAX and its core library `jaxlib` (which this plugin extends) are actively maintained with frequent releases, typically on a monthly or bi-monthly schedule for minor versions.
pip install jax-cuda12-pluginVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates core JAX functionalities: utilizing the NumPy-like API (`jax.numpy`), applying Just-In-Time (JIT) compilation with `jax.jit` for performance, and computing gradients automatically using `jax.grad`. It also highlights the immutability of JAX arrays, a key difference from NumPy.
Migrate from `jax.pmap` to `jax.shard_map` or `jax.jit`. Consult the JAX migration guide for details on `pmap` to `shard_map` transitions.
Ensure you are using the plugin-based installation, typically by installing `jax-cuda12-plugin` (or `jax[cuda12]`) as per the official JAX installation instructions.
Use the `.at[]` syntax for element-wise updates, which returns a new array with the changes (e.g., `x = x.at[0].set(10)`).
To recover the previous host-based precision for narrow-width floats, explicitly cast to `jnp.array(np.arange(...))`.
Upgrade NumPy to version 2.0 or newer (and SciPy to 1.13 or newer if used).
Use `jax.lax.pcast(..., to='varying')` as the replacement.