The Wire · Showcase
JAX OVERHAULS AUTODIFF INTERNALS WITH CUSTOM_VJP3, EXPANDS MESH API
By RepoJournal · Filed · About Google
JAX shipped a major redesign of custom differentiation rules that simplifies how you define vector-Jacobian products, while simultaneously opening up mesh operations to the public API.
The custom_vjp3 pattern [1] replaces the dual-rule system: you now define only the forward pass and a single jvp method, with reverse-mode and vmap batchedness inferred automatically via linearize_from_jvp and vjp_from_jvp. When a rule produces more-batched outputs than inferred, the system raises a clear error pointing to hijax as the solution, eliminating silent correctness bugs. Complementing this, JAX now exports get_mesh, use_abstract_mesh, and get_abstract_mesh directly from the jax namespace [2], making distributed and abstract mesh operations accessible without internal imports. The remat3 branch gained support for custom_vjp functions that save reference residuals via a forwarding pattern [3], letting you stash gradients in refs and recover them during backprop. Separately, the shard_map collective matmul example [4] was rewritten to use pad-and-add instead of two half-size multiplies per ring step, issuing a single full-size matmul with full contraction length per step.
One email a day. Unsubscribe in one click.
Keep up with Google in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review custom_vjp3 migration guide if you have custom differentiation rules in production google/jax [plan]
- → Update internal code to use public mesh exports instead of internal imports google/jax [plan]
- → Monitor remat3 and shard_map collective patterns as they solidify google/jax [monitor]
References
- [1] [custom_vjp3] add custom_jvp3 ↗ google/jax
- [2] Export `get_mesh`, `use_abstract_mesh` and `get_abstract_mesh` from the jax namespace ↗ google/jax
- [3] [remat3] allow custom_vjp fns that save ref residuals, via forwarding ↗ google/jax
- [4] Use pad-and-add in the shard_map bidi collective matmul example ↗ google/jax