Skip to content
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

Initial setup for dask-upstream-testing #1

Merged
merged 8 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 25 additions & 74 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
@@ -1,78 +1,29 @@
# Based off https://github.com/rapidsai/cudf/blob/branch-25.02/.github/workflows/pandas-tests.yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need another job to actually trigger this, e.g. https://github.com/rapidsai/cudf/blob/cb77046d8baad31f4856c097f7052b3a3858c363/.github/workflows/build.yaml#L180. I wonder if the workflow-dispatch stuff is needed, or if we can just use a cron job?

Copy link

@bdice bdice Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@TomAugspurger TomAugspurger Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. I gave up searching after I didn't see it in either rapidsai/cudf or rapidsai/shared-workflows :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, rapidsai/workflows#69 should be necessary and sufficient to get this workflow running on a schedule.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on a suggestion from @wence-, I've moved the cron definition here to avoid the need for this cross-repo dispatch.

I'm not sure if we can test this before merging, but I've hopefully gotten the GitHub Action set up so that we have all the inputs necessary for the rapidsai/shared-workflows/.github/workflows/[email protected] workflow to run. Does anyone know offhand if things like ${{ inputs.date }} will be available? My guess is that those came from the workflow dispatch, so I've added a job to collect that and the branch name.

name: Test dask-upstream

on:
# TODO: change to cron-based schedule one this is working
push:
branches:
- main
workflow_dispatch:
inputs:
branch:
required: true
type: string
date:
required: true
type: string
sha:
required: true
type: string

jobs:
test:
name: "Test dask and distributed"
# TODO: change to appropriate image
runs-on: "linux-amd64-gpu-v100-latest-1"
container:
image: rapidsai/distributed:24.12-cuda11.8.0-devel-ubuntu20.04-py3.12
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
steps:
- name: Checkout ourselves
uses: actions/checkout@v4
with:
path: utils
- name: Checkout dask
uses: actions/checkout@v4
with:
repository: dask/dask
path: dask
- name: Checkout distributed
uses: actions/checkout@v4
with:
repository: dask/distributed
path: distributed
- name: Run
run: |
(cd dask; git rev-parse HEAD;
cd ../distributed; git rev-parse HEAD) | tee commit-hashes.txt
- name: Upload commit hashes
TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/upload-artifact@v4
with:
name: commit-hashes.txt
path: commit-hashes.txt
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Get last artifact URL from last run
id: get_last_id
run: |
pip install requests
VAL=$(python utils/get.py)
echo "${VAL}"
echo "${VAL}" >> $GITHUB_OUTPUT
- name: Download artifact from last run if exists
if: ${{ fromJSON(steps.get_last_id.outputs.INFO).exists }}
continue-on-error: true
uses: actions/download-artifact@v4
dask-tests:
# run the Dask and Distributed unit tests
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
name: commit-hashes.txt
path: previous-run
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ fromJSON(steps.get_last_id.outputs.INFO).id }}
- name: Check if test run is needed
id: check_run_needed
run: |
ls -l previous-run/
if [ ! -f previous-run/commit-hashes.txt ]; then
echo "No previous run hashes, need to re-run"
echo 'INFO={"rerun": true}' >> $GITHUB_OUTPUT
elif cmp -s commit-hashes.txt previous-run/commit-hashes.txt; then
echo "Previous run hash same as this one, no need to re-run"
echo 'INFO={"rerun": false}' >> $GITHUB_OUTPUT
else
echo "Previous run hash different, need to re-run"
echo 'INFO={"rerun": true}' >> $GITHUB_OUTPUT
fi
- name: Run tests
if: ${{ fromJSON(steps.check_run_needed.outputs.INFO).rerun }}
run: |
echo Running tests
nvidia-smi
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
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))]))
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: scripts/run.sh
TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dask
distributed
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Dask Upstream Testing

This repository contains the scripts to run Dask's `gpu`-marked tests on a schedule.

## Version Policy

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.

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.
33 changes: 0 additions & 33 deletions get.py

This file was deleted.

38 changes: 38 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.

# Install
set -euo pipefail

# RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved
RAPIDS_PY_CUDA_SUFFIX=12
# TODO: set this to main once dask-cudf is compatible
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rapidsai/dask-cuda#1424 is the PR to track here. For now, using 2024.12.1 is slightly preferable, otherwise all the tests fail on import.

# DASK_VERSION=main
DASK_VERSION=2024.12.1
export PIP_YES=true
export PIP_PRE=true

# Should this use nightly wheels or rapids-download-wheels-from-s3?
TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved

pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
"cudf-cu12" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figure out what all we want / need to install here. Probably depends on what pytest.importorskips we have in dask/dask and dask/distributed. We don't want any gpu-marked tests skipped for missing deps.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will take a look. Right now I'm thinking that the best place for this to live would be in dask & distributed's pyproject.toml so that we can just install dask[test,gpu] distributed[test,gpu] and have everything we need.

TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved
"dask-cudf-cu12" \
"scipy" \
"ucx" \
"dask-cuda"

echo "Installing dask@{DASK_VERSION}"

if [ ! -d "dask" ]; then
git clone https://github.com/dask/dask
fi

if [ ! -d "distributed" ]; then
git clone https://github.com/dask/distributed
fi

pip uninstall dask distributed
cd dask && git clean -fdx && git checkout $DASK_VERSION && pip install -e .[test] && cd ..
cd distributed && git clean -fdx && git checkout $DASK_VERSION && pip install -e . && cd ..

./scripts/test
17 changes: 17 additions & 0 deletions scripts/test
TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES.

pushd dask
pytest dask -v -m gpu
dask_status=$?
popd

pushd distributed
pytest distributed -v -m gpu --runslow
distributed_status=$?
popd

if [ $dask_status -ne 0 ] || [ $distributed_status -ne 0 ]; then
echo "Tests faild"
exit 1
fi