From 31686805f2c31073168a7710da04d7cbe542fe13 Mon Sep 17 00:00:00 2001 From: J M Dieterich Date: Tue, 16 Apr 2019 10:50:28 -0700 Subject: [PATCH] Enable unit tests for ROCm 2.3 (#19307) Summary: Unit tests that hang on clock64() calls are now fixed. test_gamma_gpu_sample is now fixed. Pull Request resolved: https://github.com/pytorch/pytorch/pull/19307 Differential Revision: D14953420 Pulled By: bddppq fbshipit-source-id: efe807b54e047578415eb1b1e03f8ad44ea27c13 --- test/test_cuda.py | 11 ----------- test/test_distributions.py | 3 +-- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/test/test_cuda.py b/test/test_cuda.py index 4e7ce5a..6774b72 100644 --- a/test/test_cuda.py +++ b/test/test_cuda.py @@ -962,7 +962,6 @@ class TestCuda(TestCase): self.assertEqual(y, x) @unittest.skipIf(not TEST_MULTIGPU, "only one GPU detected") - @skipIfRocm def test_copy_streams(self): d0 = torch.device('cuda:0') x0 = torch.zeros(5, 5, device=d0) @@ -1497,7 +1496,6 @@ class TestCuda(TestCase): torch.cuda.synchronize() @unittest.skipIf(not TEST_MULTIGPU, "detected only one GPU") - @skipIfRocm def test_current_stream(self): d0 = torch.device('cuda:0') d1 = torch.device('cuda:1') @@ -1526,7 +1524,6 @@ class TestCuda(TestCase): torch.cuda.current_stream(torch.device('cpu')) @unittest.skipIf(not TEST_MULTIGPU, "detected only one GPU") - @skipIfRocm def test_default_stream(self): d0 = torch.device('cuda:0') d1 = torch.device('cuda:1') @@ -1575,7 +1572,6 @@ class TestCuda(TestCase): self.assertTrue(default_stream.query()) @unittest.skipIf(not TEST_MULTIGPU, "detected only one GPU") - @skipIfRocm def test_stream_event_device(self): d0 = torch.device('cuda:0') d1 = torch.device('cuda:1') @@ -1638,7 +1634,6 @@ class TestCuda(TestCase): self.assertEqual(0, torch.cuda.current_device()) @unittest.skipIf(not TEST_MULTIGPU, "detected only one GPU") - @skipIfRocm def test_streams_multi_gpu(self): default_stream = torch.cuda.current_stream() self.assertEqual(default_stream.device, torch.device('cuda:0')) @@ -1650,7 +1645,6 @@ class TestCuda(TestCase): self.assertNotEqual(torch.cuda.current_stream(), default_stream) @unittest.skipIf(not TEST_MULTIGPU, "detected only one GPU") - @skipIfRocm def test_streams_multi_gpu_query(self): d0 = torch.device('cuda:0') d1 = torch.device('cuda:1') @@ -1741,7 +1735,6 @@ class TestCuda(TestCase): self.assertEqual(torch.cuda.FloatTensor(1, device=0).get_device(), 0) self.assertEqual(torch.cuda.FloatTensor(1, device=None).get_device(), 1) - @skipIfRocm def test_events(self): stream = torch.cuda.current_stream() event = torch.cuda.Event(enable_timing=True) @@ -1859,7 +1852,6 @@ class TestCuda(TestCase): self.assertGreater(parent_time + child_time, total_time * 1.4) @unittest.skipIf(not TEST_MULTIGPU, "detected only one GPU") - @skipIfRocm def test_events_wait(self): d0 = torch.device('cuda:0') d1 = torch.device('cuda:1') @@ -1965,7 +1957,6 @@ class TestCuda(TestCase): with torch.cuda.device(d1): self.assertGreater(e0.elapsed_time(e2), 0) - @skipIfRocm def test_record_stream(self): cycles_per_ms = get_cycles_per_ms() @@ -2003,7 +1994,6 @@ class TestCuda(TestCase): x = torch.arange(0, 10).view((2, 5)) self.assertEqual(x.t(), x.t().pin_memory()) - @skipIfRocm def test_caching_pinned_memory(self): cycles_per_ms = get_cycles_per_ms() @@ -2024,7 +2014,6 @@ class TestCuda(TestCase): self.assertEqual(list(gpu_tensor), [1]) @unittest.skipIf(not TEST_MULTIGPU, "only one GPU detected") - @skipIfRocm def test_caching_pinned_memory_multi_gpu(self): # checks that the events preventing pinned memory from being re-used # too early are recorded on the correct GPU diff --git a/test/test_distributions.py b/test/test_distributions.py index 92840c0..62be589 100644 --- a/test/test_distributions.py +++ b/test/test_distributions.py @@ -31,7 +31,7 @@ from random import shuffle import torch from torch._six import inf -from common_utils import TestCase, run_tests, set_rng_seed, TEST_WITH_UBSAN, load_tests, skipIfRocm +from common_utils import TestCase, run_tests, set_rng_seed, TEST_WITH_UBSAN, load_tests from common_cuda import TEST_CUDA from torch.autograd import grad, gradcheck from torch.distributions import (Bernoulli, Beta, Binomial, Categorical, @@ -1986,7 +1986,6 @@ class TestDistributions(TestCase): @unittest.skipIf(not TEST_CUDA, "CUDA not found") @unittest.skipIf(not TEST_NUMPY, "Numpy not found") - @skipIfRocm def test_gamma_gpu_sample(self): set_rng_seed(0) for alpha, beta in product([0.1, 1.0, 5.0], [0.1, 1.0, 10.0]): -- 2.7.4