forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (72 loc) · 2.63 KB
/
cuda-ci.yml
File metadata and controls
81 lines (72 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: CUDA GPU
permissions:
contents: read
# Only run this workflow when a Pull Request is labeled with the
# 'CUDA CI' label.
on:
pull_request:
types:
- labeled
jobs:
build_wheel:
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
runs-on: "ubuntu-latest"
name: Build wheel for Pull Request
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
env:
CIBW_BUILD: cp314-manylinux_x86_64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS: x86_64
- uses: actions/upload-artifact@v7
with:
name: cibw-wheels
path: ./wheelhouse/*.whl
tests:
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
needs: [build_wheel]
runs-on:
group: cuda-gpu-runner-group
# Set this high enough so that the tests can comforatble run. We set a
# timeout to make abusing this workflow less attractive.
timeout-minutes: 20
name: Run Array API unit tests
steps:
- uses: actions/download-artifact@v8
with:
pattern: cibw-wheels
path: ~/dist
- uses: actions/setup-python@v6
with:
# XXX: The 3.12.4 release of Python on GitHub Actions is corrupted:
# https://github.com/actions/setup-python/issues/886
python-version: '3.12.3'
- name: Checkout main repository
uses: actions/checkout@v6
- name: Install miniforge
run: bash build_tools/github/create_gpu_environment.sh
- name: Install scikit-learn
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
conda activate sklearn
pip install ~/dist/$(ls ~/dist)
- name: Run array API tests
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
conda activate sklearn
python -c "import sklearn; sklearn.show_versions()"
# Since we are billed GPU usage by the minute, we only run the tests that
# are likely to exercise the CUDA GPU and rely on free CI runners to run
# the tests with PyTorch on non-CUDA devices.
SCIPY_ARRAY_API=1 pytest --pyargs sklearn -k 'cuda or cupy' -vl
# Run in /home/runner to not load sklearn from the checkout repo
working-directory: /home/runner
- name: Run doctests in doc/modules/array_api.rst
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
conda activate sklearn
cd doc
SCIPY_ARRAY_API=1 pytest --doctest-modules modules/array_api.rst