Skip to content

Commit 7f36568

Browse files
committed
add test jobs against CUDA wheels
1 parent 5015410 commit 7f36568

File tree

5 files changed

+45
-23
lines changed

5 files changed

+45
-23
lines changed

.github/workflows/build-and-test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,17 @@ jobs:
198198
- "12.6.2"
199199
- "12.0.1"
200200
- "11.8.0"
201+
local-ctk:
202+
- 1 # use mini CTK
203+
- 0 # use CTK wheels
201204
runner:
202205
- default
203206
include:
204207
- host-platform: linux-64
205208
python-version: "3.12"
206209
cuda-version: "12.6.2"
207210
runner: H100
208-
name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }})
211+
name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }})
209212
# The build stage could fail but we want the CI to keep moving.
210213
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
211214
permissions:
@@ -214,12 +217,13 @@ jobs:
214217
- build
215218
secrets: inherit
216219
uses:
217-
./.github/workflows/test_local_ctk.yml
220+
./.github/workflows/test-wheel.yml
218221
with:
219222
host-platform: ${{ matrix.host-platform }}
220223
python-version: ${{ matrix.python-version }}
221-
build_ctk_ver: ${{ needs.build.outputs.BUILD_CTK_VER }}
224+
build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }}
222225
cuda-version: ${{ matrix.cuda-version }}
226+
local-ctk: ${{ matrix.local-ctk}}
223227
runner: ${{ matrix.runner }}
224228

225229
doc:
@@ -236,4 +240,4 @@ jobs:
236240
uses:
237241
./.github/workflows/build-docs.yml
238242
with:
239-
build_ctk_ver: ${{ needs.build.outputs.BUILD_CTK_VER }}
243+
build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }}

.github/workflows/build-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "CI: Build and update docs"
33
on:
44
workflow_call:
55
inputs:
6-
build_ctk_ver:
6+
build-ctk-ver:
77
type: string
88
required: true
99

@@ -53,7 +53,7 @@ jobs:
5353
continue-on-error: false
5454
with:
5555
host-platform: linux-64
56-
cuda-version: ${{ inputs.build_ctk_ver }}
56+
cuda-version: ${{ inputs.build-ctk-ver }}
5757

5858
- name: Set environment variables
5959
run: |
@@ -65,7 +65,7 @@ jobs:
6565
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
6666
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
6767
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
68-
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build_ctk_ver }}-linux-64"
68+
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build-ctk-ver }}-linux-64"
6969
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
7070
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
7171
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV

.github/workflows/test_local_ctk.yml renamed to .github/workflows/test-wheel.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CI: Test against local CTK"
1+
name: "CI: Test wheels"
22

33
on:
44
workflow_call:
@@ -9,12 +9,15 @@ on:
99
python-version:
1010
type: string
1111
required: true
12-
build_ctk_ver:
12+
build-ctk-ver:
1313
type: string
1414
required: true
1515
cuda-version:
1616
type: string
1717
required: true
18+
local-ctk:
19+
type: string
20+
required: true
1821
runner:
1922
type: string
2023
required: true
@@ -55,7 +58,7 @@ jobs:
5558
REPO_DIR=$(cygpath -w $PWD)
5659
fi
5760
58-
BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.build_ctk_ver }})"
61+
BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.build-ctk-ver }})"
5962
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
6063
if [[ $BUILD_CUDA_MAJOR != $TEST_CUDA_MAJOR ]]; then
6164
SKIP_CUDA_BINDINGS_TEST=1
@@ -69,7 +72,7 @@ jobs:
6972
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
7073
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
7174
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
72-
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build_ctk_ver }}-${{ inputs.host-platform }}"
75+
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build-ctk-ver }}-${{ inputs.host-platform }}"
7376
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
7477
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
7578
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
@@ -138,6 +141,7 @@ jobs:
138141
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
139142

140143
- name: Set up mini CTK
144+
if: ${{ inputs.local-ctk == '1' }}
141145
uses: ./.github/actions/fetch_ctk
142146
continue-on-error: false
143147
with:
@@ -147,31 +151,43 @@ jobs:
147151
- name: Run cuda.bindings tests
148152
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
149153
run: |
150-
ls $CUDA_PATH
151-
152154
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
153-
pip install *.whl
155+
if [[ "${{ inputs.local-ctk }}" == 1 ]]; then
156+
ls $CUDA_PATH
157+
pip install *.whl
158+
else
159+
pip install $(ls *.whl)[all]
160+
fi
154161
popd
155162
156163
pushd ./cuda_bindings
157164
pip install -r requirements.txt
158165
pytest -rxXs tests/
159-
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
160-
bash tests/cython/build_tests.sh
161-
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
162-
# TODO: enable this once win-64 runners are up
163-
exit 1
164-
fi
165-
pytest -rxXs tests/cython
166-
popd
166+
167+
# It is a bit convoluted to run the Cython tests against CTK wheels,
168+
# so let's just skip them.
169+
if [[ "${{ inputs.local-ctk }}" == 1 ]]; then
170+
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
171+
bash tests/cython/build_tests.sh
172+
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
173+
# TODO: enable this once win-64 runners are up
174+
exit 1
175+
fi
176+
pytest -rxXs tests/cython
177+
popd
178+
fi
167179
168180
- name: Run cuda.core tests
169181
run: |
170182
# If build/test majors match: cuda.bindings is installed in the previous step.
171183
# If mismatch: cuda.bindings is installed from the backport branch.
172184
if [[ "${SKIP_CUDA_BINDINGS_TEST}" == 1 ]]; then
173185
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
174-
pip install *.whl
186+
if [[ "${{ inputs.local-ctk }}" == 1 ]]; then
187+
pip install *.whl
188+
else
189+
pip install $(ls *.whl)[all]
190+
fi
175191
popd
176192
fi
177193
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"

cuda_core/tests/requirements-cu11.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
22
# TODO: remove this hack once cupy has a cp313 build
33
cupy-cuda11x; python_version < "3.13"
4+
nvidia-cuda-runtime-cu11 # headers consumed by CuPy

cuda_core/tests/requirements-cu12.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
22
# TODO: remove this hack once cupy has a cp313 build
33
cupy-cuda12x; python_version < "3.13"
4+
nvidia-cuda-runtime-cu12 # headers consumed by CuPy

0 commit comments

Comments
 (0)