Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pathwaysutils/jax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def ifrt_reshard_available() -> bool:

transfer_to_shardings(
[jax.numpy.array([0])],
[jax.sharding.SingleDeviceSharding(jax.devices()[0])],
[jax.sharding.make_single_device_sharding(jax.devices()[0])],
)

except (ImportError, NameError, jax.errors.JaxRuntimeError):
Expand Down
4 changes: 3 additions & 1 deletion pathwaysutils/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def stop_trace() -> None:
and "xprofTraceOptions" in _profile_state.profile_request
):
out_avals = [jax.core.ShapedArray((1,), jnp.object_)]
out_shardings = [jax.sharding.SingleDeviceSharding(jax.devices()[0])]
out_shardings = [
jax.sharding.make_single_device_sharding(jax.devices()[0])
]
else:
out_avals = ()
out_shardings = ()
Expand Down
6 changes: 3 additions & 3 deletions pathwaysutils/test/experimental/reshard_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_sidechannel_reshard_donate(
):
x = jnp.array([1, 2])
devices = jax.devices()
sharding = jax.sharding.SingleDeviceSharding(devices[0])
sharding = jax.sharding.make_single_device_sharding(devices[0])

mock_pe = self.enter_context(
mock.patch.object(plugin_executable, "PluginExecutable", autospec=True)
Expand All @@ -64,7 +64,7 @@ def test_sidechannel_reshard_cache_resharding_plans(
):
x = jnp.array([1, 2])
devices = jax.devices()
sharding = jax.sharding.SingleDeviceSharding(devices[0])
sharding = jax.sharding.make_single_device_sharding(devices[0])

mock_pe = self.enter_context(
mock.patch.object(plugin_executable, "PluginExecutable")
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_sidechannel_reshard_cache_resharding_plans(
def test_sidechannel_reshard_pytree(self):
x = {"a": jnp.array([1]), "b": [jnp.array([2])]}
devices = jax.devices()
sharding = jax.sharding.SingleDeviceSharding(devices[0])
sharding = jax.sharding.make_single_device_sharding(devices[0])
# Tree prefix sharding
tree_sharding = {"a": sharding, "b": [sharding]}

Expand Down
4 changes: 2 additions & 2 deletions pathwaysutils/test/reshard_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_ifrt_reshard_donate(
):
x = jnp.array([1, 2])
devices = jax.devices()
sharding = jax.sharding.SingleDeviceSharding(devices[0])
sharding = jax.sharding.make_single_device_sharding(devices[0])

mock_transfer = self.enter_context(
mock.patch.object(pw_jax, "transfer_to_shardings", autospec=True)
Expand All @@ -60,7 +60,7 @@ def test_ifrt_reshard_donate(
def test_ifrt_reshard_pytree(self):
x = {"a": jnp.array([1]), "b": [jnp.array([2])]}
devices = jax.devices()
sharding = jax.sharding.SingleDeviceSharding(devices[0])
sharding = jax.sharding.make_single_device_sharding(devices[0])
# Tree prefix sharding
tree_sharding = {"a": sharding, "b": [sharding]}

Expand Down
Loading