JMP is a Python library from DeepMind that provides abstractions for mixed precision training in JAX. It enables the use of full and half-precision floating-point numbers during model training to reduce memory bandwidth and improve computational efficiency. It is currently at version 0.0.4 and sees active development with new releases addressing JAX compatibility and feature enhancements.
pip install jmpVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a mixed precision policy using `jmp.Policy` and apply it to JAX arrays. It also shows the basic usage of `jmp.DynamicLossScale` for adjusting the loss scale during training based on gradient finiteness.
Upgrade Python to 3.8 or newer. The current recommended minimum Python version is 3.8.
Follow JAX's official installation guide (e.g., `pip install jax[cuda12_pip]` for CUDA 12) before running `pip install jmp`.
Ensure that inputs to `DynamicLossScale` and related functions are of appropriate floating-point dtypes (e.g., `jnp.float16`, `jnp.bfloat16`, `jnp.float32`). Use `jmp.half_dtype()` or `jmp.full_dtype()` for clarity.