Skip to content

shard_as test is failing #9671

@bhavya01

Description

@bhavya01

The following test corresponding to shard_as is failing. Disabling to unblock pin update for release

@unittest.skipIf(
      xr.device_type() == 'CPU',
      "sharding will be the same for both tensors on single device")
  def test_shard_as(self):
    mesh = self._get_mesh((self.n_devices,))
    partition_spec = (0,)
    x = torch.tensor([1, 2, 3, 4, 5, 6, 7, 8], dtype=torch.float, device='xla')
    x = xs.mark_sharding_with_gradients(x, mesh, partition_spec)
    y = torch.tensor([1, 2, 3, 4, 5, 6, 7, 8], dtype=torch.float, device='xla')

    x, y = xs.shard_as(x, y)
    torch_xla.sync()

    sharding_spec = '{devices=[%d]' % self.n_devices
    x_sharding = torch_xla._XLAC._get_xla_sharding_spec(x)
    y_sharding = torch_xla._XLAC._get_xla_sharding_spec(y)
    self.assertIn(sharding_spec, x_sharding)
    self.assertEqual(x_sharding, y_sharding)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions