Skip to content

Commit 87cdaff

Browse files
authored
Remove leftovers and workarounds where possible (#1931)
* Make tests rerun conditional * Bump build and host dependencies in meta.yaml * Unmuted tests where fixes are expected to be available * Correct dpctl pinning * Mute test with dpnp.linalg.svd() hanging on Windows * Mute one more test relating to dpnp.linalg.svd() * Mute test_svd_rank4 test relating to dpnp.linalg.svd() * Mute test_svd_rank4_loop test relating to dpnp.linalg.svd()
1 parent 331a680 commit 87cdaff

File tree

5 files changed

+33
-43
lines changed

5 files changed

+33
-43
lines changed

.github/workflows/conda-package.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
1717
CONDA_BUILD_VERSION: '24.5.1'
1818
CONDA_INDEX_VERSION: '0.5.0'
19+
RERUN_TESTS_ON_FAILURE: 'false'
1920
RUN_TESTS_MAX_ATTEMPTS: 2
2021
TEST_ENV_NAME: 'test'
2122
TEST_SCOPE: >-
@@ -255,14 +256,14 @@ jobs:
255256
python -c "import dpnp, dpctl; dpctl.lsplatform()"
256257
python -c "import dpnp; print(dpnp.__version__)"
257258
258-
# TODO: run the whole scope once the issues on CPU are resolved
259-
# - name: Run tests
260-
# run: |
261-
# python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
262-
# working-directory: ${{ env.tests-path }}
259+
- name: Run tests
260+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
261+
run: |
262+
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
263+
working-directory: ${{ env.tests-path }}
263264

264-
# TODO: remove once 2024.2 release is published
265265
- name: Run tests
266+
if: env.RERUN_TESTS_ON_FAILURE == 'true'
266267
id: run_tests_linux
267268
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
268269
with:
@@ -411,14 +412,14 @@ jobs:
411412
python -c "import dpnp, dpctl; dpctl.lsplatform()"
412413
python -c "import dpnp; print(dpnp.__version__)"
413414
414-
# TODO: run the whole scope once the issues on CPU are resolved
415-
# - name: Run tests
416-
# run: |
417-
# python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
418-
# working-directory: ${{ env.tests-path }}
415+
- name: Run tests
416+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
417+
run: |
418+
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
419+
working-directory: ${{ env.tests-path }}
419420

420-
# TODO: remove once 2024.2 release is published
421421
- name: Run tests
422+
if: env.RERUN_TESTS_ON_FAILURE == 'true'
422423
id: run_tests_win
423424
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
424425
with:

conda-recipe/meta.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
{% set required_compiler_and_mkl_version = "2024.0" %}
2-
{% set excluded_compiler_version1 = "2024.0.1" %}
3-
{% set excluded_compiler_version2 = "2024.0.2" %}
4-
{% set excluded_compiler_version3 = "2024.0.3" %}
5-
{% set required_dpctl_version = "0.17.0" %}
1+
{% set required_compiler_and_mkl_version = "2024.2" %}
2+
{% set required_dpctl_version = "0.18.0*" %}
63

74
package:
85
name: dpnp
@@ -27,8 +24,7 @@ requirements:
2724
- scikit-build
2825
build:
2926
- {{ compiler('cxx') }}
30-
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }},!={{ excluded_compiler_version3 }} # [win]
31-
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }} # [linux]
27+
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }}
3228
- sysroot_linux-64 >=2.28 # [linux]
3329
run:
3430
- python

tests/test_linalg.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,10 +1485,6 @@ def test_norm_error(self):
14851485

14861486

14871487
class TestQr:
1488-
# TODO: New packages that fix issue CMPLRLLVM-53771 are only available in internal CI.
1489-
# Skip the tests on cpu until these packages are available for the external CI.
1490-
# Specifically dpcpp_linux-64>=2024.1.0
1491-
@pytest.mark.skipif(is_cpu_device(), reason="CMPLRLLVM-53771")
14921488
@pytest.mark.parametrize("dtype", get_all_dtypes(no_bool=True))
14931489
@pytest.mark.parametrize(
14941490
"shape",
@@ -1574,7 +1570,6 @@ def test_qr_empty(self, dtype, shape, mode):
15741570

15751571
assert_dtype_allclose(dpnp_r, np_r)
15761572

1577-
@pytest.mark.skipif(is_cpu_device(), reason="CMPLRLLVM-53771")
15781573
@pytest.mark.parametrize(
15791574
"mode",
15801575
["r", "raw", "complete", "reduced"],

tests/test_sycl_queue.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,10 +1786,7 @@ def test_array_creation_from_dpctl(copy, device):
17861786
valid_devices,
17871787
ids=[device.filter_string for device in valid_devices],
17881788
)
1789-
# TODO need to delete no_bool=True when use dlpack > 0.7 version
1790-
@pytest.mark.parametrize(
1791-
"arr_dtype", get_all_dtypes(no_float16=True, no_bool=True)
1792-
)
1789+
@pytest.mark.parametrize("arr_dtype", get_all_dtypes(no_float16=True))
17931790
@pytest.mark.parametrize("shape", [tuple(), (2,), (3, 0, 1), (2, 2, 2)])
17941791
def test_from_dlpack(arr_dtype, shape, device):
17951792
X = dpnp.empty(shape=shape, dtype=arr_dtype, device=device)

tests/third_party/cupy/linalg_tests/test_decomposition.py

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

66
import dpnp as cupy
7-
from tests.helper import has_support_aspect64, is_cpu_device
7+
from tests.helper import has_support_aspect64, is_cpu_device, is_win_platform
88
from tests.third_party.cupy import testing
99
from tests.third_party.cupy.testing import _condition
1010

@@ -156,14 +156,6 @@ def test_decomposition(self, dtype):
156156
)
157157
@testing.fix_random()
158158
class TestSVD(unittest.TestCase):
159-
# TODO: New packages that fix issue CMPLRLLVM-53771 are only available in internal CI.
160-
# Skip the tests on cpu until these packages are available for the external CI.
161-
# Specifically dpcpp_linux-64>=2024.1.0
162-
@classmethod
163-
def setUpClass(cls):
164-
if is_cpu_device():
165-
raise unittest.SkipTest("CMPLRLLVM-53771")
166-
167159
def setUp(self):
168160
self.seed = testing.generate_seed()
169161

@@ -287,6 +279,12 @@ def test_svd_rank2_empty_array_compute_uv_false(self, xp):
287279
array, full_matrices=self.full_matrices, compute_uv=False
288280
)
289281

282+
# The issue was expected to be resolved once CMPLRLLVM-53771 is available,
283+
# which has to be included in DPC++ 2024.1.0, but problem still exists
284+
# on Windows
285+
@pytest.mark.skipif(
286+
is_cpu_device() and is_win_platform(), reason="SAT-7145"
287+
)
290288
@_condition.repeat(3, 10)
291289
def test_svd_rank3(self):
292290
self.check_usv((2, 3, 4))
@@ -296,6 +294,9 @@ def test_svd_rank3(self):
296294
self.check_usv((2, 4, 3))
297295
self.check_usv((2, 32, 32))
298296

297+
@pytest.mark.skipif(
298+
is_cpu_device() and is_win_platform(), reason="SAT-7145"
299+
)
299300
@_condition.repeat(3, 10)
300301
def test_svd_rank3_loop(self):
301302
# This tests the loop-based batched gesvd on CUDA (_gesvd_batched)
@@ -343,6 +344,9 @@ def test_svd_rank3_empty_array_compute_uv_false2(self, xp):
343344
array, full_matrices=self.full_matrices, compute_uv=False
344345
)
345346

347+
@pytest.mark.skipif(
348+
is_cpu_device() and is_win_platform(), reason="SAT-7145"
349+
)
346350
@_condition.repeat(3, 10)
347351
def test_svd_rank4(self):
348352
self.check_usv((2, 2, 3, 4))
@@ -352,6 +356,9 @@ def test_svd_rank4(self):
352356
self.check_usv((2, 2, 4, 3))
353357
self.check_usv((2, 2, 32, 32))
354358

359+
@pytest.mark.skipif(
360+
is_cpu_device() and is_win_platform(), reason="SAT-7145"
361+
)
355362
@_condition.repeat(3, 10)
356363
def test_svd_rank4_loop(self):
357364
# This tests the loop-based batched gesvd on CUDA (_gesvd_batched)
@@ -410,26 +417,20 @@ def _check_result(self, result_cpu, result_gpu):
410417
assert result_cpu.dtype == result_gpu.dtype
411418
testing.assert_allclose(result_cpu, result_gpu, atol=1e-4)
412419

413-
# TODO: New packages that fix issue CMPLRLLVM-53771 are only available in internal CI.
414-
# Skip the tests on cpu until these packages are available for the external CI.
415-
# Specifically dpcpp_linux-64>=2024.1.0
416-
@pytest.mark.skipif(is_cpu_device(), reason="CMPLRLLVM-53771")
417420
@testing.fix_random()
418421
@_condition.repeat(3, 10)
419422
def test_mode(self):
420423
self.check_mode(numpy.random.randn(2, 4), mode=self.mode)
421424
self.check_mode(numpy.random.randn(3, 3), mode=self.mode)
422425
self.check_mode(numpy.random.randn(5, 4), mode=self.mode)
423426

424-
@pytest.mark.skipif(is_cpu_device(), reason="CMPLRLLVM-53771")
425427
@testing.with_requires("numpy>=1.22")
426428
@testing.fix_random()
427429
def test_mode_rank3(self):
428430
self.check_mode(numpy.random.randn(3, 2, 4), mode=self.mode)
429431
self.check_mode(numpy.random.randn(4, 3, 3), mode=self.mode)
430432
self.check_mode(numpy.random.randn(2, 5, 4), mode=self.mode)
431433

432-
@pytest.mark.skipif(is_cpu_device(), reason="CMPLRLLVM-53771")
433434
@testing.with_requires("numpy>=1.22")
434435
@testing.fix_random()
435436
def test_mode_rank4(self):

0 commit comments

Comments
 (0)