Skip to content

Commit 4cc487c

Browse files
Tom AugspurgerTomAugspurger
Tom Augspurger
authored andcommitted
Added runner for upstream dask gpu tests
This adds a Cron Job to the github actions that runs the `gpu` marked tests from dask and distributed. The setup here is modeled after https://github.com/rapidsai/cudf/blob/branch-25.02/.github/workflows/pandas-tests.yaml, which is running pandas tests against the nightly versions of cudf.
1 parent 5f105bc commit 4cc487c

File tree

6 files changed

+87
-107
lines changed

6 files changed

+87
-107
lines changed

.github/workflows/cron.yaml

+25-74
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,29 @@
1+
# Based off https://github.com/rapidsai/cudf/blob/branch-25.02/.github/workflows/pandas-tests.yaml
2+
name: Test dask-upstream
3+
14
on:
2-
# TODO: change to cron-based schedule one this is working
3-
push:
4-
branches:
5-
- main
5+
workflow_dispatch:
6+
inputs:
7+
branch:
8+
required: true
9+
type: string
10+
date:
11+
required: true
12+
type: string
13+
sha:
14+
required: true
15+
type: string
616

717
jobs:
8-
test:
9-
name: "Test dask and distributed"
10-
# TODO: change to appropriate image
11-
runs-on: "linux-amd64-gpu-v100-latest-1"
12-
container:
13-
image: rapidsai/distributed:24.12-cuda11.8.0-devel-ubuntu20.04-py3.12
14-
env:
15-
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
16-
steps:
17-
- name: Checkout ourselves
18-
uses: actions/checkout@v4
19-
with:
20-
path: utils
21-
- name: Checkout dask
22-
uses: actions/checkout@v4
23-
with:
24-
repository: dask/dask
25-
path: dask
26-
- name: Checkout distributed
27-
uses: actions/checkout@v4
28-
with:
29-
repository: dask/distributed
30-
path: distributed
31-
- name: Run
32-
run: |
33-
(cd dask; git rev-parse HEAD;
34-
cd ../distributed; git rev-parse HEAD) | tee commit-hashes.txt
35-
- name: Upload commit hashes
36-
uses: actions/upload-artifact@v4
37-
with:
38-
name: commit-hashes.txt
39-
path: commit-hashes.txt
40-
- name: Setup python
41-
uses: actions/setup-python@v5
42-
with:
43-
python-version: 3.12
44-
- name: Get last artifact URL from last run
45-
id: get_last_id
46-
run: |
47-
pip install requests
48-
VAL=$(python utils/get.py)
49-
echo "${VAL}"
50-
echo "${VAL}" >> $GITHUB_OUTPUT
51-
- name: Download artifact from last run if exists
52-
if: ${{ fromJSON(steps.get_last_id.outputs.INFO).exists }}
53-
continue-on-error: true
54-
uses: actions/download-artifact@v4
18+
dask-tests:
19+
# run the Dask and Distributed unit tests
20+
secrets: inherit
21+
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
5522
with:
56-
name: commit-hashes.txt
57-
path: previous-run
58-
github-token: ${{ secrets.GITHUB_TOKEN }}
59-
run-id: ${{ fromJSON(steps.get_last_id.outputs.INFO).id }}
60-
- name: Check if test run is needed
61-
id: check_run_needed
62-
run: |
63-
ls -l previous-run/
64-
if [ ! -f previous-run/commit-hashes.txt ]; then
65-
echo "No previous run hashes, need to re-run"
66-
echo 'INFO={"rerun": true}' >> $GITHUB_OUTPUT
67-
elif cmp -s commit-hashes.txt previous-run/commit-hashes.txt; then
68-
echo "Previous run hash same as this one, no need to re-run"
69-
echo 'INFO={"rerun": false}' >> $GITHUB_OUTPUT
70-
else
71-
echo "Previous run hash different, need to re-run"
72-
echo 'INFO={"rerun": true}' >> $GITHUB_OUTPUT
73-
fi
74-
- name: Run tests
75-
if: ${{ fromJSON(steps.check_run_needed.outputs.INFO).rerun }}
76-
run: |
77-
echo Running tests
78-
nvidia-smi
23+
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
24+
matrix_filter: map(select(.ARCH == "amd64")) | group_by(.CUDA_VER|split(".")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]))
25+
build_type: nightly
26+
branch: ${{ inputs.branch }}
27+
date: ${{ inputs.date }}
28+
sha: ${{ inputs.sha }}
29+
script: scripts/run.sh

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dask
2+
distributed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
# Dask Upstream Testing
2+
3+
This repository contains the scripts to run Dask's `gpu`-marked tests on a schedule.
4+
5+
## Version Policy
6+
7+
The primary goal here is to quickly identify breakages in tests defined in `dask/dask` and `dask/distributed`, so we'll use the latest `main` from each of those.
8+
9+
When breakages occur, they'll generally be fixed either in Dask or in the the nightly versions of the downstream packages (rapids, cupy, numba, etc.). And so we install the nightly (rather than `latest`) version of the downstream packages.

get.py

-33
This file was deleted.

scripts/run.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.
3+
4+
# Install
5+
set -euo pipefail
6+
7+
# RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
8+
RAPIDS_PY_CUDA_SUFFIX=12
9+
# TODO: set this to main once dask-cudf is compatible
10+
# DASK_VERSION=main
11+
DASK_VERSION=2024.12.1
12+
export PIP_YES=true
13+
export PIP_PRE=true
14+
15+
# Should this use nightly wheels or rapids-download-wheels-from-s3?
16+
17+
pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
18+
"cudf-cu12" \
19+
"dask-cudf-cu12"
20+
21+
echo "Installing dask@{DASK_VERSION}"
22+
23+
if [ ! -d "dask" ]; then
24+
git clone https://github.com/dask/dask
25+
fi
26+
27+
if [ ! -d "distributed" ]; then
28+
git clone https://github.com/dask/distributed
29+
fi
30+
31+
pip uninstall dask distributed
32+
cd dask && git clean -fdx && git checkout $DASK_VERSION && pip install -e .[test] && cd ..
33+
cd distributed && git clean -fdx && git checkout $DASK_VERSION && pip install -e . && cd ..
34+
35+
./scripts/test

scripts/test

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES.
3+
4+
pushd dask
5+
pytest dask -v -m gpu
6+
dask_status=$?
7+
popd
8+
9+
pushd distributed
10+
pytest distributed -v -m gpu
11+
distributed_status=$?
12+
popd
13+
14+
if [ $dask_status -ne 0 ] || [ $distributed_status -ne 0 ]; then
15+
echo "Tests faild"
16+
exit 1
17+
fi

0 commit comments

Comments
 (0)