From a472abe3b3b4551a30a9383f7bb345763e87036a Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 3 Jul 2025 07:22:08 -0500 Subject: [PATCH 1/4] Add a helper util to check LTS driver --- dpnp/tests/helper.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dpnp/tests/helper.py b/dpnp/tests/helper.py index 7bf6f156e9eb..5bea7ef63a62 100644 --- a/dpnp/tests/helper.py +++ b/dpnp/tests/helper.py @@ -434,6 +434,15 @@ def is_intel_numpy(): return all(dep["name"].startswith("mkl") for dep in [blas, lapack]) +def is_lts_driver(device=None): + """ + Return True if a test is running on a GPU device with LTS driver version, + False otherwise. + """ + dev = dpctl.select_default_device() if device is None else device + return dev.has_aspect_gpu and "1.3" in dev.driver_version + + def is_win_platform(): """ Return True if a test is running on Windows OS, False otherwise. From f37a86725c08e7bfcd608b69c3e049e488513732 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 3 Jul 2025 07:28:41 -0500 Subject: [PATCH 2/4] Mute test failining due to SAT-7978 --- dpnp/tests/test_arraycreation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dpnp/tests/test_arraycreation.py b/dpnp/tests/test_arraycreation.py index c801b769a7e2..a01446aba7c0 100644 --- a/dpnp/tests/test_arraycreation.py +++ b/dpnp/tests/test_arraycreation.py @@ -19,6 +19,8 @@ assert_dtype_allclose, get_all_dtypes, get_array, + is_lts_driver, + is_win_platform, ) from .third_party.cupy import testing @@ -913,6 +915,10 @@ def test_geomspace_num0(): @pytest.mark.parametrize("num", [2, 4, 8, 3, 9, 27]) @pytest.mark.parametrize("endpoint", [True, False]) def test_logspace(dtype, num, endpoint): + if not is_win_platform() and is_lts_driver(): + if dpnp.issubdtype(dtype, dpnp.integer) and num in [8, 27] and endpoint is True: + pytest.skip("SAT-7978") + start = 2 stop = 5 base = 2 From efc6411e308de28821d9aeb2601d7f4fc97c0371 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 3 Jul 2025 07:30:51 -0500 Subject: [PATCH 3/4] Limit the mute only to Iris Xe GPUs --- dpnp/tests/helper.py | 12 ++++++++++++ dpnp/tests/test_arraycreation.py | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dpnp/tests/helper.py b/dpnp/tests/helper.py index 5bea7ef63a62..fce93e064812 100644 --- a/dpnp/tests/helper.py +++ b/dpnp/tests/helper.py @@ -25,6 +25,11 @@ def _assert_shape(a, b): # numpy output is scalar, then dpnp is 0-D array assert a.shape == (), f"{a.shape} != ()" +def _get_dev_mask(device = None): + dev = dpctl.select_default_device() if device is None else device + dev_info = dpctl.utils.intel_device_info(dev) + return dev_info.get("device_id", 0) & 0xFF00 + def assert_dtype_allclose( dpnp_arr, @@ -434,6 +439,13 @@ def is_intel_numpy(): return all(dep["name"].startswith("mkl") for dep in [blas, lapack]) +def is_iris_xe(device=None): + """ + Return True if a test is running on Iris Xe GPU device, False otherwise. + """ + return _get_dev_mask(device) == 0x9A00 + + def is_lts_driver(device=None): """ Return True if a test is running on a GPU device with LTS driver version, diff --git a/dpnp/tests/test_arraycreation.py b/dpnp/tests/test_arraycreation.py index a01446aba7c0..1ed45e4a77aa 100644 --- a/dpnp/tests/test_arraycreation.py +++ b/dpnp/tests/test_arraycreation.py @@ -19,6 +19,7 @@ assert_dtype_allclose, get_all_dtypes, get_array, + is_iris_xe, is_lts_driver, is_win_platform, ) @@ -915,7 +916,7 @@ def test_geomspace_num0(): @pytest.mark.parametrize("num", [2, 4, 8, 3, 9, 27]) @pytest.mark.parametrize("endpoint", [True, False]) def test_logspace(dtype, num, endpoint): - if not is_win_platform() and is_lts_driver(): + if not is_win_platform() and is_iris_xe() and is_lts_driver(): if dpnp.issubdtype(dtype, dpnp.integer) and num in [8, 27] and endpoint is True: pytest.skip("SAT-7978") From 4804269b22a17a570cfd67d15138253e8d3ba8f2 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 3 Jul 2025 14:32:49 +0200 Subject: [PATCH 4/4] Applied the pre-commit --- dpnp/tests/helper.py | 3 ++- dpnp/tests/test_arraycreation.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dpnp/tests/helper.py b/dpnp/tests/helper.py index fce93e064812..5d8ce22c910e 100644 --- a/dpnp/tests/helper.py +++ b/dpnp/tests/helper.py @@ -25,7 +25,8 @@ def _assert_shape(a, b): # numpy output is scalar, then dpnp is 0-D array assert a.shape == (), f"{a.shape} != ()" -def _get_dev_mask(device = None): + +def _get_dev_mask(device=None): dev = dpctl.select_default_device() if device is None else device dev_info = dpctl.utils.intel_device_info(dev) return dev_info.get("device_id", 0) & 0xFF00 diff --git a/dpnp/tests/test_arraycreation.py b/dpnp/tests/test_arraycreation.py index 1ed45e4a77aa..336162582928 100644 --- a/dpnp/tests/test_arraycreation.py +++ b/dpnp/tests/test_arraycreation.py @@ -917,7 +917,11 @@ def test_geomspace_num0(): @pytest.mark.parametrize("endpoint", [True, False]) def test_logspace(dtype, num, endpoint): if not is_win_platform() and is_iris_xe() and is_lts_driver(): - if dpnp.issubdtype(dtype, dpnp.integer) and num in [8, 27] and endpoint is True: + if ( + dpnp.issubdtype(dtype, dpnp.integer) + and num in [8, 27] + and endpoint is True + ): pytest.skip("SAT-7978") start = 2