Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 62e6fcf

Browse filesBrowse files
betatimthomasjpfan
andauthored
Initial GPU CI setup (#29130)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
1 parent bffa460 commit 62e6fcf
Copy full SHA for 62e6fcf
Expand file treeCollapse file tree

6 files changed

+410
-12
lines changed

‎.github/workflows/cuda-gpu-ci.yml

Copy file name to clipboard
+47Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CUDA GPU
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
pr_id:
6+
description: Test the contents of this Pull Request
7+
required: true
8+
9+
permissions: read-all
10+
11+
jobs:
12+
tests:
13+
runs-on:
14+
group: cuda-gpu-runner-group
15+
name: Run Array API unit tests
16+
steps:
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.12'
20+
- name: Checkout main repository
21+
uses: actions/checkout@v2
22+
- name: Checkout a particular Pull Request
23+
if: inputs.pr_id
24+
env:
25+
PR_ID: ${{ inputs.pr_id }}
26+
GH_TOKEN: ${{ github.token }}
27+
run: |
28+
gh pr checkout ${{ env.PR_ID }}
29+
- name: Cache conda environment
30+
id: cache-conda
31+
uses: actions/cache@v3
32+
with:
33+
path: ~/conda
34+
key: ${{ runner.os }}-build-${{ hashFiles('build_tools/github/create_gpu_environment.sh') }}-${{ hashFiles('build_tools/github/pylatest_conda_forge_cuda_array-api_linux-64_conda.lock') }}
35+
- name: Install miniforge
36+
if: ${{ steps.cache-conda.outputs.cache-hit != 'true' }}
37+
run: bash build_tools/github/create_gpu_environment.sh
38+
- name: Install scikit-learn
39+
run: |
40+
source "${HOME}/conda/etc/profile.d/conda.sh"
41+
conda activate sklearn
42+
pip install --verbose --no-build-isolation --config-settings editable-verbose=true --editable .
43+
- name: Run array API tests
44+
run: |
45+
source "${HOME}/conda/etc/profile.d/conda.sh"
46+
conda activate sklearn
47+
pytest -k 'array_api'

‎.github/workflows/update-lock-files.yml

Copy file name to clipboardExpand all lines: .github/workflows/update-lock-files.yml
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
schedule:
77
- cron: '0 5 * * 1'
88

9+
# XXX Set the right permissions, per step??
10+
# Can we set read only at the global level here and then elevate to write for some steps?
11+
#permissions: read-all
12+
913
jobs:
1014
update_lock_files:
1115
if: github.repository == 'scikit-learn/scikit-learn'
@@ -25,6 +29,8 @@ jobs:
2529
- name: cirrus-arm
2630
update_script_args: "--select-tag arm"
2731
additional_commit_message: "[cirrus arm]"
32+
- name: array API
33+
update_script_args: "--select-tag cuda"
2834

2935
steps:
3036
- uses: actions/checkout@v4
@@ -56,6 +62,14 @@ jobs:
5662
### Note
5763
If the CI tasks fail, create a new branch based on this PR and add the required fixes to that branch.
5864
65+
# The CUDA workflow needs to be triggered explicitly as it uses an expensive runner
66+
- name: Trigger additional tests
67+
if: steps.cpr.outputs.pull-request-number != '' && matrix.name == 'array API'
68+
env:
69+
GH_TOKEN: ${{ github.token }}
70+
run: |
71+
gh workflow run .github/workflows/cuda-gpu-ci.yml -f pr_id=${{steps.cpr.outputs.pull-request-number}}
72+
5973
- name: Check Pull Request
6074
if: steps.cpr.outputs.pull-request-number != ''
6175
run: |
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
7+
bash Miniforge3-$(uname)-$(uname -m).sh -b -p "${HOME}/conda"
8+
source "${HOME}/conda/etc/profile.d/conda.sh"
9+
10+
11+
# defines the get_dep and show_installed_libraries functions
12+
source build_tools/shared.sh
13+
conda activate base
14+
15+
# XXX switch once https://github.com/scikit-learn/scikit-learn/pull/29176 is merged
16+
conda install -c conda-forge "$(get_dep conda-lock min)" -y
17+
conda-lock install --name sklearn build_tools/github/pylatest_conda_forge_cuda_array-api_linux-64_conda.lock

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.