-
Notifications
You must be signed in to change notification settings - Fork 183
[CI, enhancement] add pytorch+gpu testing ci #2494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 68 commits
b1f3f2c
dfa286f
55d406c
b3409fe
808b9f0
8240f9d
d6a34c9
37876fc
1290643
39019d3
14b5e89
510791b
a3aba98
ed600bd
90f7e41
304cd59
4399e5b
37ca4fa
0d50b62
586d8b1
cfcb64a
955c200
f7fd7b5
c6c96b4
bbba3f0
cef844b
383db20
4804287
183c9e0
58fe7fa
55d07b2
1326b9a
a786c3d
fc794b6
0e4411c
30cfc15
f7f32c9
39806fb
46e3901
73df608
d9a4a17
348d052
252bb3e
44eb9c2
aab30f1
dee1b32
5dcdb1a
5a995dc
a1c6003
6798495
a6893e0
3acb212
fc36229
8dbf0e1
5f2c7ab
404cfa6
9b3788d
5348c05
6a12107
e291673
0003d03
3710242
3946b65
1362982
356804a
883ce45
4531479
6ac3d94
d212cb9
8becae6
acb6459
ea1372b
97ce7a1
e7c667c
ae0a0e6
efbab94
a293515
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
@@ -161,6 +176,7 @@ jobs: | |
bash .ci/scripts/run_sklearn_tests.sh $CPU | ||
|
||
sklearn_win: | ||
needs: onedal_nightly | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -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 | ||
|
||
|
@@ -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: | | ||
|
@@ -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 == '' }} | ||
|
@@ -313,3 +317,177 @@ 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 | ||
ahuber21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
ahuber21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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 | ||
run: | | ||
pip install -r dependencies-dev | ||
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 | ||
|
||
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" | ||
ahuber21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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: | | ||
pip install -r dependencies-dev | ||
|
||
echo "NUMPY_BUILD=$(python -m pip freeze | grep numpy)" >> "$GITHUB_ENV" | ||
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 | ||
david-cortes-intel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 }} |
Uh oh!
There was an error while loading. Please reload this page.