Skip to content

Commit 70c9b0a

Browse files
Unskip linalg tests due to fix in gh-2212
1 parent a7985b3 commit 70c9b0a

File tree

5 files changed

+3
-67
lines changed

5 files changed

+3
-67
lines changed

dpnp/tests/test_linalg.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ def test_complex(self, dtype, shape, p):
331331
expected = numpy.linalg.cond(a, p=p)
332332
assert_dtype_allclose(result, expected)
333333

334-
@pytest.mark.skipif(is_cuda_device(), reason="SAT-7589")
335334
@pytest.mark.parametrize(
336335
"p", [None, -dpnp.inf, -2, -1, 1, 2, dpnp.inf, "fro"]
337336
)
@@ -1820,9 +1819,6 @@ class TestLstsq:
18201819
],
18211820
)
18221821
def test_lstsq(self, a_shape, b_shape, dtype):
1823-
if is_cuda_device():
1824-
if a_shape == (2, 4):
1825-
pytest.skip("SAT-7589")
18261822
a_np = numpy.random.rand(*a_shape).astype(dtype)
18271823
b_np = numpy.random.rand(*b_shape).astype(dtype)
18281824

@@ -2197,9 +2193,6 @@ def test_1D_complex(self, dtype, ord, axis, keepdims):
21972193
)
21982194
@pytest.mark.parametrize("keepdims", [True, False])
21992195
def test_2D(self, dtype, ord, axis, keepdims):
2200-
if is_cuda_device():
2201-
if ord in [-2, 2, "nuc"] and axis == None:
2202-
pytest.skip("SAT-7589")
22032196
a = generate_random_numpy_array((3, 5), dtype)
22042197
ia = dpnp.array(a)
22052198
if (axis in [-1, 0, 1] and ord in ["nuc", "fro"]) or (
@@ -2225,9 +2218,6 @@ def test_2D(self, dtype, ord, axis, keepdims):
22252218
)
22262219
@pytest.mark.parametrize("keepdims", [True, False])
22272220
def test_2D_complex(self, dtype, ord, axis, keepdims):
2228-
if is_cuda_device():
2229-
if ord in [-2, 2, "nuc"] and axis == None:
2230-
pytest.skip("SAT-7589")
22312221
x1 = numpy.random.uniform(-5, 5, 15)
22322222
x2 = numpy.random.uniform(-5, 5, 15)
22332223
a = numpy.array(x1 + 1j * x2, dtype=dtype).reshape(3, 5)
@@ -2257,9 +2247,6 @@ def test_2D_complex(self, dtype, ord, axis, keepdims):
22572247
)
22582248
@pytest.mark.parametrize("keepdims", [True, False])
22592249
def test_ND(self, dtype, ord, axis, keepdims):
2260-
if is_cuda_device():
2261-
if ord in [-2, 2, "nuc"] and axis == (0, 1):
2262-
pytest.skip("SAT-7589")
22632250
a = generate_random_numpy_array((2, 3, 4, 5), dtype)
22642251
ia = dpnp.array(a)
22652252
if (axis in [-1, 0, 1] and ord in ["nuc", "fro"]) or (
@@ -2291,9 +2278,6 @@ def test_ND(self, dtype, ord, axis, keepdims):
22912278
)
22922279
@pytest.mark.parametrize("keepdims", [True, False])
22932280
def test_ND_complex(self, dtype, ord, axis, keepdims):
2294-
if is_cuda_device():
2295-
if ord in [-2, 2, "nuc"] and axis == (0, 1):
2296-
pytest.skip("SAT-7589")
22972281
x1 = numpy.random.uniform(-5, 5, 120)
22982282
x2 = numpy.random.uniform(-5, 5, 120)
22992283
a = numpy.array(x1 + 1j * x2, dtype=dtype).reshape(2, 3, 4, 5)
@@ -2327,9 +2311,6 @@ def test_ND_complex(self, dtype, ord, axis, keepdims):
23272311
)
23282312
@pytest.mark.parametrize("keepdims", [True, False])
23292313
def test_usm_ndarray(self, dtype, ord, axis, keepdims):
2330-
if is_cuda_device():
2331-
if ord in [-2, 2, "nuc"] and axis in [(0, 1), (-2, -1)]:
2332-
pytest.skip("SAT-7589")
23332314
a = numpy.array(numpy.random.uniform(-5, 5, 120), dtype=dtype).reshape(
23342315
2, 3, 4, 5
23352316
)
@@ -2407,9 +2388,6 @@ def test_strided_ND(self, axis, stride):
24072388
)
24082389
@pytest.mark.parametrize("keepdims", [True, False])
24092390
def test_matrix_norm(self, ord, keepdims):
2410-
if is_cuda_device():
2411-
if ord in [-2, 2, "nuc"]:
2412-
pytest.skip("SAT-7589")
24132391
a = numpy.array(numpy.random.uniform(-5, 5, 15)).reshape(3, 5)
24142392
ia = dpnp.array(a)
24152393

@@ -2951,9 +2929,6 @@ def check_decomposition(
29512929
ids=["(2, 2)", "(3, 4)", "(5, 3)", "(16, 16)"],
29522930
)
29532931
def test_svd(self, dtype, shape):
2954-
if is_cuda_device():
2955-
if shape == (3, 4):
2956-
pytest.skip("SAT-7589")
29572932
a = numpy.arange(shape[0] * shape[1], dtype=dtype).reshape(shape)
29582933
dp_a = dpnp.array(a)
29592934

@@ -3023,9 +2998,6 @@ class TestSvdvals:
30232998
ids=["(3, 5)", "(4, 2)", "(2, 3, 3)", "(3, 5, 2)"],
30242999
)
30253000
def test_svdvals(self, dtype, shape):
3026-
if is_cuda_device():
3027-
if shape == (3, 5):
3028-
pytest.skip("SAT-7589")
30293001
a = numpy.arange(numpy.prod(shape), dtype=dtype).reshape(shape)
30303002
dp_a = dpnp.array(a)
30313003

@@ -3096,9 +3068,6 @@ def check_types_shapes(self, dp_B, np_B):
30963068
],
30973069
)
30983070
def test_pinv(self, dtype, shape):
3099-
if is_cuda_device():
3100-
if shape in [(3, 4), (2, 2, 4)]:
3101-
pytest.skip("SAT-7589")
31023071
# Set seed_value=81 to prevent
31033072
# random generation of the input singular matrix
31043073
a = generate_random_numpy_array(shape, dtype, seed_value=81)

dpnp/tests/test_sycl_queue.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
assert_dtype_allclose,
1717
generate_random_numpy_array,
1818
get_all_dtypes,
19-
is_cuda_device,
2019
is_win_platform,
2120
)
2221

@@ -1807,9 +1806,6 @@ def test_matrix_rank(data, tol, device):
18071806
ids=["-1", "0", "1", "(0, 1)", "(-2, -1)", "None"],
18081807
)
18091808
def test_norm(device, ord, axis):
1810-
if is_cuda_device():
1811-
if axis in [(0, 1), (-2, -1)] and ord in [-2, 2, "nuc"]:
1812-
pytest.skip("SAT-7589")
18131809
a = numpy.arange(120).reshape(2, 3, 4, 5)
18141810
ia = dpnp.array(a, device=device)
18151811
if (axis in [-1, 0, 1] and ord in ["nuc", "fro"]) or (
@@ -1909,9 +1905,6 @@ def test_qr(shape, mode, device):
19091905
],
19101906
)
19111907
def test_svd(shape, full_matrices, compute_uv, device):
1912-
if is_cuda_device():
1913-
if shape in [(1, 4), (2, 2, 3)]:
1914-
pytest.skip("SAT-7589")
19151908
dtype = dpnp.default_float_type(device)
19161909

19171910
count_elems = numpy.prod(shape)
@@ -2518,9 +2511,6 @@ def test_slogdet(shape, is_empty, device):
25182511
ids=[device.filter_string for device in valid_devices],
25192512
)
25202513
def test_pinv(shape, hermitian, rcond_as_array, device):
2521-
if is_cuda_device():
2522-
if shape == (2, 2, 3):
2523-
pytest.skip("SAT-7589")
25242514
dtype = dpnp.default_float_type(device)
25252515
# Set seed_value=81 to prevent
25262516
# random generation of the input singular matrix

dpnp/tests/test_usm_type.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,6 @@ def test_meshgrid(usm_type_x, usm_type_y):
546546
ids=["-1", "0", "1", "(0, 1)", "(-2, -1)", "None"],
547547
)
548548
def test_norm(usm_type, ord, axis):
549-
if is_cuda_device():
550-
if axis in [(0, 1), (-2, -1)] and ord in [-2, 2, "nuc"]:
551-
pytest.skip("SAT-7589")
552549
ia = dp.arange(120, usm_type=usm_type).reshape(2, 3, 4, 5)
553550
if (axis in [-1, 0, 1] and ord in ["nuc", "fro"]) or (
554551
isinstance(axis, tuple) and ord == 3
@@ -1458,9 +1455,6 @@ def test_inv(shape, is_empty, usm_type):
14581455
],
14591456
)
14601457
def test_svd(usm_type, shape, full_matrices_param, compute_uv_param):
1461-
if is_cuda_device():
1462-
if shape in [(1, 4), (2, 2, 3)]:
1463-
pytest.skip("SAT-7589")
14641458
x = dp.ones(shape, usm_type=usm_type)
14651459

14661460
if compute_uv_param:
@@ -1529,9 +1523,6 @@ def test_matrix_rank(data, tol, usm_type):
15291523
],
15301524
)
15311525
def test_pinv(shape, hermitian, usm_type):
1532-
if is_cuda_device():
1533-
if shape == (2, 2, 3):
1534-
pytest.skip("SAT-7589")
15351526
a_np = generate_random_numpy_array(shape, hermitian=hermitian)
15361527
a = dp.array(a_np, usm_type=usm_type)
15371528

dpnp/tests/third_party/cupy/linalg_tests/test_norms.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
import dpnp as cupy
7-
from dpnp.tests.helper import is_cpu_device, is_cuda_device
7+
from dpnp.tests.helper import is_cpu_device
88
from dpnp.tests.third_party.cupy import testing
99

1010

@@ -63,12 +63,6 @@ class TestNorm(unittest.TestCase):
6363
@testing.numpy_cupy_allclose(rtol=1e-3, atol=1e-4, type_check=False)
6464
# since dtype of sum is different in dpnp and NumPy, type_check=False
6565
def test_norm(self, xp, dtype):
66-
if (
67-
is_cuda_device()
68-
and self.shape == (1, 2)
69-
and self.ord in [-2, 2, "nuc"]
70-
):
71-
pytest.skip("SAT-7589")
7266
a = testing.shaped_arange(self.shape, xp, dtype)
7367
res = xp.linalg.norm(a, self.ord, self.axis, self.keepdims)
7468
if xp == numpy and not isinstance(res, numpy.ndarray):

dpnp/tests/third_party/cupy/linalg_tests/test_solve.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from dpnp.tests.helper import (
88
assert_dtype_allclose,
99
has_support_aspect64,
10-
is_cuda_device,
1110
)
1211
from dpnp.tests.third_party.cupy import testing
1312
from dpnp.tests.third_party.cupy.testing import _condition
@@ -246,23 +245,17 @@ def check_x(self, a_shape, rcond, dtype):
246245

247246
def test_pinv(self):
248247
self.check_x((3, 3), rcond=1e-15)
249-
# skip case where n < m on CUDA (SAT-7589)
250-
if not is_cuda_device():
251-
self.check_x((2, 4), rcond=1e-15)
248+
self.check_x((2, 4), rcond=1e-15)
252249
self.check_x((3, 2), rcond=1e-15)
253250

254251
self.check_x((4, 4), rcond=0.3)
255-
# SAT-7589
256-
if not is_cuda_device():
257-
self.check_x((2, 5), rcond=0.5)
252+
self.check_x((2, 5), rcond=0.5)
258253
self.check_x((5, 3), rcond=0.6)
259254

260-
@pytest.mark.skipif(is_cuda_device(), reason="SAT-7589")
261255
def test_pinv_batched(self):
262256
self.check_x((2, 3, 4), rcond=1e-15)
263257
self.check_x((2, 3, 4, 5), rcond=1e-15)
264258

265-
@pytest.mark.skipif(is_cuda_device(), reason="SAT-7589")
266259
def test_pinv_batched_vector_rcond(self):
267260
self.check_x((2, 3, 4), rcond=[0.2, 0.8])
268261
self.check_x((2, 3, 4, 5), rcond=[[0.2, 0.9, 0.1], [0.7, 0.2, 0.5]])
@@ -313,7 +306,6 @@ def check_invalid_shapes(self, a_shape, b_shape):
313306
with pytest.raises(cupy.linalg.LinAlgError):
314307
cupy.linalg.lstsq(a, b, rcond=None)
315308

316-
@pytest.mark.skipif(is_cuda_device(), reason="SAT-7589")
317309
def test_lstsq_solutions(self):
318310
# Compares numpy.linalg.lstsq and cupy.linalg.lstsq solutions for:
319311
# a shapes range from (3, 3) to (5, 3) and (3, 5)

0 commit comments

Comments
 (0)