Skip to content

Commit

Permalink
fixed bug with gather functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sea-Snell committed Jan 7, 2024
1 parent b444ed0 commit 2f3df6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scalax/sharding.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def wrapped(*args):
else:
output = jax.eval_shape(lambda: fun(*args))
matched_out_shardings = self._match_sharding_rule(out_shardings, output)

jitted_fn = jax.jit(
sharding_constrained_fun,
in_shardings=matched_in_shardings,
Expand Down Expand Up @@ -233,7 +233,7 @@ def make_gather_fn(partition_spec):
jax_gather_fn = jax.jit(
lambda x: x,
in_shardings=partition_spec,
out_shardings=None
out_shardings=NamedSharding(self.mesh, PartitionSpec()),
)
def gather_fn(tensor):
return jax.device_get(jax_gather_fn(tensor))
Expand Down

0 comments on commit 2f3df6d

Please sign in to comment.