Skip to content

Commit

Permalink
test cuda.core optional dep logic; install cupy in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Dec 17, 2024
1 parent 8ee415d commit d120158
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/gh-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ jobs:
# Note: this is for test-time only.
- "12.6.2"
- "12.0.1"
# FIXME: cannot run cuda.bindings 12.x with CTK 11.x
- "11.8.0"
runner:
- default
Expand Down Expand Up @@ -232,7 +231,7 @@ jobs:
BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ needs.build.outputs.BUILD_CTK_VER }})"
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.cuda-version }})"
if [[ $BUILD_CUDA_MAJOR -gt $TEST_CUDA_MAJOR ]]; then
if [[ $BUILD_CUDA_MAJOR != $TEST_CUDA_MAJOR ]]; then
SKIP_CUDA_BINDINGS_TEST=1
else
SKIP_CUDA_BINDINGS_TEST=0
Expand Down Expand Up @@ -306,18 +305,20 @@ jobs:
if [[ ${{ matrix.python-version }} == "3.13" ]]; then
echo "Python 3.13 + cuda-python ${{ matrix.cuda-version }} is not supported, skipping the test..."
exit 0
else
pip install "cuda-python==$(cut -d '.' -f 1,2 <<< ${{ matrix.cuda-version }}).*"
fi
fi
# If build/test majors match: cuda.bindings is installed in the previous step.
# If mismatch: cuda.bindings is installed from PyPI.
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.cuda-version }})"
pushd "${CUDA_CORE_ARTIFACTS_DIR}"
pip install *.whl
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}"]
popd
pushd ./cuda_core
# TODO: add requirements.txt for test deps?
# TODO: add cupy as an optional test dep?
pip install pytest
# TODO: add CuPy to test deps (which would require cuRAND)
# pip install "cupy-cuda${TEST_CUDA_MAJOR}x"
pytest -rxXs tests/
popd

0 comments on commit d120158

Please sign in to comment.