diff --git a/test/npu/test_multi_devices_single_process.py b/test/distributed/test_multi_devices_single_process.py similarity index 95% rename from test/npu/test_multi_devices_single_process.py rename to test/distributed/test_multi_devices_single_process.py index 4b987aa4f836bd627a98745b1652f052b3a65cf6..63afacc1d7d38b9ddca32378426e9b09aaf60cce 100644 --- a/test/npu/test_multi_devices_single_process.py +++ b/test/distributed/test_multi_devices_single_process.py @@ -175,6 +175,13 @@ class TestOp(TestCase): custom_output = self._custom_op_exec(query, key, value, head_dim) self.assertRtolEqual(supported_output, custom_output) + def _test_ones_like(self, device="npu:1"): + torch.npu.set_device(0) + expected = torch.ones(100, 100, device=device) + x = torch.randn(100, 100, device=device, dtype=torch.float32) + output = torch.ones_like(x) + self.assertEqual(output, expected) + @skipIfUnsupportMultiNPU(2) def test_aclop_op_with_multi_device(self): torch.npu.set_compile_mode(jit_compile=True) @@ -182,6 +189,7 @@ class TestOp(TestCase): self._test_isfinite() self._test_unique_dim() self._test_npu_prompt_flash_attention() + self._test_ones_like() @skipIfUnsupportMultiNPU(2) def test_opapi_op_with_multi_device(self): @@ -190,6 +198,7 @@ class TestOp(TestCase): self._test_isfinite() self._test_unique_dim() self._test_npu_prompt_flash_attention() + self._test_ones_like() if __name__ == '__main__':