Skip to content
Open
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
6 changes: 4 additions & 2 deletions tests/ffi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,12 @@ def test_invalid_result_type(self):

@jtu.run_on_devices("gpu", "cpu")
def test_shard_map(self):
if jtu.is_device_rocm:
self.skipTest("Skip on ROCm: tests/ffi_test.py::FfiTest::test_shard_map")
# if jtu.is_device_rocm:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented lines.

# self.skipTest("Skip on ROCm: tests/ffi_test.py::FfiTest::test_shard_map")
mesh = jtu.create_mesh((len(jax.devices()),), ("i",))
x = self.rng().randn(8, 4, 5).astype(np.float32)
n = len(jax.devices())
x = x[:(x.shape[0] // n) * n]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trims the array, however trimming the array could hinder the mathematical correction of this test. Instead of trimming we can also pad the array like I did in #509 to prevent information loss. Could you please explain how this is mathematically correct and we are not losing info?


@partial(shard_map, mesh=mesh, in_specs=P("i"), out_specs=P("i"))
def f(x):
Expand Down