From d574df0a420506d24c13d8224f9921a9411b5c18 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Fri, 14 Sep 2018 11:29:10 -0500 Subject: [PATCH 1/9] Enable more tests that relied on CPU LAPACK at compile time. --- test/test_autograd.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/test_autograd.py b/test/test_autograd.py index 0642e87399c67..965fdab9c8b54 100644 --- a/test/test_autograd.py +++ b/test/test_autograd.py @@ -1990,7 +1990,6 @@ def test_cat_empty(self): lambda a, b: torch.cat((a, b)), True, f_args_variable, f_args_tensor) - @skipIfRocm def test_potrf(self): root = Variable(torch.tril(torch.rand(S, S)), requires_grad=True) @@ -2150,7 +2149,6 @@ def run_test(input_size, exponent): run_test((10, 10), torch.zeros(10, 10)) run_test((10,), 0) - @skipIfRocm def test_pinverse(self): # Why is pinverse tested this way, and not ordinarily as other linear algebra methods? # 1. Pseudo-inverses are not generally continuous, which means that they are not differentiable @@ -2546,7 +2544,6 @@ def backward(ctx, gO): out.backward() self.assertIn('MyFunc.apply', str(w[0].message)) - @skipIfRocm def test_symeig_no_eigenvectors(self): A = torch.tensor([[1., 2.], [2., 4.]], dtype=torch.float32, requires_grad=True) w, v = torch.symeig(A, eigenvectors=False) @@ -3185,13 +3182,13 @@ class dont_convert(tuple): 'large', NO_ARGS, [skipIfNoLapack]), ('gesv', (S, S), (random_fullrank_matrix_distinct_singular_value(S),), '', NO_ARGS, [skipIfNoLapack]), ('gesv', (S, S, S), (random_fullrank_matrix_distinct_singular_value(S, S),), - 'batched', NO_ARGS, [skipIfNoLapack, skipIfRocm]), + 'batched', NO_ARGS, [skipIfNoLapack]), ('gesv', (2, 3, S, S), (random_fullrank_matrix_distinct_singular_value(S, 2, 3),), - 'batched_dims', NO_ARGS, [skipIfNoLapack, skipIfRocm]), + 'batched_dims', NO_ARGS, [skipIfNoLapack]), ('gesv', (2, 2, S, S), (random_fullrank_matrix_distinct_singular_value(S, 1),), - 'batched_broadcast_A', NO_ARGS, [skipIfNoLapack, skipIfRocm]), + 'batched_broadcast_A', NO_ARGS, [skipIfNoLapack]), ('gesv', (1, S, S), (random_fullrank_matrix_distinct_singular_value(S, 2, 2),), - 'batched_broadcast_b', NO_ARGS, [skipIfNoLapack, skipIfRocm]), + 'batched_broadcast_b', NO_ARGS, [skipIfNoLapack]), ('fill_', (S, S, S), (1,), 'number'), ('fill_', (), (1,), 'number_scalar'), # FIXME: we should compute the derivative w.r.t torch.tensor(1) From d25e21116317fb576b9480d06431d11af97805b2 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Thu, 13 Sep 2018 14:44:40 -0500 Subject: [PATCH 2/9] Enable a few more tests, now that we have CPU LAPACK From 43fd8fa833cca4db8764ca41520274775f2081f5 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Thu, 13 Sep 2018 17:42:15 -0500 Subject: [PATCH 3/9] Enable even more. From 6ff7b583952320acdd0ed36929480f340700be63 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Fri, 14 Sep 2018 10:37:40 -0500 Subject: [PATCH 4/9] Enable everything - let's see the fallout. From 73526993497226de4c13efde4c30db999395da06 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Fri, 14 Sep 2018 11:39:06 -0500 Subject: [PATCH 5/9] Unrecognized tensor type ID. --- test/test_distributions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_distributions.py b/test/test_distributions.py index 2c489d858c123..b37b71464349d 100644 --- a/test/test_distributions.py +++ b/test/test_distributions.py @@ -1182,6 +1182,7 @@ def test_poisson_sample(self): @unittest.skipIf(not TEST_CUDA, "CUDA not found") @unittest.skipIf(not TEST_NUMPY, "Numpy not found") + @skipIfRocm def test_poisson_gpu_sample(self): set_rng_seed(1) for rate in [0.12, 0.9, 4.0]: From 2647a53ea72382dfc637d7ad635711018204e341 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Fri, 14 Sep 2018 13:03:08 -0500 Subject: [PATCH 6/9] Skip two tests that cause a runtime error (wrong type, test_transform_to_cuda) and a assertion error (wrong result, test_gamma_gpu_sample) --- test/test_distributions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_distributions.py b/test/test_distributions.py index b37b71464349d..91be16728dbbc 100644 --- a/test/test_distributions.py +++ b/test/test_distributions.py @@ -1972,6 +1972,7 @@ def test_gamma_sample(self): @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]): @@ -4123,6 +4124,7 @@ def test_transform_to(self): self.assertEqual(y, y2, message="Error in transform_to({}) pseudoinverse".format(constraint)) @unittest.skipIf(not TEST_CUDA, "CUDA not found") + @skipIfRocm def test_transform_to_cuda(self): for constraint in self.get_constraints(is_cuda=True): t = transform_to(constraint) From 85b22a33b763e6d87ba1b844bc617e53e5bda244 Mon Sep 17 00:00:00 2001 From: Chaitanya Sri Krishna Lolla Date: Wed, 3 Oct 2018 06:36:27 -0700 Subject: [PATCH 7/9] enabled min/max tests in test_cuda (#236) --- test/test_cuda.py | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/test/test_cuda.py b/test/test_cuda.py index 2c647b08cbd60..cf21208c77aab 100644 --- a/test/test_cuda.py +++ b/test/test_cuda.py @@ -353,25 +353,23 @@ def tmp(t): ('kthvalue', small_3d_unique, lambda t: [3],), ('kthvalue', small_3d_unique, lambda t: [3, 1], 'dim'), ('kthvalue', small_3d_unique, lambda t: [3, -1], 'neg_dim'), - ('lerp', small_3d, lambda t: [small_3d(t), 0.3], '', types, False, "skipIfRocm:HalfTensor"), - ('max', small_3d_unique, lambda t: [], '', types, False, "skipIfRocm:HalfTensor"), - ('max', small_3d_unique, lambda t: [1], 'dim', types, False, skipIfRocm), - ('max', small_3d_unique, lambda t: [-1], 'neg_dim', types, False, skipIfRocm), + ('lerp', small_3d, lambda t: [small_3d(t), 0.3]), + ('max', small_3d_unique, lambda t: []), + ('max', small_3d_unique, lambda t: [1], 'dim'), + ('max', small_3d_unique, lambda t: [-1], 'neg_dim'), ('max', medium_2d, lambda t: [medium_2d(t)], 'elementwise'), ('min', small_3d_unique, lambda t: [], '', types, False, "skipIfRocm:HalfTensor"), ('min', small_3d_unique, lambda t: [1], 'dim', types, False, skipIfRocm), ('min', small_3d_unique, lambda t: [-1], 'neg_dim', types, False, skipIfRocm), ('min', medium_2d, lambda t: [medium_2d(t)], 'elementwise'), - ('mean', small_3d, lambda t: [], '', types, False, "skipIfRocm:HalfTensor"), - ('mean', small_3d, lambda t: [-1], 'neg_dim', types, False, "skipIfRocm:DoubleTensor,FloatTensor,HalfTensor"), - ('mean', small_3d, lambda t: [1], 'dim', types, False, "skipIfRocm:DoubleTensor,FloatTensor,HalfTensor"), - ('mode', small_3d, lambda t: [], '', types, False, skipIfRocm), - ('mode', small_3d, lambda t: [1], 'dim', types, False, skipIfRocm), - ('mode', small_3d, lambda t: [-1], 'neg_dim', types, False, skipIfRocm), - ('mvlgamma', lambda t: tensor_clamp(small_2d(t), 0.1, 10), lambda t: [1], '2d_p=1', float_types_no_half, - False, "skipIfRocm:DoubleTensor,FloatTensor"), - ('mvlgamma', lambda t: tensor_clamp(small_2d(t), 0.6, 10), lambda t: [2], '2d_p=2', float_types_no_half, - False, "skipIfRocm:DoubleTensor,FloatTensor"), + ('mean', small_3d, lambda t: []), + ('mean', small_3d, lambda t: [-1], 'neg_dim'), + ('mean', small_3d, lambda t: [1], 'dim'), + ('mode', small_3d, lambda t: []), + ('mode', small_3d, lambda t: [1], 'dim'), + ('mode', small_3d, lambda t: [-1], 'neg_dim'), + ('mvlgamma', lambda t: tensor_clamp(small_2d(t), 0.1, 10), lambda t: [1], '2d_p=1', float_types_no_half), + ('mvlgamma', lambda t: tensor_clamp(small_2d(t), 0.6, 10), lambda t: [2], '2d_p=2', float_types_no_half), ('remainder', small_3d, lambda t: [3], 'value', types, False, "skipIfRocm:HalfTensor"), ('remainder', small_3d, lambda t: [-3], 'negative_value', signed_types), ('remainder', small_3d, lambda t: [small_3d_positive(t)], 'tensor'), @@ -977,7 +975,6 @@ def test_broadcast_cpu(self): def test_broadcast_gpu(self): self._test_broadcast(torch.randn(5, 5).cuda()) - @skipIfRocm def test_min_max_nan(self): tests = [(lambda x: x.min(), 'min'), (lambda x: x.max(), 'max'), @@ -1743,7 +1740,6 @@ def test_tensor_scatterAdd(self): def test_tensor_scatterFill(self): TestTorch._test_scatter_base(self, lambda t: t.cuda(), 'scatter_', True, test_bounds=False) - @skipIfRocm def test_min_max_inits(self): # Testing if THC_reduceAll received the correct index initialization. # This affects the result of THC_reduceAll operations at extreme values @@ -1757,11 +1753,9 @@ def test_min_max_inits(self): _, v = y.min(dim=0) self.assertEqual(v, expected) - @skipIfRocm def test_max_with_inf(self): TestTorch._test_max_with_inf(self, (torch.half, torch.float, torch.double), 'cuda') - @skipIfRocm def test_min_with_inf(self): TestTorch._test_min_with_inf(self, (torch.half, torch.float, torch.double), 'cuda') From 3595d8a0c7cc71e49236d8b12b3a72b6a469ae41 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Tue, 9 Oct 2018 10:35:44 -0500 Subject: [PATCH 8/9] Revert "Unrecognized tensor type ID." This reverts commit 73526993497226de4c13efde4c30db999395da06. --- test/test_distributions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_distributions.py b/test/test_distributions.py index 91be16728dbbc..7e478223dec2e 100644 --- a/test/test_distributions.py +++ b/test/test_distributions.py @@ -1182,7 +1182,6 @@ def test_poisson_sample(self): @unittest.skipIf(not TEST_CUDA, "CUDA not found") @unittest.skipIf(not TEST_NUMPY, "Numpy not found") - @skipIfRocm def test_poisson_gpu_sample(self): set_rng_seed(1) for rate in [0.12, 0.9, 4.0]: From b90e7128825ab6c893f93c66fa3a83a49bdc5133 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Tue, 9 Oct 2018 10:35:48 -0500 Subject: [PATCH 9/9] Revert "Skip two tests that cause a runtime error (wrong type," This reverts commit 2647a53ea72382dfc637d7ad635711018204e341. --- test/test_distributions.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_distributions.py b/test/test_distributions.py index 7e478223dec2e..2c489d858c123 100644 --- a/test/test_distributions.py +++ b/test/test_distributions.py @@ -1971,7 +1971,6 @@ def test_gamma_sample(self): @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]): @@ -4123,7 +4122,6 @@ def test_transform_to(self): self.assertEqual(y, y2, message="Error in transform_to({}) pseudoinverse".format(constraint)) @unittest.skipIf(not TEST_CUDA, "CUDA not found") - @skipIfRocm def test_transform_to_cuda(self): for constraint in self.get_constraints(is_cuda=True): t = transform_to(constraint)