Skip to content

Commit d4c63d4

Browse files
Merge branch 'main' into dev/pytorch_testing_2
2 parents 092e879 + a0ec356 commit d4c63d4

28 files changed

+689
-1197
lines changed

.ci/pipeline/build-and-test-lnx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ steps:
3737
conda activate CB
3838
if [ -z "${DALROOT}" ]; then conda install -q -y -c conda-forge "dal-devel>=2025.6.1"; fi
3939
pip install -r dependencies-dev
40-
pip list
40+
conda list
4141
env:
4242
DALROOT: ${{ variables.DALROOT }}
4343
displayName: "Install develop requirements"
@@ -62,7 +62,7 @@ steps:
6262
# dpep installation is set to pypi to avoid conflict of numpy versions from pip and conda
6363
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.10\|3.11\|3.12') ] && [ $(SKLEARN_VERSION) != "1.0" ] && [ -z ${NO_DPC} ]; then pip install dpctl==$DPCTL_VERSION dpnp==$DPNP_VERSION; fi
6464
if [ -z "${NO_DPC}" ]; then pip install dpcpp-cpp-rt==$DPCPP_RT_VERSION; fi
65-
pip list
65+
conda list
6666
env:
6767
NO_DPC: ${{ variables.NO_DPC }}
6868
DPCTL_VERSION: 0.21.0

.ci/pipeline/build-and-test-mac.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ steps:
2929
- script: |
3030
source activate CB
3131
pip install -r dependencies-dev
32-
pip list
32+
conda list
3333
displayName: 'Install develop requirements'
3434
- script: |
3535
source activate CB
@@ -41,7 +41,7 @@ steps:
4141
bash .ci/scripts/setup_sklearn.sh $(SKLEARN_VERSION)
4242
pip install --upgrade -r requirements-test.txt
4343
pip install $(python .ci/scripts/get_compatible_scipy_version.py)
44-
pip list
44+
conda list
4545
displayName: 'Install testing requirements'
4646
- script: |
4747
source activate CB

.ci/pipeline/build-and-test-win.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ steps:
2525
pip install --upgrade setuptools
2626
pip install cpufeature
2727
pip install -r dependencies-dev
28-
pip list
2928
if not defined DALROOT conda install -q -y -c conda-forge "dal-devel>=2025.6.1"
29+
conda list
3030
displayName: 'Install develop requirements'
3131
env:
3232
DALROOT: ${{ variables.DALROOT }}
@@ -51,7 +51,7 @@ steps:
5151
cd ..
5252
for /f "delims=" %%c in ('python s\.ci\scripts\get_compatible_scipy_version.py') do set SCIPY_VERSION=%%c
5353
pip install %SCIPY_VERSION%
54-
pip list
54+
conda list
5555
displayName: 'Install testing requirements'
5656
- script: |
5757
call activate CB

.circleci/run_xpu_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
# ==============================================================================
1717

1818
# coding: utf-8
19-
import argparse
2019
import os
2120

21+
os.environ["SCIPY_ARRAY_API"] = "1"
22+
import argparse
23+
2224
import pytest
2325

2426
if __name__ == "__main__":
@@ -83,8 +85,6 @@
8385
if args.json_report_file is not None:
8486
pytest_params += ["--json-report", f"--json-report-file={args.json_report_file}"]
8587

86-
os.environ["SCIPY_ARRAY_API"] = "1"
87-
8888
if not args.no_intel_optimized:
8989
from sklearnex import patch_sklearn
9090

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
repos:
1818
- repo: https://github.com/psf/black
19-
rev: 25.11.0
19+
rev: 25.12.0
2020
hooks:
2121
- id: black
2222
- repo: https://github.com/PyCQA/isort

deselected_tests.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ deselected_tests:
3434
- neighbors/tests/test_neighbors.py::test_nan_euclidean_support[KNeighborsClassifier-params0]
3535
- neighbors/tests/test_neighbors.py::test_nan_euclidean_support[KNeighborsRegressor-params1]
3636
- neighbors/tests/test_neighbors.py::test_nan_euclidean_support[LocalOutlierFactor-params6]
37-
- neighbors/tests/test_neighbors.py::test_neighbor_classifiers_loocv[ball_tree-nn_model0]
38-
- neighbors/tests/test_neighbors.py::test_neighbor_classifiers_loocv[brute-nn_model0]
39-
- neighbors/tests/test_neighbors.py::test_neighbor_classifiers_loocv[kd_tree-nn_model0]
40-
- neighbors/tests/test_neighbors.py::test_neighbor_classifiers_loocv[auto-nn_model0]
4137
# sklearn 1.7 unsupported features
4238
- tests/test_common.py::test_estimators[LinearRegression()-check_sample_weight_equivalence_on_dense_data]
4339

@@ -396,6 +392,9 @@ deselected_tests:
396392
- metrics/tests/test_common.py::test_array_api_compliance
397393
- utils/tests/test_stats.py::test_weighted_percentile_array_api_consistency
398394

395+
# Tests for exact equality, but results have differences in the order of machine epsilon
396+
- neighbors/tests/test_neighbors.py::test_KNeighborsClassifier_multioutput
397+
399398
# --------------------------------------------------------
400399
# No need to test daal4py patching
401400
reduced_tests:
@@ -525,12 +524,8 @@ gpu:
525524
- tests/test_common.py::test_estimators[ExtraTreesClassifier()-check_class_weight_classifiers]
526525
- tests/test_common.py::test_estimators[ExtraTreesRegressor()-check_sample_weights_invariance(kind=zeros)]
527526
- tests/test_common.py::test_estimators[RandomForestRegressor()-check_regressor_data_not_an_array]
528-
529-
# GPU implementation of Extra Trees doesn't support sample_weights
530-
# comparisons to GPU with sample weights will use different algorithms
531-
- tests/test_common.py::test_estimators[ExtraTreesClassifier()-check_sample_weights_invariance(kind=ones)]
532527
- tests/test_common.py::test_estimators[ExtraTreesClassifier()-check_sample_weights_invariance(kind=zeros)]
533-
- tests/test_common.py::test_estimators[ExtraTreesRegressor()-check_sample_weights_invariance(kind=ones)]
528+
- ensemble/tests/test_forest.py::test_min_weight_fraction_leaf
534529

535530
# RuntimeError: Device support is not implemented, failing as result of fallback to cpu false
536531
- svm/tests/test_svm.py::test_unfitted

doc/sources/array_api.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ The following patched classes have support for array API inputs:
9797
- :obj:`sklearn.covariance.EmpiricalCovariance`
9898
- :obj:`sklearnex.covariance.IncrementalEmpiricalCovariance`
9999
- :obj:`sklearn.decomposition.PCA`
100+
- :obj:`sklearn.ensemble.ExtraTreesClassifier`
101+
- :obj:`sklearn.ensemble.ExtraTreesRegressor`
102+
- :obj:`sklearn.ensemble.RandomForestClassifier`
103+
- :obj:`sklearn.ensemble.RandomForestRegressor`
100104
- :obj:`sklearn.linear_model.LinearRegression`
101105
- :obj:`sklearn.linear_model.Ridge`
102106
- :obj:`sklearnex.linear_model.IncrementalLinearRegression`
@@ -108,6 +112,11 @@ The following patched classes have support for array API inputs:
108112
enabled in |sklearn|, when passing these classes as inputs, data will be transferred to host and then back to
109113
device instead of being used directly.
110114

115+
Result attributes of |sklearnex| classes which contain |sklearn| or |sklearnex| classes may not themselves be
116+
array API compliant. For example, ensemble algorithms contain decision tree estimators result objects which
117+
do not comply with the array API standard.
118+
119+
111120

112121
Example usage
113122
=============

doc/sources/distributed-mode.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Several :doc:`GPU-supported algorithms <oneapi-gpu>`
2626
also provide distributed, multi-GPU computing capabilities via integration with |mpi4py|. The prerequisites
2727
match those of GPU computing, along with an MPI backend of your choice (`Intel MPI recommended
2828
<https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html>`_, available
29-
via the ``impi_rt`` python/conda package) and the |mpi4py| python package. If using |sklearnex|
29+
via the ``impi_rt`` / ``impi-rt`` python/conda package) and the |mpi4py| python package. If using |sklearnex|
3030
`installed from sources <https://github.com/uxlfoundation/scikit-learn-intelex/blob/main/INSTALL.md#build-from-sources>`_,
3131
ensure that the spmd_backend is built.
3232

@@ -49,9 +49,9 @@ ensure that the spmd_backend is built.
4949
.. tab:: From Intel's pip Index
5050
::
5151

52-
pip install --index-url https://software.repos.intel.com/python/pypi mpi4py impi_rt
52+
pip install --index-url https://software.repos.intel.com/python/pypi mpi4py impi-rt
5353

54-
It also requires the MPI runtime executable (``mpiexec`` / ``mpirun``) to be from the same library that was used to compile |sklearnex| or from a compatible library. Intel's MPI runtime library is offered as a Python package ``impi_rt`` and will be installed together with the ``mpi4py`` package if executing the commands above, but otherwise, it can be installed separately from different distribution channels:
54+
It also requires the MPI runtime executable (``mpiexec`` / ``mpirun``) to be from the same library that was used to compile |sklearnex| or from a compatible library. Intel's MPI runtime library is offered as a Python package ``impi_rt`` (conda) / ``impi-rt`` (PyPI) and will be installed together with the ``mpi4py`` package if executing the commands above, but otherwise, it can be installed separately from different distribution channels:
5555

5656
.. tabs::
5757
.. tab:: From conda-forge
@@ -67,12 +67,12 @@ ensure that the spmd_backend is built.
6767
.. tab:: From PyPI
6868
::
6969

70-
pip install impi_rt
70+
pip install impi-rt
7171

7272
.. tab:: From Intel's pip Index
7373
::
7474

75-
pip install --index-url https://software.repos.intel.com/python/pypi impi_rt
75+
pip install --index-url https://software.repos.intel.com/python/pypi impi-rt
7676

7777

7878
Using other MPI backends that are not MPICH-compatible (e.g. OpenMPI) requires building |sklearnex| from source with that backend, and using an |mpi4py| built with that same backend.

doc/sources/distributed_daal4py.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ same algorithms to much larger problem sizes.
4545
the MPI runtime library managing the computations to be the same MPI backend library
4646
with which the |sklearnex| library was compiled, or to be ABI compatible with it.
4747
Distributions of the |sklearnex| in PyPI and conda-forge are both compiled with `Intel's MPI <https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html>`__
48-
as MPI backend (offered as Python package ``impi_rt`` in both PyPI and conda): ::
48+
as MPI backend (offered as Python package ``impi_rt`` in conda, or ``impi-rt`` in PyPI): ::
4949

5050
conda install -c conda-forge impi_rt mpi=*=impi
5151

@@ -77,7 +77,7 @@ same algorithms to much larger problem sizes.
7777
.. tab:: From Intel's pip Index
7878
::
7979

80-
pip install --index-url https://software.repos.intel.com/python/pypi mpi4py impi_rt
80+
pip install --index-url https://software.repos.intel.com/python/pypi mpi4py impi-rt
8181

8282

8383
Using distributed mode

onedal/covariance/incremental_covariance.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818

1919
from daal4py.sklearn._utils import daal_check_version
2020

21-
from .._config import _get_config
2221
from .._device_offload import supports_queue
2322
from ..common._backend import bind_default_backend
2423
from ..datatypes import from_table, return_type_constructor, to_table
2524
from ..utils import _sycl_queue_manager as QM
26-
from ..utils._array_api import _get_sycl_namespace
27-
from ..utils.validation import _check_array
2825
from .covariance import BaseEmpiricalCovariance
2926

3027

0 commit comments

Comments
 (0)