From 8ce7da1aab4f421b837c74ecfa890478eb7d2593 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 05:56:21 +0200 Subject: [PATCH 01/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 28 +++++++++---------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 6cae82b28f..5a5195a636 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -18,14 +18,11 @@ import pytest -from ...utils._dpep_helpers import dpctl_available +from onedal.utils._third_party import dpctl_available, SyclQueue -if dpctl_available: - import dpctl - from dpctl.memory import MemoryUSMDevice, MemoryUSMShared - - -def get_queues(filter_="cpu,gpu"): +# lru_cache is used to limit the number of SyclQueues generated +@functools.lru_cache(maxsize=100) +def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: """Get available dpctl.SycQueues for testing. This is meant to be used for testing purposes only. @@ -47,21 +44,16 @@ def get_queues(filter_="cpu,gpu"): """ queues = [None] if "cpu" in filter_ else [] - if dpctl_available: - if dpctl.has_cpu_devices() and "cpu" in filter_: - queues.append(pytest.param(dpctl.SyclQueue("cpu"), id="SyclQueue_CPU")) - if dpctl.has_gpu_devices() and "gpu" in filter_: - queues.append(pytest.param(dpctl.SyclQueue("gpu"), id="SyclQueue_GPU")) + for i in ["cpu", "gpu"]: + if i in filter_: + try: + queues.append(pytest.param(SyclQueue(i), id=f"SyclQueue_{i.upper()}")) + except [RuntimeError, ValueError]: + pass return queues -def get_memory_usm(): - if dpctl_available: - return [MemoryUSMDevice, MemoryUSMShared] - return [] - - def is_dpctl_device_available(targets): if not isinstance(targets, (list, tuple)): raise TypeError("`targets` should be a list or tuple of strings.") From c5d2b6410416896eca50e58d5bf0948c71ab5add Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:17:14 +0200 Subject: [PATCH 02/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 5a5195a636..619c527aeb 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -30,7 +30,9 @@ def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: Parameters ---------- filter_ : str, default="cpu,gpu" - Configure output list with available dpctl.SycQueues for testing. + Configure output list with availabe SycQueues for testing. + SyclQueues are generated from a comma-separated string following + SYCL's ``filter_selector``. Returns ------- @@ -44,12 +46,11 @@ def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: """ queues = [None] if "cpu" in filter_ else [] - for i in ["cpu", "gpu"]: - if i in filter_: - try: - queues.append(pytest.param(SyclQueue(i), id=f"SyclQueue_{i.upper()}")) - except [RuntimeError, ValueError]: - pass + for i in filter_.split(","): + try: + queues.append(pytest.param(SyclQueue(i), id=f"SyclQueue_{i.upper()}")) + except [RuntimeError, ValueError]: + pass return queues From 359f044a3c9faa1d62b5d1505c3ac4b904a16d5d Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:17:28 +0200 Subject: [PATCH 03/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 619c527aeb..3de80819e8 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -21,7 +21,7 @@ from onedal.utils._third_party import dpctl_available, SyclQueue # lru_cache is used to limit the number of SyclQueues generated -@functools.lru_cache(maxsize=100) +@functools.lru_cache() def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: """Get available dpctl.SycQueues for testing. From 71ef06ce219f6f5a997084a92f367556acede3ef Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:20:04 +0200 Subject: [PATCH 04/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 3de80819e8..6e0bc3ed70 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -36,8 +36,8 @@ def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: Returns ------- - list[dpctl.SycQueue] - The list of dpctl.SycQueue. + list[SyclQueue] + The list of SycQueues. Notes ----- From d9b4869b812a6c8f49f9c9a6725ae6fbe28c78c1 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:21:00 +0200 Subject: [PATCH 05/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 6e0bc3ed70..3056bfb765 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -31,8 +31,8 @@ def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: ---------- filter_ : str, default="cpu,gpu" Configure output list with availabe SycQueues for testing. - SyclQueues are generated from a comma-separated string following - SYCL's ``filter_selector``. + SyclQueues are generated from a comma-separated string with + each element conforming to SYCL's ``filter_selector``. Returns ------- From 904e93f49bfe9ab8d887eaf22e9c324c39c6e078 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:21:17 +0200 Subject: [PATCH 06/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 3056bfb765..d651a58af7 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -37,7 +37,7 @@ def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: Returns ------- list[SyclQueue] - The list of SycQueues. + The list of SyclQueues. Notes ----- From c19bbd663f57a4d191a45934c655ef09eaa89188 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:42:15 +0200 Subject: [PATCH 07/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 39 ++++++++++++++++++------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index d651a58af7..cc8989a1fb 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -15,10 +15,11 @@ # ============================================================================== import functools +from collections.abc import Iterable import pytest -from onedal.utils._third_party import dpctl_available, SyclQueue +from onedal.utils._third_party import SyclQueue # lru_cache is used to limit the number of SyclQueues generated @functools.lru_cache() @@ -55,16 +56,32 @@ def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: return queues -def is_dpctl_device_available(targets): - if not isinstance(targets, (list, tuple)): - raise TypeError("`targets` should be a list or tuple of strings.") - if dpctl_available: - for device in targets: - if device == "cpu" and not dpctl.has_cpu_devices(): - return False - if device == "gpu" and not dpctl.has_gpu_devices(): - return False - return True +def is_sycl_device_available(targets: Iterable[str]) -> bool: + """Check if a SYCL device is available. + + This is meant to be used for testing purposes only. + The check succeeds if any SYCL device in targets are + available. + + Parameters + ---------- + targets : Iterable[str] + SYCL filter strings of possible devices. + + Returns + ------- + bool + Flag if one of the SYCL targets are available. + + """ + if not isinstance(targets, Iterable): + raise TypeError("`targets` should be an iterable of strings.") + for device in targets: + try: + SyclQueue(device) + return True + except [RuntimeError, ValueError]: + pass return False From 3711795277d8eb463718f9f6feca0e2000a4f9dd Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:42:53 +0200 Subject: [PATCH 08/23] Update test_config.py --- sklearnex/tests/test_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearnex/tests/test_config.py b/sklearnex/tests/test_config.py index 6459de8d9b..e5c82f1b7f 100644 --- a/sklearnex/tests/test_config.py +++ b/sklearnex/tests/test_config.py @@ -21,7 +21,7 @@ import onedal import sklearnex -from onedal.tests.utils._device_selection import is_dpctl_device_available +from onedal.tests.utils._device_selection import is_sycl_device_available def test_get_config_contains_sklearn_params(): @@ -128,7 +128,7 @@ def test_config_context_works(): @pytest.mark.skipif( - not is_dpctl_device_available(["gpu"]), reason="Requires a gpu for fallback testing" + not is_sycl_device_available(["gpu"]), reason="Requires a gpu for fallback testing" ) def test_fallback_to_host(caplog): # force a fallback to cpu with direct use of dispatch and PatchingConditionsChain From 940acfcac5bda852dfb46a9eb8324b4dfa7592cd Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:43:44 +0200 Subject: [PATCH 09/23] Update test_memory_usage.py --- sklearnex/tests/test_memory_usage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearnex/tests/test_memory_usage.py b/sklearnex/tests/test_memory_usage.py index 3d4c7d07ea..6c2942cd80 100644 --- a/sklearnex/tests/test_memory_usage.py +++ b/sklearnex/tests/test_memory_usage.py @@ -33,7 +33,7 @@ _convert_to_dataframe, get_dataframes_and_queues, ) -from onedal.tests.utils._device_selection import get_queues, is_dpctl_device_available +from onedal.tests.utils._device_selection import get_queues, is_sycl_device_available from onedal.utils._array_api import _get_sycl_namespace from onedal.utils._dpep_helpers import dpctl_available, dpnp_available from sklearnex import config_context @@ -296,7 +296,7 @@ def test_memory_leaks(estimator, dataframe, queue, order, data_shape): @pytest.mark.skipif( - os.getenv("ZES_ENABLE_SYSMAN") is None or not is_dpctl_device_available(["gpu"]), + os.getenv("ZES_ENABLE_SYSMAN") is None or not is_sycl_device_available(["gpu"]), reason="SYCL device memory leak check requires the level zero sysman", ) @pytest.mark.parametrize("queue", get_queues("gpu")) From e8146bbeaa308d412721487266c312047f4bb1d5 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:48:22 +0200 Subject: [PATCH 10/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index cc8989a1fb..47262da60e 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -60,7 +60,7 @@ def is_sycl_device_available(targets: Iterable[str]) -> bool: """Check if a SYCL device is available. This is meant to be used for testing purposes only. - The check succeeds if any SYCL device in targets are + The check succeeds if any SYCL device in targets is available. Parameters From 122f17075defebd82cb91ea86c6befa28f104066 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:51:57 +0200 Subject: [PATCH 11/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 47262da60e..9d7a094876 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -21,6 +21,7 @@ from onedal.utils._third_party import SyclQueue + # lru_cache is used to limit the number of SyclQueues generated @functools.lru_cache() def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: From 031d4737cacc3faa11238776fd98c87f303c5e4a Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 06:59:13 +0200 Subject: [PATCH 12/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 9d7a094876..f79c89e635 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -24,7 +24,7 @@ # lru_cache is used to limit the number of SyclQueues generated @functools.lru_cache() -def get_queues(filter_="cpu,gpu": str) -> list[SyclQueue]: +def get_queues(filter_: str = "cpu,gpu") -> list[SyclQueue]: """Get available dpctl.SycQueues for testing. This is meant to be used for testing purposes only. From 39855cb3d36403144723187ed33db6f265a881e6 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 07:07:11 +0200 Subject: [PATCH 13/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index f79c89e635..ab135966f6 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -32,7 +32,7 @@ def get_queues(filter_: str = "cpu,gpu") -> list[SyclQueue]: Parameters ---------- filter_ : str, default="cpu,gpu" - Configure output list with availabe SycQueues for testing. + Configure output list with availabe SyclQueues for testing. SyclQueues are generated from a comma-separated string with each element conforming to SYCL's ``filter_selector``. From dd2d04d395b840e4d606c7a8ab68dcf590ab2de3 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 07:11:52 +0200 Subject: [PATCH 14/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index ab135966f6..ae5750f2e8 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -61,7 +61,7 @@ def is_sycl_device_available(targets: Iterable[str]) -> bool: """Check if a SYCL device is available. This is meant to be used for testing purposes only. - The check succeeds if any SYCL device in targets is + The check succeeds if all SYCL device in targets is available. Parameters @@ -72,7 +72,7 @@ def is_sycl_device_available(targets: Iterable[str]) -> bool: Returns ------- bool - Flag if one of the SYCL targets are available. + Flag if all of the SYCL targets are available. """ if not isinstance(targets, Iterable): @@ -80,10 +80,9 @@ def is_sycl_device_available(targets: Iterable[str]) -> bool: for device in targets: try: SyclQueue(device) - return True except [RuntimeError, ValueError]: - pass - return False + return False + return True def pass_if_not_implemented_for_gpu(reason=""): From 7500c41dda361a37c0f3e9f718d0b8b7b70a3048 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 15 Jun 2025 07:17:55 +0200 Subject: [PATCH 15/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index ae5750f2e8..1f05e395bc 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -61,7 +61,7 @@ def is_sycl_device_available(targets: Iterable[str]) -> bool: """Check if a SYCL device is available. This is meant to be used for testing purposes only. - The check succeeds if all SYCL device in targets is + The check succeeds if all SYCL devices in targets are available. Parameters From 9de4a530fe34bc8257f90e24637e4558f4e43f9d Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Wed, 25 Jun 2025 14:58:31 +0200 Subject: [PATCH 16/23] Update test_config.py --- sklearnex/tests/test_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sklearnex/tests/test_config.py b/sklearnex/tests/test_config.py index dd93a8da9a..a647c7d93e 100644 --- a/sklearnex/tests/test_config.py +++ b/sklearnex/tests/test_config.py @@ -150,7 +150,8 @@ def test_host_backend_target_offload(target): @pytest.mark.skipif( - not is_dpctl_device_available(["gpu"]), reason="Requires a gpu for fallback testing" + not is_sycl_device_available(["gpu"]), reason="Requires a gpu for fallback testing" +) def test_fallback_to_host(caplog): # force a fallback to cpu with direct use of dispatch and PatchingConditionsChain # it should complete with allow_fallback_to_host. The queue should be preserved From 58f68aa8969791a107a78b8909df237f212eb36d Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Wed, 25 Jun 2025 17:20:36 +0200 Subject: [PATCH 17/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 1f05e395bc..4f8ab52bcd 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -19,7 +19,13 @@ import pytest -from onedal.utils._third_party import SyclQueue +from onedal.utils._third_party import dpctl_available, SyclQueue + +if dpctl_available: + import dpctl + sycl_creation_err = dpctl._sycl_queue.SyclQueueCreationError +else: + sycl_creation_err = (RuntimeError, ValueError) # lru_cache is used to limit the number of SyclQueues generated @@ -51,7 +57,7 @@ def get_queues(filter_: str = "cpu,gpu") -> list[SyclQueue]: for i in filter_.split(","): try: queues.append(pytest.param(SyclQueue(i), id=f"SyclQueue_{i.upper()}")) - except [RuntimeError, ValueError]: + except sycl_creation_err: pass return queues @@ -80,7 +86,7 @@ def is_sycl_device_available(targets: Iterable[str]) -> bool: for device in targets: try: SyclQueue(device) - except [RuntimeError, ValueError]: + except (RuntimeError, ValueError]: return False return True From 700758f8c2e3fbd88613c4b87fbf0521ff0a37c2 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Wed, 25 Jun 2025 17:40:35 +0200 Subject: [PATCH 18/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 4f8ab52bcd..dda4eb64be 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -23,9 +23,9 @@ if dpctl_available: import dpctl - sycl_creation_err = dpctl._sycl_queue.SyclQueueCreationError + queue_creation_err = dpctl._sycl_queue.SyclQueueCreationError else: - sycl_creation_err = (RuntimeError, ValueError) + queue_creation_err = (RuntimeError, ValueError) # lru_cache is used to limit the number of SyclQueues generated @@ -57,7 +57,7 @@ def get_queues(filter_: str = "cpu,gpu") -> list[SyclQueue]: for i in filter_.split(","): try: queues.append(pytest.param(SyclQueue(i), id=f"SyclQueue_{i.upper()}")) - except sycl_creation_err: + except queue_creation_err: pass return queues @@ -86,7 +86,7 @@ def is_sycl_device_available(targets: Iterable[str]) -> bool: for device in targets: try: SyclQueue(device) - except (RuntimeError, ValueError]: + except queue_creation_err: return False return True From ef2a6f8a42b551c96989f1753282c50874006c6d Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Wed, 25 Jun 2025 17:40:52 +0200 Subject: [PATCH 19/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index dda4eb64be..e507c877f1 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -19,7 +19,7 @@ import pytest -from onedal.utils._third_party import dpctl_available, SyclQueue +from onedal.utils._third_party import SyclQueue, dpctl_available if dpctl_available: import dpctl From 060fa4d564cd5d90b7c93b91f400c26e5b6d2a4b Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Wed, 25 Jun 2025 23:45:22 +0200 Subject: [PATCH 20/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index e507c877f1..08a8f34ec0 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -23,6 +23,7 @@ if dpctl_available: import dpctl + queue_creation_err = dpctl._sycl_queue.SyclQueueCreationError else: queue_creation_err = (RuntimeError, ValueError) From 9970c9cf326ca395965a58669dcf6bb91cdd92f8 Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Thu, 26 Jun 2025 01:07:32 +0200 Subject: [PATCH 21/23] Update ci.yml --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30b1e59e1e..52018558e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -464,10 +464,11 @@ jobs: with: name: sklearnex_build_${{ env.UXL_PYTHONVERSION }} - name: Install PyTorch - if: contains(matrix.FRAMEWORKS, 'pytorch') + if: contains(matrix.FRAMEWORKS, 'numpy') run: | - pip install torch --index-url https://download.pytorch.org/whl/xpu - python -c "import torch; _=[print(torch.xpu.get_device_name(i)) for i in range(torch.xpu.device_count())]" + pip install dpctl==${{ env.DPCTL_VERSION }} + # pip install torch --index-url https://download.pytorch.org/whl/xpu + # python -c "import torch; _=[print(torch.xpu.get_device_name(i)) for i in range(torch.xpu.device_count())]" - name: Install daal4py/sklearnex run: pip install *.whl - name: Sklearnex testing From 7a512c6c1f75b78f8989fc8e675d4fd345c9b27a Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Thu, 26 Jun 2025 02:05:42 +0200 Subject: [PATCH 22/23] Update _device_selection.py --- onedal/tests/utils/_device_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onedal/tests/utils/_device_selection.py b/onedal/tests/utils/_device_selection.py index 08a8f34ec0..e84f52931a 100644 --- a/onedal/tests/utils/_device_selection.py +++ b/onedal/tests/utils/_device_selection.py @@ -30,7 +30,7 @@ # lru_cache is used to limit the number of SyclQueues generated -@functools.lru_cache() +# @functools.lru_cache() def get_queues(filter_: str = "cpu,gpu") -> list[SyclQueue]: """Get available dpctl.SycQueues for testing. From b9839fb8a311fdca046e14a699657f396724b2aa Mon Sep 17 00:00:00 2001 From: Ian Faust Date: Sun, 14 Sep 2025 00:30:23 +0200 Subject: [PATCH 23/23] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a0e4dae4f..1fbf5d30e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -461,7 +461,7 @@ jobs: with: name: sklearnex_build_${{ env.UXL_PYTHONVERSION }} - name: Install PyTorch - if: contains(matrix.FRAMEWORKS, 'numpy') + if: contains(matrix.FRAMEWORKS, 'pytorch') run: | pip install torch --index-url https://download.pytorch.org/whl/cpu python -c "import torch; _=[print(torch.xpu.get_device_name(i)) for i in range(torch.xpu.device_count())]"