jax
46f9bebc - Fix buggy unreduced add lowering.

Commit
223 days ago
Fix buggy unreduced add lowering. I noticed the following program was producing the wrong gradients: ```python import jax import jax.numpy as jnp jax.config.update('jax_num_cpu_devices', 2) mesh = jax.make_mesh((2,) , ("i",)) jax.set_mesh(mesh) x = jax.reshard(jnp.ones((2, 2)), jax.P(None, None, reduced={'i'})) def f(x): return jnp.sum(x + x) y, vjp = jax.vjp(f, x) g = vjp(1.)[0] print(g.sharding) for shard in g.addressable_shards: print(shard.data) ``` The gradient should be an unreduced array where each device-local shard is [[1, 1], [1, 1]], but we were seeing [[2, 2], [2, 2]] on each shard. Yash found and fixed the bug. PiperOrigin-RevId: 878663233
Author
Parents
Loading