The Wire · Showcase
JAX FIXES ZERO-PROPAGATION BUG IN REVERSE-MODE AUTODIFF
By RepoJournal · Filed · About Google
JAX's core autodiff engine now correctly propagates zero tangents through remat operations, fixing a downstream Flax pattern that was leaking Tracers into production code.
The fix lands in jax.vjp and jax.linearize with a new in_nzs parameter, a tuple-tree of per-input nonzero-tangent flags that lets dead code paths stay dead [1]. This prevents the tracer leaks that were surfacing in certain gradient computations, a subtle but critical correctness issue for anyone chaining JAX's autodiff with complex control flow. The change is fully backward compatible: the returned callable still accepts tangent inputs corresponding to zeros, so existing code keeps working. In parallel, the team removed process_call as dead code [2], a cleanup that shrinks the autodiff surface and reduces maintenance burden. A separate quality-of-life fix caps array repr output at 1MiB to prevent logging overhead when debugging with large tensors [3].
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
- → Pull latest JAX and test gradient paths with remat and complex control flow google/jax [plan]
- → Monitor for tracer leaks in existing Flax models after upgrade google/jax [monitor]
References
- [1] [remat3][vjp3] propagate zeros through remat3 via jax.vjp/linearize ↗ google/jax
- [2] [cleanup] remove process_call, now dead code google/jax
- [3] Do not print the content of an array from `repr`/`str` if it's bigger than 1MiB ↗ google/jax