Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
b1f3f2c
Update _dataframes_support.py
icfaust May 24, 2025
dfa286f
Update conftest.py
icfaust May 24, 2025
55d406c
Update conftest.py
icfaust May 24, 2025
b3409fe
Update _dataframes_support.py
icfaust May 24, 2025
808b9f0
Update _dataframes_support.py
icfaust May 24, 2025
8240f9d
Update _dataframes_support.py
icfaust May 24, 2025
d6a34c9
Update _dataframes_support.py
icfaust May 24, 2025
37876fc
Update _dataframes_support.py
icfaust May 24, 2025
1290643
Update _dataframes_support.py
icfaust May 24, 2025
39019d3
Update _dataframes_support.py
icfaust May 24, 2025
14b5e89
Update conftest.py
icfaust May 24, 2025
510791b
Update conftest.py
icfaust May 24, 2025
a3aba98
Update conftest.py
icfaust May 24, 2025
ed600bd
Update _dataframes_support.py
icfaust May 24, 2025
90f7e41
Update run_test.sh
icfaust May 24, 2025
304cd59
Update conftest.py
icfaust May 24, 2025
4399e5b
Update run_test.sh
icfaust May 24, 2025
37ca4fa
Update run_test.sh
icfaust May 24, 2025
0d50b62
Update ci.yml
icfaust May 26, 2025
586d8b1
Update ci.yml
icfaust May 26, 2025
cfcb64a
Update ci.yml
icfaust May 26, 2025
955c200
Update ci.yml
icfaust May 26, 2025
f7fd7b5
Update ci.yml
icfaust May 26, 2025
c6c96b4
Update ci.yml
icfaust May 26, 2025
bbba3f0
Update ci.yml
icfaust May 26, 2025
cef844b
Update ci.yml
icfaust May 26, 2025
383db20
Update ci.yml
icfaust May 26, 2025
4804287
Update ci.yml
icfaust May 26, 2025
183c9e0
Update ci.yml
icfaust May 26, 2025
58fe7fa
Update ci.yml
icfaust May 27, 2025
55d07b2
Update ci.yml
icfaust May 27, 2025
1326b9a
Update ci.yml
icfaust May 27, 2025
a786c3d
Update ci.yml
icfaust May 27, 2025
fc794b6
Update ci.yml
icfaust May 27, 2025
0e4411c
Update ci.yml
icfaust May 27, 2025
30cfc15
Update ci.yml
icfaust May 27, 2025
f7f32c9
Update ci.yml
icfaust May 27, 2025
39806fb
Update ci.yml
icfaust May 27, 2025
46e3901
Update ci.yml
icfaust May 27, 2025
73df608
Update ci.yml
icfaust May 27, 2025
d9a4a17
Update run_sklearn_tests.sh
icfaust May 27, 2025
348d052
Update ci.yml
icfaust May 27, 2025
252bb3e
Update ci.yml
icfaust May 27, 2025
44eb9c2
Update validation.py
icfaust May 28, 2025
aab30f1
Update validation.py
icfaust May 28, 2025
dee1b32
Update validation.py
icfaust May 28, 2025
5dcdb1a
Update validation.py
icfaust May 28, 2025
5a995dc
Update _device_offload.py
icfaust May 29, 2025
a1c6003
Update _data_conversion.py
icfaust May 29, 2025
6798495
Update __init__.py
icfaust May 29, 2025
a6893e0
Update run_sklearn_tests.sh
icfaust May 29, 2025
3acb212
Update _device_offload.py
icfaust May 29, 2025
fc36229
Update _data_conversion.py
icfaust May 29, 2025
8dbf0e1
Update validation.py
icfaust May 29, 2025
5f2c7ab
Update table.cpp
icfaust May 29, 2025
404cfa6
Update _device_offload.py
icfaust May 29, 2025
9b3788d
Update _device_offload.py
icfaust May 29, 2025
5348c05
Update deselected_tests.yaml
icfaust May 29, 2025
6a12107
Update deselected_tests.yaml
icfaust May 29, 2025
e291673
Update _device_offload.py
icfaust May 29, 2025
0003d03
Update deselected_tests.yaml
icfaust May 29, 2025
3710242
Update ci.yml
icfaust May 29, 2025
3946b65
Update ci.yml
icfaust May 29, 2025
1362982
Merge branch 'uxlfoundation:main' into dev/pytorch_testing_CI
icfaust May 31, 2025
356804a
Update deselected_tests.yaml
icfaust Jun 1, 2025
883ce45
Update ci.yml
icfaust Jun 9, 2025
4531479
Merge branch 'uxlfoundation:main' into dev/pytorch_testing_CI
icfaust Jun 9, 2025
6ac3d94
Update deselected_tests.yaml
icfaust Jun 12, 2025
d212cb9
Update validation.py
icfaust Jun 13, 2025
8becae6
Update ci.yml
icfaust Jun 13, 2025
acb6459
Update __init__.py
icfaust Jun 13, 2025
ea1372b
Update _data_conversion.py
icfaust Jun 13, 2025
97ce7a1
Update _device_offload.py
icfaust Jun 13, 2025
e7c667c
Update ci.yml
icfaust Jun 13, 2025
ae0a0e6
Update _device_offload.py
icfaust Jun 13, 2025
efbab94
Merge branch 'uxlfoundation:main' into dev/pytorch_testing_CI
icfaust Jun 17, 2025
a293515
Update validation.py
icfaust Jun 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .ci/scripts/run_sklearn_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ export DESELECT_FLAGS="--public ${DESELECT_FLAGS}"
if [ -n "${SKLEARNEX_PREVIEW}" ]; then
export DESELECT_FLAGS="--preview ${DESELECT_FLAGS}"
fi
export DESELECTED_TESTS=$(python ../.circleci/deselect_tests.py ../deselected_tests.yaml ${DESELECT_FLAGS})
if [ "$1" == "gpu" ]; then
export DESELECT_FLAGS="--gpu ${DESELECT_FLAGS}"
fi

export DESELECTED_TESTS=$(python ../.circleci/deselect_tests.py ../deselected_tests.yaml ${DESELECT_FLAGS})
# manual setting of OCL_ICD_FILENAMES is required in
# specific MSYS environment with conda packages downloaded from intel channel
if [[ "$(uname)" =~ "MSYS" ]] && [ -z "${OCL_ICD_FILENAMES}" ] && [ -n "${CONDA_PREFIX}" ]; then
Expand Down
253 changes: 218 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,35 @@ env:
DPCTL_VERSION: 0.18.1
DPNP_VERSION: 0.16.0
DPCTL_PY_VERSIONS: '3.9\|3.11'
UXL_PYTHONVERSION: "3.12"
UXL_SKLEARNVERSION: "1.4"
ONEDAL_REPO: "uxlfoundation/oneDAL"

jobs:

onedal_nightly:
runs-on: ubuntu-24.04
name: Identify oneDAL nightly
timeout-minutes: 2

steps:
- name: Get run ID of "Nightly-build" workflow
id: get-run-id
run: |
WF_NAME="Nightly-build"
JQ_QUERY='map(select(.event == "workflow_dispatch" or .event == "schedule")) | .[0].databaseId'
RUN_ID=`gh run --repo ${{ env.ONEDAL_REPO }} list --workflow "${WF_NAME}" --json databaseId,event --status success --jq "${JQ_QUERY}"`
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
outputs:
run-id: ${{ steps.get-run-id.outputs.run-id }}
uxl-python: ${{ env.UXL_PYTHONVERSION }}
uxl-sklearn: ${{ env.UXL_SKLEARNVERSION }}

sklearn_lnx:
needs: onedal_nightly
strategy:
fail-fast: false
matrix:
Expand All @@ -46,7 +72,7 @@ jobs:
SKLEARN_VERSION: "1.2"
- PYTHON_VERSION: "3.11"
SKLEARN_VERSION: "1.3"
name: LinuxNightly/pip Python${{ matrix.PYTHON_VERSION }}_Sklearn${{ matrix.SKLEARN_VERSION }}
name: LinuxNightly/venv Python${{ matrix.PYTHON_VERSION }}_Sklearn${{ matrix.SKLEARN_VERSION }}
runs-on: ubuntu-24.04
timeout-minutes: 120

Expand All @@ -57,32 +83,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Get run ID of "Nightly-build" workflow
id: get-run-id
run: |
OTHER_REPO="uxlfoundation/oneDAL"
WF_NAME="Nightly-build"
JQ_QUERY='map(select(.event == "workflow_dispatch" or .event == "schedule")) | .[0].databaseId'
RUN_ID=`gh run --repo ${OTHER_REPO} list --workflow "${WF_NAME}" --json databaseId,event --status success --jq "${JQ_QUERY}"`
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Download oneDAL build artifact
uses: actions/download-artifact@v4
with:
name: __release_lnx
github-token: ${{ github.token }}
repository: uxlfoundation/oneDAL
run-id: ${{ steps.get-run-id.outputs.run-id }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: ./__release_lnx
- name: Download oneDAL environment artifact
uses: actions/download-artifact@v4
with:
name: oneDAL_env
github-token: ${{ github.token }}
repository: uxlfoundation/oneDAL
run-id: ${{ steps.get-run-id.outputs.run-id }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: .ci/env
- name: Set Environment Variables
id: set-env
Expand Down Expand Up @@ -161,6 +176,7 @@ jobs:
bash .ci/scripts/run_sklearn_tests.sh $CPU

sklearn_win:
needs: onedal_nightly
strategy:
fail-fast: false
matrix:
Expand All @@ -171,7 +187,7 @@ jobs:
SKLEARN_VERSION: "1.2"
- PYTHON_VERSION: "3.11"
SKLEARN_VERSION: "1.3"
name: WindowsNightly/pip Python${{ matrix.PYTHON_VERSION }}_Sklearn${{ matrix.SKLEARN_VERSION }}
name: WindowsNightly/venv Python${{ matrix.PYTHON_VERSION }}_Sklearn${{ matrix.SKLEARN_VERSION }}
runs-on: windows-2025
timeout-minutes: 120

Expand All @@ -182,33 +198,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Get run ID of "Nightly-build" workflow
id: get-run-id
shell: bash
run: |
OTHER_REPO="uxlfoundation/oneDAL"
WF_NAME="Nightly-build"
JQ_QUERY='map(select(.event == "workflow_dispatch" or .event == "schedule")) | .[0].databaseId'
RUN_ID=`gh run --repo ${OTHER_REPO} list --workflow "${WF_NAME}" --json databaseId,event --status success --jq "${JQ_QUERY}"`
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Download oneDAL build artifact
uses: actions/download-artifact@v4
with:
name: __release_win
github-token: ${{ github.token }}
repository: uxlfoundation/oneDAL
run-id: ${{ steps.get-run-id.outputs.run-id }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: ./__release_win
- name: Download Intel BaseKit artifact
uses: actions/download-artifact@v4
with:
name: intel_oneapi_basekit
github-token: ${{ github.token }}
repository: uxlfoundation/oneDAL
run-id: ${{ steps.get-run-id.outputs.run-id }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
- name: Decompress Intel BaseKit
shell: cmd
run: |
Expand All @@ -234,8 +238,8 @@ jobs:
with:
name: opencl_rt_installer
github-token: ${{ github.token }}
repository: uxlfoundation/oneDAL
run-id: ${{ steps.get-run-id.outputs.run-id }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: .
- name: Install Intel OpenCL CPU Runtime
if: ${{ steps.set-env.outputs.DPCFLAG == '' }}
Expand Down Expand Up @@ -313,3 +317,182 @@ jobs:
if "${{ steps.set-env.outputs.DPCFLAG }}"=="" set CPU=cpu
set SKLEARNEX_PREVIEW=YES
bash .ci/scripts/run_sklearn_tests.sh %CPU%

build_uxl:
if: github.repository == 'uxlfoundation/scikit-learn-intelex'
needs: onedal_nightly
name: LinuxNightly build Python${{ needs.onedal_nightly.outputs.uxl-python }}
runs-on: uxl-xlarge
timeout-minutes: 30

steps:
- name: Checkout Scikit-learn-intelex
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.UXL_PYTHONVERSION }}
cache: 'pip'
cache-dependency-path: |
**/dependencies-dev
**/requirements-test.txt
- name: Download oneDAL build artifact
uses: actions/download-artifact@v4
with:
name: __release_lnx
github-token: ${{ github.token }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: ./__release_lnx
- name: Download oneDAL environment artifact
uses: actions/download-artifact@v4
with:
name: oneDAL_env
github-token: ${{ github.token }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: .ci/env
- name: Set Environment Variables
id: set-env
run: |
# Disable SPMD testing
echo "NO_DIST=1" >> "$GITHUB_ENV"
# enable coverage report generation
echo "SKLEARNEX_GCOV=1" >> "$GITHUB_ENV"
- name: apt-get
run: sudo apt-get update && sudo apt-get install -y clang-format
- name: dpcpp installation
run: |
# This CI system yields oneAPI dependencies from the oneDAL repository
bash .ci/env/apt.sh dpcpp
- name: describe system
run: |
source /opt/intel/oneapi/setvars.sh
bash .ci/scripts/describe_system.sh
- name: Install develop requirements
id: install-reqs
run: |
pip install -r dependencies-dev
echo "numpy-version=$(python -m pip freeze | grep numpy)" >> "$GITHUB_OUTPUT"
pip list
- name: Build daal4py/sklearnex
run: |
source .github/scripts/activate_components.sh ${{ steps.set-env.outputs.DPCFLAG }}
python setup.py bdist_wheel
- name: Archive sklearnex build
uses: actions/upload-artifact@v4
with:
name: sklearnex_build_${{ env.UXL_PYTHONVERSION }}
path: |
./dist/*.whl

outputs:
numpy-version: ${{ steps.install-reqs.outputs.numpy-version }}

test_uxl:
strategy:
fail-fast: false
matrix:
include:
- OS: uxl-gpu-xlarge
FRAMEWORKS: "pytorch,numpy"
DEVICE: gpu
- OS: uxl-xlarge
FRAMEWORKS: "pytorch,numpy"
DEVICE: cpu
needs: [onedal_nightly, build_uxl]
name: LinuxNightly [${{ matrix.FRAMEWORKS }}]-${{ matrix.DEVICE }} test Python${{ needs.onedal_nightly.outputs.uxl-python }}_Sklearn${{ needs.onedal_nightly.outputs.uxl-sklearn }}
runs-on: ${{ matrix.OS }}
timeout-minutes: 120
steps:
- name: Checkout Scikit-learn-intelex
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.UXL_PYTHONVERSION }}
cache-dependency-path: |
**/dependencies-dev
**/requirements-test.txt
- name: Download oneDAL build artifact
uses: actions/download-artifact@v4
with:
name: __release_lnx
github-token: ${{ github.token }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: ./__release_lnx
- name: Download oneDAL environment artifact
uses: actions/download-artifact@v4
with:
name: oneDAL_env
github-token: ${{ github.token }}
repository: ${{ env.ONEDAL_REPO }}
run-id: ${{ needs.onedal_nightly.outputs.run-id }}
path: .ci/env
- name: Set Environment Variables
id: set-env
run: |
echo "NO_DIST=1" >> "$GITHUB_ENV"
# enable coverage report generation
echo "COVERAGE_RCFILE=$(readlink -f .coveragerc)" >> "$GITHUB_ENV"
echo "ONEDAL_PYTEST_FRAMEWORKS=${{ matrix.FRAMEWORKS }}" >> "$GITHUB_ENV"
# reduce GPU driver/runner related memory issues
echo "NEOReadDebugKeys=1" >> "$GITHUB_ENV"
echo "EnableRecoverablePageFaults=1" >> "$GITHUB_ENV"
echo "GpuFaultCheckThreshold=0" >> "$GITHUB_ENV"
# set build numpy version for use in generating code coverage
echo "NUMPY_BUILD=${{ needs.build_uxl.outputs.numpy-version }}" >> "$GITHUB_ENV"
- name: apt-get
run: sudo apt-get update
- name: dpcpp installation
run: |
# This CI system yields oneAPI dependencies from the oneDAL repository
bash .ci/env/apt.sh dpcpp
- name: describe system
run: |
source /opt/intel/oneapi/setvars.sh
bash .ci/scripts/describe_system.sh
- name: Install test requirements
run: |
bash .ci/scripts/setup_sklearn.sh ${{ env.UXL_SKLEARNVERSION }}
pip install --upgrade -r requirements-test.txt
pip install $(python .ci/scripts/get_compatible_scipy_version.py ${{ env.UXL_SKLEARVERSION }}) pyyaml
pip list
- name: Download sklearnex wheel
uses: actions/download-artifact@v4
with:
name: sklearnex_build_${{ env.UXL_PYTHONVERSION }}
- name: Install PyTorch
if: contains(matrix.FRAMEWORKS, 'pytorch')
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())]"
- name: Install daal4py/sklearnex
run: pip install *.whl
- name: Sklearnex testing
run: |
source .github/scripts/activate_components.sh
export COVERAGE_FILE=$(pwd)/.coverage.sklearnex
cd .ci
../conda-recipe/run_test.sh
- name: Sklearn testing
run: |
source .github/scripts/activate_components.sh
export COVERAGE_FILE=$(pwd)/.coverage.sklearn
bash .ci/scripts/run_sklearn_tests.sh ${{ matrix.DEVICE }}
- name: Create coverage report
run: |
source .github/scripts/activate_components.sh
bash .github/scripts/generate_coverage_reports.sh uxl_lnx_${{ matrix.DEVICE }}
- name: Archive coverage report
uses: actions/upload-artifact@v4
with:
name: coverage_uxl_lnx_${{ matrix.DEVICE }}
path: |
*uxl_lnx_${{ matrix.DEVICE }}.info
- name: Sklearn testing [preview]
run: |
source .github/scripts/activate_components.sh
export SKLEARNEX_PREVIEW='YES'
bash .ci/scripts/run_sklearn_tests.sh ${{ matrix.DEVICE }}
27 changes: 13 additions & 14 deletions daal4py/sklearn/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,20 @@ def _assert_all_finite(

# Data with small size has too big relative overhead
# TODO: tune threshold size
if hasattr(X, "size"):
if X.size < 32768:
if sklearn_check_version("1.1"):
_sklearn_assert_all_finite(
X,
allow_nan=allow_nan,
msg_dtype=msg_dtype,
estimator_name=estimator_name,
input_name=input_name,
)
else:
_sklearn_assert_all_finite(X, allow_nan=allow_nan, msg_dtype=msg_dtype)
return

is_df = is_DataFrame(X)
if not (is_df or isinstance(X, np.ndarray)) or X.size < 32768:
if sklearn_check_version("1.1"):
_sklearn_assert_all_finite(
X,
allow_nan=allow_nan,
msg_dtype=msg_dtype,
estimator_name=estimator_name,
input_name=input_name,
)
else:
_sklearn_assert_all_finite(X, allow_nan=allow_nan, msg_dtype=msg_dtype)
return

num_of_types = get_number_of_types(X)

# if X is heterogeneous pandas.DataFrame then
Expand Down
Loading
Loading