scikit-learn-intelex 2024.4.0__py312-none-win_amd64.whl → 2025.10.0__py312-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/__init__.py +73 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/__main__.py +58 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/_daal4py.cp312-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/__init__.py +94 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/gbt_convertors.py +1199 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/logistic_regression_builders.py +211 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/tree_based_builders.py +425 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mpi_transceiver.cp312-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/__init__.py +40 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/_n_jobs_support.py +252 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/_utils.py +245 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/dbscan.py +165 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/k_means.py +565 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/tests/test_dbscan.py +109 -0
- {scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn}/decomposition/__init__.py +2 -2
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/decomposition/_pca.py +528 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/AdaBoostClassifier.py +192 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/GBTDAAL.py +333 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/_forest.py +1285 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/tests/test_decision_forest.py +206 -0
- {scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn}/linear_model/__init__.py +29 -28
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_coordinate_descent.py +826 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_linear.py +269 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_ridge.py +290 -0
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/basic_statistics/basic_statistics.py → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/coordinate_descent.py +2 -2
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/linear.py +17 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/logistic_loss.py +195 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/logistic_path.py +561 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/ridge.py +17 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_enet.py +157 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_linear.py +198 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_ridge.py +69 -0
- {scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/preview/cluster → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/manifold}/__init__.py +3 -3
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/manifold/_t_sne.py +432 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/_pairwise.py +259 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/_ranking.py +210 -0
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/linear_model/ridge.py → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/__init__.py +4 -2
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/_split.py +309 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/tests/test_split.py +56 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/__init__.py +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/dispatcher.py +232 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/_models_info.py +164 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/test_monkeypatch.py +71 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/test_patching.py +90 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/utils/_launch_algorithms.py +117 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/__init__.py +21 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_base.py +493 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_classification.py +136 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_regression.py +72 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_unsupervised.py +55 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/tests/test_kneighbors.py +113 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/svm/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/svm/svm.py +736 -0
- {scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd/covariance → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils}/__init__.py +5 -3
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils/base.py +80 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils/tests/test_utils.py +51 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils/validation.py +772 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/__init__.py +151 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_config.py +80 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_device_offload.py +199 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_onedal_py_dpc.cp312-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_onedal_py_host.cp312-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/basic_statistics.py +151 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/incremental_basic_statistics.py +165 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/test_basic_statistics.py +241 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/test_incremental_basic_statistics.py +279 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/utils.py +50 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/dbscan.py +80 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/kmeans.py +582 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/kmeans_init.py +145 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/tests/test_dbscan.py +125 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/tests/test_kmeans.py +88 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/tests/test_kmeans_init.py +93 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/_backend.py +258 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/_estimator_checks.py +47 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/_mixin.py +62 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/hyperparameters.py +148 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/tests/test_sycl.py +148 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/covariance.py +121 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/incremental_covariance.py +151 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/tests/test_covariance.py +50 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/tests/test_incremental_covariance.py +190 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/__init__.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/_data_conversion.py +158 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/_dlpack.py +64 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/_sycl_usm.py +63 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/tests/common.py +131 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/tests/test_data.py +686 -0
- {scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition}/__init__.py +3 -2
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition/incremental_pca.py +218 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition/pca.py +124 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition/tests/test_incremental_pca.py +291 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/dummy/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/dummy/dummy.py +137 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/ensemble/__init__.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/ensemble/forest.py +781 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/ensemble/tests/test_random_forest.py +97 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/incremental_linear_model.py +201 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/linear_model.py +230 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/logistic_regression.py +293 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_incremental_linear_regression.py +213 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_incremental_ridge_regression.py +171 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_linear_regression.py +252 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_logistic_regression.py +95 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_ridge.py +95 -0
- {scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal}/neighbors/__init__.py +19 -19
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/neighbors/neighbors.py +690 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/neighbors/tests/test_knn_classification.py +49 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/get_tree.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/kernel_functions.py +202 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/tests/test_kernel_functions.py +159 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/svm.py +592 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_csr_svm.py +352 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_nusvc.py +204 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_nusvr.py +210 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_svc.py +168 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_svr.py +243 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/tests/test_common.py +71 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/tests/utils/_dataframes_support.py +179 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/tests/utils/_device_selection.py +94 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/_array_api.py +98 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/_sycl_queue_manager.py +213 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/_third_party.py +220 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/tests/test_validation.py +142 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/validation.py +503 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/__init__.py +7 -3
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/__main__.py +2 -2
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/_config.py +163 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/_device_offload.py +205 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/_utils.py +219 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/base.py +109 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/basic_statistics.py +241 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/basic_statistics/incremental_basic_statistics.py +128 -78
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/tests/test_basic_statistics.py +405 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py +101 -32
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/cluster/__init__.py +1 -1
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/cluster/dbscan.py +38 -29
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/cluster/k_means.py +399 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/cluster/tests/test_dbscan.py +8 -6
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/cluster/tests/test_kmeans.py +157 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/conftest.py +20 -1
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/covariance/incremental_covariance.py +440 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/covariance/tests/test_incremental_covariance.py +307 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/decomposition/pca.py +558 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/decomposition/tests/test_pca.py +164 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/dispatcher.py +199 -21
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/doc/third-party-programs.txt +207 -2
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/linear_model/coordinate_descent.py → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/dummy/__init__.py +19 -17
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/dummy/_dummy.py +615 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/dummy/tests/test_dummy.py +62 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/ensemble/_forest.py +288 -440
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/ensemble/tests/test_forest.py +196 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/glob/__main__.py +1 -1
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/glob/dispatcher.py +17 -3
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/__init__.py +32 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/coordinate_descent.py +44 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/incremental_linear.py +427 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/incremental_ridge.py +407 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/linear.py +363 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/logistic_regression.py +466 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/ridge.py +407 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_incremental_linear.py +267 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_incremental_ridge.py +214 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_linear.py +167 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_logreg.py +565 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_ridge.py +256 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/manifold/t_sne.py +11 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/manifold/tests/test_tsne.py +256 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/metrics/pairwise.py +3 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/metrics/ranking.py +3 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/model_selection/split.py +3 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/neighbors/_lof.py +30 -62
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/neighbors/common.py +56 -9
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/neighbors/knn_classification.py +45 -101
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/neighbors/knn_regression.py +63 -94
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/neighbors/knn_unsupervised.py +49 -25
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/neighbors/tests/test_neighbors.py +6 -4
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/preview/__init__.py +1 -1
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/covariance/covariance.py +261 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/preview/covariance/tests/test_covariance.py +54 -8
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/incremental_pca.py +406 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/tests/test_incremental_pca.py +390 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/basic_statistics.py +24 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/incremental_basic_statistics.py +30 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py +117 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/tests/test_incremental_basic_statistics_spmd.py +314 -0
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/basic_statistics.py → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/dbscan.py +9 -4
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/tests/test_dbscan_spmd.py +108 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/tests/test_kmeans_spmd.py +180 -0
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/covariance.py → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/__init__.py +3 -4
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/covariance.py +24 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/incremental_covariance.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/tests/test_covariance_spmd.py +120 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/tests/test_incremental_covariance_spmd.py +200 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/incremental_pca.py +23 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/decomposition/pca.py +6 -4
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/tests/test_incremental_pca_spmd.py +276 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/tests/test_pca_spmd.py +146 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/ensemble/forest.py +299 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/ensemble/tests/test_forest_spmd.py +299 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/linear_model/__init__.py +2 -1
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/incremental_linear_model.py +28 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/linear_model/linear_model.py +7 -4
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_incremental_linear_spmd.py +345 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py +162 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_logistic_regression_spmd.py +169 -0
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd/neighbors/neighbors.py → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/neighbors/__init__.py +1 -3
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py +433 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/_common.py +403 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/svm/nusvc.py +99 -117
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/svm/nusvr.py +55 -16
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/svm/svc.py +95 -113
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/svm/svr.py +51 -16
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/svm/tests/test_svm.py +43 -20
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_common.py +607 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_config.py +256 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_hyperparameters.py +111 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_memory_usage.py +335 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/tests/test_monkeypatch.py +5 -4
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_n_jobs_support.py +111 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/tests/test_patching.py +122 -75
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_run_to_run_stability.py +335 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/utils/__init__.py +48 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/utils/base.py +420 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/utils/spmd.py +198 -0
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/utils/validation.py → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/__init__.py +3 -1
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/_array_api.py +217 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/class_weight.py +100 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/parallel.py +97 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/tests/test_class_weight.py +69 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/tests/test_validation.py +238 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/validation.py +212 -0
- scikit_learn_intelex-2025.10.0.dist-info/METADATA +182 -0
- scikit_learn_intelex-2025.10.0.dist-info/RECORD +267 -0
- {scikit_learn_intelex-2024.4.0.dist-info → scikit_learn_intelex-2025.10.0.dist-info}/WHEEL +1 -1
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/_config.py +0 -110
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/_device_offload.py +0 -250
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/_utils.py +0 -109
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/cluster/k_means.py +0 -17
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/cluster/tests/test_kmeans.py +0 -30
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/covariance/incremental_covariance.py +0 -130
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/covariance/tests/test_incremental_covariance.py +0 -143
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/decomposition/pca.py +0 -335
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/decomposition/tests/test_pca.py +0 -56
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/ensemble/tests/test_forest.py +0 -113
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/linear_model/linear.py +0 -316
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/linear_model/logistic_path.py +0 -17
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/linear_model/logistic_regression.py +0 -385
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_linear.py +0 -117
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_logreg.py +0 -91
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/manifold/tests/test_tsne.py +0 -26
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/preview/cluster/_common.py +0 -84
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/preview/cluster/k_means.py +0 -303
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/preview/covariance/covariance.py +0 -133
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/dbscan.py +0 -50
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/spmd/ensemble/forest.py +0 -71
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/svm/_common.py +0 -185
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/tests/_utils.py +0 -164
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/tests/test_config.py +0 -39
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/tests/test_memory_usage.py +0 -227
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/tests/test_n_jobs_support.py +0 -99
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/tests/test_run_to_run_stability_tests.py +0 -428
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/utils/__init__.py +0 -20
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/utils/_namespace.py +0 -97
- scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex/utils/parallel.py +0 -59
- scikit_learn_intelex-2024.4.0.dist-info/METADATA +0 -230
- scikit_learn_intelex-2024.4.0.dist-info/RECORD +0 -101
- {scikit_learn_intelex-2024.4.0.data/data/Lib/site-packages/sklearnex → scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal}/basic_statistics/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/covariance/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/decomposition/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/ensemble/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/manifold/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/metrics/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/metrics/tests/test_metrics.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/model_selection/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/model_selection/tests/test_model_selection.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/neighbors/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/preview/covariance/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/cluster/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/cluster/kmeans.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/ensemble/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/spmd/linear_model/logistic_regression.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/svm/__init__.py +0 -0
- {scikit_learn_intelex-2024.4.0.data → scikit_learn_intelex-2025.10.0.data}/data/Lib/site-packages/sklearnex/tests/test_parallel.py +0 -0
- {scikit_learn_intelex-2024.4.0.dist-info → scikit_learn_intelex-2025.10.0.dist-info}/LICENSE.txt +0 -0
- {scikit_learn_intelex-2024.4.0.dist-info → scikit_learn_intelex-2025.10.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2024 Intel Corporation
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
# ==============================================================================
|
|
16
|
+
|
|
17
|
+
import logging
|
|
18
|
+
from typing import Any, Callable, Literal, Optional
|
|
19
|
+
|
|
20
|
+
from onedal import Backend, _default_backend, _spmd_backend
|
|
21
|
+
from onedal.utils import _sycl_queue_manager as QM
|
|
22
|
+
|
|
23
|
+
logger = logging.getLogger("sklearnex")
|
|
24
|
+
|
|
25
|
+
# define types for backend functions: default, dpc, spmd
|
|
26
|
+
BackendType = Literal["none", "host", "dpc", "spmd"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class BackendManager:
|
|
30
|
+
def __init__(self, backend_module):
|
|
31
|
+
self.backend = backend_module
|
|
32
|
+
|
|
33
|
+
def get_backend_type(self) -> BackendType:
|
|
34
|
+
if self.backend is None:
|
|
35
|
+
return "none"
|
|
36
|
+
if self.backend.is_spmd:
|
|
37
|
+
return "spmd"
|
|
38
|
+
if self.backend.is_dpc:
|
|
39
|
+
return "dpc"
|
|
40
|
+
return "host"
|
|
41
|
+
|
|
42
|
+
def get_backend_component(self, module_name: str, component_name: str):
|
|
43
|
+
"""Get a component of the backend module.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
module_name : str
|
|
48
|
+
The module to get the component from.
|
|
49
|
+
|
|
50
|
+
component_name : str
|
|
51
|
+
The component to get from the module.
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
result : method, attribute or module
|
|
56
|
+
The component of the module.
|
|
57
|
+
"""
|
|
58
|
+
submodules = module_name.split(".")
|
|
59
|
+
module = getattr(self.backend, submodules[0])
|
|
60
|
+
for submodule in submodules[1:]:
|
|
61
|
+
module = getattr(module, submodule)
|
|
62
|
+
|
|
63
|
+
# component can be provided like submodule.method, there can be arbitrary number of submodules
|
|
64
|
+
# and methods
|
|
65
|
+
result = module
|
|
66
|
+
for part in component_name.split("."):
|
|
67
|
+
result = getattr(result, part)
|
|
68
|
+
|
|
69
|
+
return result
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
default_manager = BackendManager(_default_backend)
|
|
73
|
+
spmd_manager = BackendManager(_spmd_backend)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class BackendFunction:
|
|
77
|
+
"""Wrapper around backend function to allow setting auxiliary information.
|
|
78
|
+
|
|
79
|
+
Parameters
|
|
80
|
+
----------
|
|
81
|
+
method : callable
|
|
82
|
+
Pybind11 backend function.
|
|
83
|
+
|
|
84
|
+
backend : Backend
|
|
85
|
+
Encapsulated oneDAL pybind11 interface.
|
|
86
|
+
|
|
87
|
+
name : str
|
|
88
|
+
Name of function.
|
|
89
|
+
|
|
90
|
+
no_policy : bool
|
|
91
|
+
Flag that a oneDAL policy is not required for function evaluation.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
def __init__(
|
|
95
|
+
self,
|
|
96
|
+
method: Callable[..., Any],
|
|
97
|
+
backend: Backend,
|
|
98
|
+
name: str,
|
|
99
|
+
no_policy: bool,
|
|
100
|
+
):
|
|
101
|
+
self.method = method
|
|
102
|
+
self.name = name
|
|
103
|
+
self.backend = backend
|
|
104
|
+
self.no_policy = no_policy
|
|
105
|
+
|
|
106
|
+
def __call__(self, *args: Any, **kwargs: Any) -> Any:
|
|
107
|
+
"""Dispatch to backend function with the appropriate policy which is determined from the global queue"""
|
|
108
|
+
if not args and not kwargs:
|
|
109
|
+
# immediate dispatching without any arguments, in particular no policy
|
|
110
|
+
return self.method()
|
|
111
|
+
|
|
112
|
+
if self.no_policy:
|
|
113
|
+
return self.method(*args, **kwargs)
|
|
114
|
+
|
|
115
|
+
# use globally configured queue (from `target_offload` configuration or provided data)
|
|
116
|
+
queue = QM.get_global_queue()
|
|
117
|
+
|
|
118
|
+
if queue is not None and not (self.backend.is_dpc or self.backend.is_spmd):
|
|
119
|
+
raise RuntimeError("Operations using queues require the DPC/SPMD backend")
|
|
120
|
+
|
|
121
|
+
if self.backend.is_spmd and queue is None:
|
|
122
|
+
raise RuntimeError("Executing functions from SPMD backend requires a queue")
|
|
123
|
+
|
|
124
|
+
# craft the correct policy including the device queue
|
|
125
|
+
policy = self.backend.get_policy(queue)
|
|
126
|
+
|
|
127
|
+
logger.debug(
|
|
128
|
+
f"Dispatching function '{self.name}' with policy {policy} to {self.backend}"
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
# dispatch to backend function
|
|
132
|
+
return self.method(policy, *args, **kwargs)
|
|
133
|
+
|
|
134
|
+
def __repr__(self) -> str:
|
|
135
|
+
return f"BackendFunction({self.backend}.{self.name})"
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def __decorator(
|
|
139
|
+
method: Callable[..., Any],
|
|
140
|
+
backend_manager: BackendManager,
|
|
141
|
+
module_name: str,
|
|
142
|
+
lookup_name: Optional[str],
|
|
143
|
+
no_policy: bool,
|
|
144
|
+
) -> Callable[..., Any]:
|
|
145
|
+
"""Decorator to bind a method to the specified backend."""
|
|
146
|
+
if lookup_name is None:
|
|
147
|
+
lookup_name = method.__name__
|
|
148
|
+
|
|
149
|
+
if backend_manager.get_backend_type() == "none":
|
|
150
|
+
raise RuntimeError("Internal __decorator() should not be called with no backend")
|
|
151
|
+
|
|
152
|
+
backend_method = backend_manager.get_backend_component(module_name, lookup_name)
|
|
153
|
+
wrapped_method = BackendFunction(
|
|
154
|
+
backend_method,
|
|
155
|
+
backend_manager.backend,
|
|
156
|
+
name=f"{module_name}.{method.__name__}",
|
|
157
|
+
no_policy=no_policy,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
backend_type = backend_manager.get_backend_type()
|
|
161
|
+
logger.debug(
|
|
162
|
+
f"Assigned method '<{backend_type}_backend>.{module_name}.{lookup_name}' to '{method.__qualname__}'"
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
return wrapped_method
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def bind_default_backend(
|
|
169
|
+
module_name: str, lookup_name: Optional[str] = None, no_policy=False
|
|
170
|
+
):
|
|
171
|
+
"""
|
|
172
|
+
Decorator to bind a method from the default backend to a class.
|
|
173
|
+
|
|
174
|
+
This decorator binds a method implementation from the default backend
|
|
175
|
+
(host/dpc). If the default backend is unavailable, the method is
|
|
176
|
+
returned without modification.
|
|
177
|
+
|
|
178
|
+
Parameters
|
|
179
|
+
----------
|
|
180
|
+
module_name : str
|
|
181
|
+
The name of the module where the target function is located (e.g.
|
|
182
|
+
`covariance`).
|
|
183
|
+
|
|
184
|
+
lookup_name : Optional[str], optional
|
|
185
|
+
The name of the method to look up in the backend module. If not
|
|
186
|
+
provided, the name of the decorated method is used.
|
|
187
|
+
|
|
188
|
+
no_policy : bool, optional
|
|
189
|
+
If 'True', the method will be decorated without a policy. Default is
|
|
190
|
+
False.
|
|
191
|
+
|
|
192
|
+
Returns
|
|
193
|
+
-------
|
|
194
|
+
func : Callable[..., Any]
|
|
195
|
+
The decorated method bound to the implementation in default
|
|
196
|
+
backend, or the original method if the default backend is
|
|
197
|
+
unavailable.
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
def decorator(method: Callable[..., Any]):
|
|
201
|
+
# grab the lookup_name from outer scope
|
|
202
|
+
nonlocal lookup_name
|
|
203
|
+
|
|
204
|
+
if _default_backend is None:
|
|
205
|
+
logger.debug(
|
|
206
|
+
f"Default backend unavailable, skipping decoration for '{method.__name__}'"
|
|
207
|
+
)
|
|
208
|
+
return method
|
|
209
|
+
|
|
210
|
+
return __decorator(method, default_manager, module_name, lookup_name, no_policy)
|
|
211
|
+
|
|
212
|
+
return decorator
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def bind_spmd_backend(
|
|
216
|
+
module_name: str, lookup_name: Optional[str] = None, no_policy=False
|
|
217
|
+
):
|
|
218
|
+
"""
|
|
219
|
+
Decorator to bind a method from the SPMD backend to a class.
|
|
220
|
+
|
|
221
|
+
This decorator binds a method implementation from the SPMD backend.
|
|
222
|
+
If the SPMD backend is unavailable, the method is returned without
|
|
223
|
+
modification.
|
|
224
|
+
|
|
225
|
+
Parameters
|
|
226
|
+
----------
|
|
227
|
+
module_name : str
|
|
228
|
+
The name of the module where the target function is located (e.g.
|
|
229
|
+
`covariance`).
|
|
230
|
+
|
|
231
|
+
lookup_name : Optional[str], optional
|
|
232
|
+
The name of the method to look up in the backend module. If not
|
|
233
|
+
provided, the name of the decorated method is used.
|
|
234
|
+
|
|
235
|
+
no_policy : bool, optional
|
|
236
|
+
If 'True', the method will be decorated without a policy. Default is
|
|
237
|
+
False.
|
|
238
|
+
|
|
239
|
+
Returns
|
|
240
|
+
-------
|
|
241
|
+
func : Callable[..., Any]
|
|
242
|
+
The decorated method bound to the implementation in SPMD backend,
|
|
243
|
+
or the original method if the SPMD backend is unavailable.
|
|
244
|
+
"""
|
|
245
|
+
|
|
246
|
+
def decorator(method: Callable[..., Any]):
|
|
247
|
+
# grab the lookup_name from outer scope
|
|
248
|
+
nonlocal lookup_name
|
|
249
|
+
|
|
250
|
+
if _spmd_backend is None:
|
|
251
|
+
logger.debug(
|
|
252
|
+
f"SPMD backend unavailable, skipping decoration for '{method.__name__}'"
|
|
253
|
+
)
|
|
254
|
+
return method
|
|
255
|
+
|
|
256
|
+
return __decorator(method, spmd_manager, module_name, lookup_name, no_policy)
|
|
257
|
+
|
|
258
|
+
return decorator
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ===============================================================================
|
|
2
|
+
# Copyright 2022 Intel Corporation
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
# ===============================================================================
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _check_is_fitted(estimator, attributes=None, *, msg=None):
|
|
19
|
+
if msg is None:
|
|
20
|
+
msg = (
|
|
21
|
+
"This %(name)s instance is not fitted yet. Call 'fit' with "
|
|
22
|
+
"appropriate arguments before using this estimator."
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if not (
|
|
26
|
+
hasattr(estimator, "fit")
|
|
27
|
+
or (hasattr(estimator, "partial_fit") and hasattr(estimator, "finalize_fit"))
|
|
28
|
+
):
|
|
29
|
+
raise TypeError("%s is not an estimator instance." % (estimator))
|
|
30
|
+
|
|
31
|
+
if attributes is not None:
|
|
32
|
+
if not isinstance(attributes, (list, tuple)):
|
|
33
|
+
attributes = [attributes]
|
|
34
|
+
attrs = all([hasattr(estimator, attr) for attr in attributes])
|
|
35
|
+
else:
|
|
36
|
+
attrs = [v for v in vars(estimator) if v.endswith("_") and not v.startswith("__")]
|
|
37
|
+
|
|
38
|
+
if not attrs:
|
|
39
|
+
raise AttributeError(msg % {"name": type(estimator).__name__})
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _is_classifier(estimator):
|
|
43
|
+
return getattr(estimator, "_estimator_type", None) == "classifier"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _is_regressor(estimator):
|
|
47
|
+
return getattr(estimator, "_estimator_type", None) == "regressor"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2021 Intel Corporation
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
# ==============================================================================
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ClusterMixin:
|
|
19
|
+
_estimator_type = "clusterer"
|
|
20
|
+
|
|
21
|
+
def fit_predict(self, X, y=None, queue=None, **kwargs):
|
|
22
|
+
self.fit(X, queue=queue, **kwargs)
|
|
23
|
+
return self.labels_
|
|
24
|
+
|
|
25
|
+
def _more_tags(self):
|
|
26
|
+
return {"preserves_dtype": []}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ClassifierMixin:
|
|
30
|
+
_estimator_type = "classifier"
|
|
31
|
+
|
|
32
|
+
def score(self, X, y, sample_weight=None, queue=None):
|
|
33
|
+
from sklearn.metrics import accuracy_score
|
|
34
|
+
|
|
35
|
+
return accuracy_score(
|
|
36
|
+
y, self.predict(X, queue=queue), sample_weight=sample_weight
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def _more_tags(self):
|
|
40
|
+
return {"requires_y": True}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class RegressorMixin:
|
|
44
|
+
_estimator_type = "regressor"
|
|
45
|
+
|
|
46
|
+
def score(self, X, y, sample_weight=None, queue=None):
|
|
47
|
+
from sklearn.metrics import r2_score
|
|
48
|
+
|
|
49
|
+
return r2_score(y, self.predict(X, queue=queue), sample_weight=sample_weight)
|
|
50
|
+
|
|
51
|
+
def _more_tags(self):
|
|
52
|
+
return {"requires_y": True}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class TransformerMixin:
|
|
56
|
+
_estimator_type = "transformer"
|
|
57
|
+
|
|
58
|
+
def fit_transform(self, X, y=None, queue=None, **fit_params):
|
|
59
|
+
if y is None:
|
|
60
|
+
return self.fit(X, queue=queue, **fit_params).transform(X, queue=queue)
|
|
61
|
+
else:
|
|
62
|
+
return self.fit(X, y, queue=queue, **fit_params).transform(X, queue=queue)
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2023 Intel Corporation
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
# ==============================================================================
|
|
16
|
+
|
|
17
|
+
import logging
|
|
18
|
+
from typing import Callable, Dict, Tuple
|
|
19
|
+
from warnings import warn
|
|
20
|
+
|
|
21
|
+
from daal4py.sklearn._utils import daal_check_version
|
|
22
|
+
from onedal import _default_backend as backend
|
|
23
|
+
|
|
24
|
+
if not daal_check_version((2024, "P", 0)):
|
|
25
|
+
warn("Hyperparameters are supported in oneDAL starting from 2024.0.0 version.")
|
|
26
|
+
hyperparameters_map = {}
|
|
27
|
+
else:
|
|
28
|
+
_hparams_reserved_words = [
|
|
29
|
+
"algorithm",
|
|
30
|
+
"op",
|
|
31
|
+
"setters",
|
|
32
|
+
"getters",
|
|
33
|
+
"backend",
|
|
34
|
+
"is_default",
|
|
35
|
+
"to_dict",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
class HyperParameters:
|
|
39
|
+
"""Class for simplified interaction with oneDAL hyperparameters.
|
|
40
|
+
Overrides `__getattribute__` and `__setattr__` to utilize getters and setters
|
|
41
|
+
of hyperparameter class from onedal backend.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
def __init__(self, algorithm, op, setters, getters, backend):
|
|
45
|
+
self.algorithm = algorithm
|
|
46
|
+
self.op = op
|
|
47
|
+
self.setters = setters
|
|
48
|
+
self.getters = getters
|
|
49
|
+
self.backend = backend
|
|
50
|
+
self.is_default = True
|
|
51
|
+
|
|
52
|
+
def __getattribute__(self, __name):
|
|
53
|
+
if __name in _hparams_reserved_words:
|
|
54
|
+
if __name == "backend":
|
|
55
|
+
# `backend` attribute accessed only for oneDAL kernel calls
|
|
56
|
+
logging.getLogger("sklearnex").debug(
|
|
57
|
+
"Using next hyperparameters for "
|
|
58
|
+
f"'{self.algorithm}.{self.op}': {self.to_dict()}"
|
|
59
|
+
)
|
|
60
|
+
return super().__getattribute__(__name)
|
|
61
|
+
elif __name in self.getters.keys():
|
|
62
|
+
return self.getters[__name]()
|
|
63
|
+
try:
|
|
64
|
+
# try to return attribute from base class
|
|
65
|
+
# required to read builtin attributes like __class__, __doc__, etc.
|
|
66
|
+
# which are used in debuggers
|
|
67
|
+
return super().__getattribute__(__name)
|
|
68
|
+
except AttributeError:
|
|
69
|
+
# raise an AttributeError with a hyperparameter-specific message
|
|
70
|
+
# for easier debugging
|
|
71
|
+
raise AttributeError(
|
|
72
|
+
f"Unknown attribute '{__name}' in "
|
|
73
|
+
f"'{self.algorithm}.{self.op}' hyperparameters"
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def __setattr__(self, __name, __value):
|
|
77
|
+
if __name in _hparams_reserved_words:
|
|
78
|
+
super().__setattr__(__name, __value)
|
|
79
|
+
elif __name in self.setters.keys():
|
|
80
|
+
self.is_default = False
|
|
81
|
+
self.setters[__name](__value)
|
|
82
|
+
else:
|
|
83
|
+
raise ValueError(
|
|
84
|
+
f"Unknown attribute '{__name}' in "
|
|
85
|
+
f"'{self.algorithm}.{self.op}' hyperparameters"
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
def to_dict(self):
|
|
89
|
+
return {name: getter() for name, getter in self.getters.items()}
|
|
90
|
+
|
|
91
|
+
def get_methods_with_prefix(obj, prefix):
|
|
92
|
+
return {
|
|
93
|
+
method.replace(prefix, ""): getattr(obj, method)
|
|
94
|
+
for method in filter(lambda f: f.startswith(prefix), dir(obj))
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
hyperparameters_backend: Dict[Tuple[str, str], Callable] = {
|
|
98
|
+
(
|
|
99
|
+
"linear_regression",
|
|
100
|
+
"train",
|
|
101
|
+
): lambda: backend.linear_model.regression.train_hyperparameters(),
|
|
102
|
+
("covariance", "compute"): lambda: backend.covariance.compute_hyperparameters(),
|
|
103
|
+
}
|
|
104
|
+
if daal_check_version((2024, "P", 300)):
|
|
105
|
+
hyperparameters_backend[("decision_forest", "infer")] = (
|
|
106
|
+
lambda: backend.decision_forest.infer_hyperparameters()
|
|
107
|
+
)
|
|
108
|
+
if daal_check_version((2025, "P", 700)):
|
|
109
|
+
hyperparameters_backend[("pca", "train")] = (
|
|
110
|
+
lambda: backend.decomposition.dim_reduction.train_hyperparameters()
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
hyperparameters_map: Dict[Tuple[str, str], HyperParameters] = {}
|
|
114
|
+
|
|
115
|
+
for (algorithm, op), hyperparameters_lambda in hyperparameters_backend.items():
|
|
116
|
+
hyperparameters = hyperparameters_lambda()
|
|
117
|
+
setters = get_methods_with_prefix(hyperparameters, "set_")
|
|
118
|
+
getters = get_methods_with_prefix(hyperparameters, "get_")
|
|
119
|
+
|
|
120
|
+
if set(setters.keys()) != set(getters.keys()):
|
|
121
|
+
raise ValueError(
|
|
122
|
+
f"Setters and getters in '{algorithm}.{op}' "
|
|
123
|
+
"hyperparameters wrapper do not correspond."
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
hyperparameters_map[(algorithm, op)] = HyperParameters(
|
|
127
|
+
algorithm, op, setters, getters, hyperparameters
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
def get_hyperparameters_backend(algorithm, op):
|
|
131
|
+
"""Get hyperparameters for a specific algorithm and operation."""
|
|
132
|
+
if (algorithm, op) in hyperparameters_backend:
|
|
133
|
+
return hyperparameters_backend[(algorithm, op)]()
|
|
134
|
+
else:
|
|
135
|
+
raise ValueError(f"Hyperparameters for '{algorithm}.{op}' are not defined.")
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def get_hyperparameters(algorithm: str, op: str) -> HyperParameters:
|
|
139
|
+
return hyperparameters_map.get((algorithm, op), None)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def reset_hyperparameters(algorithm: str, op: str) -> None:
|
|
143
|
+
new_hyperparameters_backend = get_hyperparameters_backend(algorithm, op)
|
|
144
|
+
new_setters = get_methods_with_prefix(new_hyperparameters_backend, "set_")
|
|
145
|
+
new_getters = get_methods_with_prefix(new_hyperparameters_backend, "get_")
|
|
146
|
+
hyperparameters_map[(algorithm, op)] = HyperParameters(
|
|
147
|
+
algorithm, op, new_setters, new_getters, new_hyperparameters_backend
|
|
148
|
+
)
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2024 Intel Corporation
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
# ==============================================================================
|
|
16
|
+
|
|
17
|
+
import pytest
|
|
18
|
+
|
|
19
|
+
from onedal import _default_backend as backend
|
|
20
|
+
from onedal.tests.utils._device_selection import get_queues
|
|
21
|
+
from onedal.utils._third_party import dpctl_available
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@pytest.mark.skipif(
|
|
25
|
+
not backend.is_dpc or not dpctl_available, reason="requires dpc backend and dpctl"
|
|
26
|
+
)
|
|
27
|
+
@pytest.mark.parametrize("device_type", ["cpu", "gpu"])
|
|
28
|
+
@pytest.mark.parametrize("device_number", [None, 0, 1, 2, 3])
|
|
29
|
+
def test_sycl_queue_string_creation(device_type, device_number):
|
|
30
|
+
# create devices from strings
|
|
31
|
+
from dpctl import SyclQueue
|
|
32
|
+
from dpctl._sycl_queue import SyclQueueCreationError
|
|
33
|
+
|
|
34
|
+
onedal_SyclQueue = backend.SyclQueue
|
|
35
|
+
|
|
36
|
+
device = (
|
|
37
|
+
":".join([device_type, str(device_number)])
|
|
38
|
+
if device_number is not None
|
|
39
|
+
else device_type
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
raised_exception_dpctl = False
|
|
43
|
+
raised_exception_backend = False
|
|
44
|
+
|
|
45
|
+
try:
|
|
46
|
+
dpctl_string = SyclQueue(device).sycl_device.filter_string
|
|
47
|
+
except SyclQueueCreationError:
|
|
48
|
+
raised_exception_dpctl = True
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
onedal_string = onedal_SyclQueue(device).sycl_device.filter_string
|
|
52
|
+
except RuntimeError:
|
|
53
|
+
raised_exception_backend = True
|
|
54
|
+
|
|
55
|
+
assert raised_exception_dpctl == raised_exception_backend
|
|
56
|
+
if not raised_exception_backend:
|
|
57
|
+
# dpctl filter string converts simple sycl filter_strings
|
|
58
|
+
# i.e. "gpu:1" -> "opencl:gpu:0", use SyclQueue to convert
|
|
59
|
+
# for matching, as oneDAL sycl queue only returns simple
|
|
60
|
+
# strings as these are operationally sufficient
|
|
61
|
+
assert SyclQueue(onedal_string).sycl_device.filter_string == dpctl_string
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@pytest.mark.skipif(
|
|
65
|
+
not backend.is_dpc or not dpctl_available, reason="requires dpc backend and dpctl"
|
|
66
|
+
)
|
|
67
|
+
@pytest.mark.parametrize("queue", get_queues())
|
|
68
|
+
def test_sycl_queue_conversion(queue):
|
|
69
|
+
if queue is None:
|
|
70
|
+
pytest.skip("Not a dpctl queue")
|
|
71
|
+
SyclQueue = queue.__class__
|
|
72
|
+
onedal_SyclQueue = backend.SyclQueue
|
|
73
|
+
|
|
74
|
+
q = onedal_SyclQueue(queue)
|
|
75
|
+
|
|
76
|
+
# convert back and forth to test `_get_capsule` attribute
|
|
77
|
+
for i in range(10):
|
|
78
|
+
q = SyclQueue(q.sycl_device.filter_string)
|
|
79
|
+
q = onedal_SyclQueue(q)
|
|
80
|
+
|
|
81
|
+
assert q.sycl_device.filter_string in queue.sycl_device.filter_string
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@pytest.mark.skipif(
|
|
85
|
+
not backend.is_dpc or not dpctl_available, reason="requires dpc backend and dpctl"
|
|
86
|
+
)
|
|
87
|
+
@pytest.mark.parametrize("queue", get_queues())
|
|
88
|
+
def test_sycl_device_attributes(queue):
|
|
89
|
+
from dpctl import SyclQueue
|
|
90
|
+
|
|
91
|
+
if queue is None:
|
|
92
|
+
pytest.skip("Not a dpctl queue")
|
|
93
|
+
onedal_SyclQueue = backend.SyclQueue
|
|
94
|
+
|
|
95
|
+
onedal_queue = onedal_SyclQueue(queue)
|
|
96
|
+
|
|
97
|
+
# check fp64 support
|
|
98
|
+
assert onedal_queue.sycl_device.has_aspect_fp64 == queue.sycl_device.has_aspect_fp64
|
|
99
|
+
# check fp16 support
|
|
100
|
+
assert onedal_queue.sycl_device.has_aspect_fp16 == queue.sycl_device.has_aspect_fp16
|
|
101
|
+
# check is_cpu
|
|
102
|
+
assert onedal_queue.sycl_device.is_cpu == queue.sycl_device.is_cpu
|
|
103
|
+
# check is_gpu
|
|
104
|
+
assert onedal_queue.sycl_device.is_gpu == queue.sycl_device.is_gpu
|
|
105
|
+
# check device number
|
|
106
|
+
assert onedal_queue.sycl_device.filter_string in queue.sycl_device.filter_string
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@pytest.mark.skipif(not backend.is_dpc, reason="requires dpc backend")
|
|
110
|
+
def test_backend_queue():
|
|
111
|
+
try:
|
|
112
|
+
q = backend.SyclQueue("cpu")
|
|
113
|
+
except RuntimeError:
|
|
114
|
+
pytest.skip("OpenCL CPU runtime not installed")
|
|
115
|
+
|
|
116
|
+
# verify copying via a py capsule object is functional
|
|
117
|
+
q2 = backend.SyclQueue(q._get_capsule())
|
|
118
|
+
# verify copying via the _get_capsule attribute
|
|
119
|
+
q3 = backend.SyclQueue(q)
|
|
120
|
+
# create new queue on the same device for device checks
|
|
121
|
+
q4 = backend.SyclQueue("cpu")
|
|
122
|
+
|
|
123
|
+
q_array = [q, q2, q3]
|
|
124
|
+
|
|
125
|
+
assert all([queue.sycl_device.has_aspect_fp64 for queue in q_array])
|
|
126
|
+
assert all([queue.sycl_device.has_aspect_fp16 for queue in q_array])
|
|
127
|
+
assert all([queue.sycl_device.is_cpu for queue in q_array])
|
|
128
|
+
assert all([not queue.sycl_device.is_gpu for queue in q_array])
|
|
129
|
+
assert all(["cpu" in queue.sycl_device.filter_string for queue in q_array])
|
|
130
|
+
assert q.sycl_device == q4.sycl_device # verify that __eq__ operator works
|
|
131
|
+
assert not (q.sycl_device != q4.sycl_device) # verify that __ne__ operator works
|
|
132
|
+
assert q != q4 # verify two separate cpu queues created
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@pytest.mark.skipif(
|
|
136
|
+
not backend.is_dpc or not dpctl_available, reason="requires dpc backend and dpctl"
|
|
137
|
+
)
|
|
138
|
+
def test_backend_device_id():
|
|
139
|
+
"""verify dpctl device id matches our internal device id"""
|
|
140
|
+
import dpctl
|
|
141
|
+
|
|
142
|
+
for i in range(dpctl.get_num_devices()):
|
|
143
|
+
device = dpctl.SyclDevice(str(i))
|
|
144
|
+
if device.is_gpu or device.is_cpu:
|
|
145
|
+
backend_device = backend.SyclDevice(i)
|
|
146
|
+
assert (
|
|
147
|
+
i == backend_device.get_device_id()
|
|
148
|
+
), f"backend id does not match device_id: {i}"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ===============================================================================
|
|
2
|
+
# Copyright 2023 Intel Corporation
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
# ===============================================================================
|
|
16
|
+
|
|
17
|
+
from .covariance import EmpiricalCovariance
|
|
18
|
+
from .incremental_covariance import IncrementalEmpiricalCovariance
|
|
19
|
+
|
|
20
|
+
__all__ = ["EmpiricalCovariance", "IncrementalEmpiricalCovariance"]
|