forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial GPU CI setup (scikit-learn#29130)
Co-authored-by: Thomas J. Fan <[email protected]>
- Loading branch information
1 parent
bffa460
commit 62e6fcf
Showing
6 changed files
with
410 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: CUDA GPU | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_id: | ||
description: Test the contents of this Pull Request | ||
required: true | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
tests: | ||
runs-on: | ||
group: cuda-gpu-runner-group | ||
name: Run Array API unit tests | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
- name: Checkout main repository | ||
uses: actions/checkout@v2 | ||
- name: Checkout a particular Pull Request | ||
if: inputs.pr_id | ||
env: | ||
PR_ID: ${{ inputs.pr_id }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh pr checkout ${{ env.PR_ID }} | ||
- name: Cache conda environment | ||
id: cache-conda | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/conda | ||
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') }} | ||
- name: Install miniforge | ||
if: ${{ steps.cache-conda.outputs.cache-hit != 'true' }} | ||
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 --verbose --no-build-isolation --config-settings editable-verbose=true --editable . | ||
- name: Run array API tests | ||
run: | | ||
source "${HOME}/conda/etc/profile.d/conda.sh" | ||
conda activate sklearn | ||
pytest -k 'array_api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" | ||
bash Miniforge3-$(uname)-$(uname -m).sh -b -p "${HOME}/conda" | ||
source "${HOME}/conda/etc/profile.d/conda.sh" | ||
|
||
|
||
# defines the get_dep and show_installed_libraries functions | ||
source build_tools/shared.sh | ||
conda activate base | ||
|
||
# XXX switch once https://github.com/scikit-learn/scikit-learn/pull/29176 is merged | ||
conda install -c conda-forge "$(get_dep conda-lock min)" -y | ||
conda-lock install --name sklearn build_tools/github/pylatest_conda_forge_cuda_array-api_linux-64_conda.lock |
Oops, something went wrong.