Skip to content

Commit 3a839b0

Browse files
authored
ci: add selective wheel test plumbing (#2466)
* ci: add selective wheel test plumbing * ci: update selective wheel test callers * ci: enable nightly NumPy for metapackage tests * ci: install exact local wheels in metapackage tests * ci: simplify local wheel selection
1 parent e3ff57c commit 3a839b0

3 files changed

Lines changed: 122 additions & 69 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ jobs:
433433
host-platform: ${{ matrix.host-platform }}
434434
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
435435
nruns: ${{ (github.event_name == 'schedule' && 5) || 1}}
436-
skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }}
436+
test-bindings: ${{ fromJSON(needs.detect-changes.outputs.test_bindings) }}
437437

438438
# See test-linux-64 for why test jobs are split by platform.
439439
test-linux-aarch64:
@@ -458,7 +458,7 @@ jobs:
458458
host-platform: ${{ matrix.host-platform }}
459459
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
460460
nruns: ${{ (github.event_name == 'schedule' && 5) || 1}}
461-
skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }}
461+
test-bindings: ${{ fromJSON(needs.detect-changes.outputs.test_bindings) }}
462462

463463
# See test-linux-64 for why test jobs are split by platform.
464464
test-windows:
@@ -483,7 +483,7 @@ jobs:
483483
host-platform: ${{ matrix.host-platform }}
484484
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
485485
nruns: ${{ (github.event_name == 'schedule' && 5) || 1}}
486-
skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }}
486+
test-bindings: ${{ fromJSON(needs.detect-changes.outputs.test_bindings) }}
487487

488488
doc:
489489
name: Docs

.github/workflows/test-wheel-linux.yml

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ on:
2222
nruns:
2323
type: number
2424
default: 1
25-
# When true, cuda.bindings tests (and the Cython tests that depend on
26-
# them) are skipped even when CTK majors match. Callers set this based
27-
# on the output of the detect-changes job in ci.yml so PRs that only
28-
# touch unrelated modules avoid the expensive bindings test suite.
29-
skip-bindings-test:
25+
test-pathfinder:
3026
type: boolean
31-
default: false
27+
default: true
28+
test-bindings:
29+
type: boolean
30+
default: true
31+
test-core:
32+
type: boolean
33+
default: true
34+
test-python:
35+
type: boolean
36+
default: true
3237
run-id:
3338
description: >
3439
Workflow run ID to download artifacts from.
@@ -159,7 +164,7 @@ jobs:
159164
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
160165
PY_VER: ${{ matrix.PY_VER }}
161166
SHA: ${{ inputs.sha || github.sha }}
162-
SKIP_BINDINGS_TEST_OVERRIDE: ${{ inputs.skip-bindings-test && '1' || '0' }}
167+
SKIP_BINDINGS_TEST_OVERRIDE: ${{ !inputs.test-bindings && '1' || '0' }}
163168
run: ./ci/tools/env-vars test
164169

165170
- name: Apply extra matrix environment variables
@@ -169,6 +174,7 @@ jobs:
169174
run: echo "$MATRIX_ENV" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV"
170175

171176
- name: Download cuda-pathfinder build artifacts
177+
if: ${{ inputs.test-pathfinder || inputs.test-bindings || inputs.test-core || inputs.test-python }}
172178
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
173179
with:
174180
name: cuda-pathfinder-wheel
@@ -177,7 +183,7 @@ jobs:
177183
github-token: ${{ secrets.GITHUB_TOKEN }}
178184

179185
- name: Download cuda-python build artifacts
180-
if: ${{ env.BINDINGS_SOURCE == 'main' }}
186+
if: ${{ inputs.test-python && env.BINDINGS_SOURCE == 'main' }}
181187
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
182188
with:
183189
name: cuda-python-wheel
@@ -186,7 +192,8 @@ jobs:
186192
github-token: ${{ secrets.GITHUB_TOKEN }}
187193

188194
- name: Download cuda.bindings build artifacts
189-
if: ${{ env.BINDINGS_SOURCE == 'main' }}
195+
if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) &&
196+
env.BINDINGS_SOURCE == 'main' }}
190197
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
191198
with:
192199
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
@@ -195,7 +202,8 @@ jobs:
195202
github-token: ${{ secrets.GITHUB_TOKEN }}
196203

197204
- name: Download cuda-python & cuda.bindings build artifacts from the prior branch
198-
if: ${{ env.BINDINGS_SOURCE == 'backport' }}
205+
if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) &&
206+
env.BINDINGS_SOURCE == 'backport' }}
199207
env:
200208
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
201209
run: |
@@ -220,25 +228,28 @@ jobs:
220228
mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/
221229
rmdir $OLD_BASENAME
222230
223-
gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python
224-
ls -al cuda-python-wheel
225-
mv cuda-python-wheel/*.whl .
226-
rmdir cuda-python-wheel
231+
if ${{ inputs.test-python }}; then
232+
gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python
233+
ls -al cuda-python-wheel
234+
mv cuda-python-wheel/*.whl .
235+
rmdir cuda-python-wheel
236+
fi
227237
228238
- name: Display structure of downloaded cuda-python artifacts
229-
if: ${{ env.BINDINGS_SOURCE != 'published' }}
239+
if: ${{ inputs.test-python && env.BINDINGS_SOURCE != 'published' }}
230240
run: |
231241
pwd
232242
ls -lah cuda_python*.whl cuda_pathfinder/
233243
234244
- name: Display structure of downloaded cuda.bindings artifacts
235-
if: ${{ env.BINDINGS_SOURCE != 'published' }}
245+
if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) &&
246+
env.BINDINGS_SOURCE != 'published' }}
236247
run: |
237248
pwd
238249
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
239250
240251
- name: Download cuda.bindings Cython tests
241-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
252+
if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }}
242253
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
243254
with:
244255
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests
@@ -247,12 +258,13 @@ jobs:
247258
github-token: ${{ secrets.GITHUB_TOKEN }}
248259

249260
- name: Display structure of downloaded cuda.bindings Cython tests
250-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
261+
if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }}
251262
run: |
252263
pwd
253264
ls -lahR $CUDA_BINDINGS_CYTHON_TESTS_DIR
254265
255266
- name: Download cuda.core build artifacts
267+
if: ${{ inputs.test-core }}
256268
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
257269
with:
258270
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
@@ -261,12 +273,13 @@ jobs:
261273
github-token: ${{ secrets.GITHUB_TOKEN }}
262274

263275
- name: Display structure of downloaded cuda.core build artifacts
276+
if: ${{ inputs.test-core }}
264277
run: |
265278
pwd
266279
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
267280
268281
- name: Download cuda.core Cython tests
269-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
282+
if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }}
270283
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
271284
with:
272285
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
@@ -275,12 +288,13 @@ jobs:
275288
github-token: ${{ secrets.GITHUB_TOKEN }}
276289

277290
- name: Display structure of downloaded cuda.core Cython tests
278-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
291+
if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }}
279292
run: |
280293
pwd
281294
ls -lahR $CUDA_CORE_CYTHON_TESTS_DIR
282295
283296
- name: Download cuda.core test binaries
297+
if: ${{ inputs.test-core }}
284298
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
285299
with:
286300
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries
@@ -289,6 +303,7 @@ jobs:
289303
github-token: ${{ secrets.GITHUB_TOKEN }}
290304

291305
- name: Display structure of downloaded cuda.core test binaries
306+
if: ${{ inputs.test-core }}
292307
run: |
293308
pwd
294309
ls -lahR $CUDA_CORE_TEST_BINARIES_DIR
@@ -304,7 +319,8 @@ jobs:
304319
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
305320

306321
- name: Enable Scientific Python Nightly Wheels for Python 3.15
307-
if: ${{ startsWith(matrix.PY_VER, '3.15') }}
322+
if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) &&
323+
startsWith(matrix.PY_VER, '3.15') }}
308324
run: |
309325
echo "PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" >> "$GITHUB_ENV"
310326
echo "PIP_ONLY_BINARY=numpy" >> "$GITHUB_ENV"
@@ -318,7 +334,7 @@ jobs:
318334
cuda-version: ${{ matrix.CUDA_VER }}
319335

320336
- name: Set up latest cuda_sanitizer_api
321-
if: ${{ env.SETUP_SANITIZER == '1' }}
337+
if: ${{ (inputs.test-bindings || inputs.test-core) && env.SETUP_SANITIZER == '1' }}
322338
uses: ./.github/actions/fetch_ctk
323339
continue-on-error: false
324340
with:
@@ -327,55 +343,66 @@ jobs:
327343
cuda-components: "cuda_sanitizer_api"
328344

329345
- name: Set up compute-sanitizer
346+
if: ${{ inputs.test-bindings || inputs.test-core }}
330347
run: setup-sanitizer
331348

332349
- name: Set up test repetition on nightly runs
333350
run: echo "PYTEST_ADDOPTS=\"--count=${{ inputs.nruns }}\"" >> "$GITHUB_ENV"
334351

335352
# ── Standard test steps (skipped for nightly modes) ──
336353
- name: Run cuda.pathfinder tests with see_what_works
337-
if: ${{ inputs.test-mode == 'standard' }}
354+
if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }}
338355
env:
339356
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works
340357
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works
341358
CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: see_what_works
342359
run: run-tests pathfinder
343360

344361
- name: Run cuda.bindings tests
345-
if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
362+
if: ${{ inputs.test-mode == 'standard' && inputs.test-bindings && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
346363
env:
347364
CUDA_VER: ${{ matrix.CUDA_VER }}
348365
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
349366
run: run-tests bindings
350367

351368
- name: Run cuda.bindings benchmarks (smoke test)
352-
if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
369+
if: ${{ inputs.test-mode == 'standard' && inputs.test-bindings && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
353370
run: |
354371
pip install pyperf
355372
pushd benchmarks/cuda_bindings
356373
python run_pyperf.py --debug-single-value
357374
popd
358375
359376
- name: Run cuda.core tests
360-
if: ${{ inputs.test-mode == 'standard' }}
377+
if: ${{ inputs.test-mode == 'standard' && inputs.test-core }}
361378
env:
362379
CUDA_VER: ${{ matrix.CUDA_VER }}
363380
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
364381
run: run-tests core
365382

366383
- name: Ensure cuda-python installable
367-
if: ${{ inputs.test-mode == 'standard' && env.BINDINGS_SOURCE == 'main' }}
384+
if: ${{ inputs.test-mode == 'standard' && inputs.test-python && env.BINDINGS_SOURCE == 'main' }}
368385
run: |
369-
# Subpackages are already installed from CI artifacts; --no-deps keeps
370-
# tag-release cuda-core wheels from being replaced by PyPI pins.
371-
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
372-
pip install --only-binary=:all: --no-deps cuda_python*.whl
386+
# Package suites install their own dependencies. A metapackage-only
387+
# run has no preceding suite, so install the exact local internal
388+
# wheels in one transaction while resolving released dependencies
389+
# such as cuda-core from the package index.
390+
if ${{ inputs.test-bindings || inputs.test-core }}; then
391+
dependency_args=(--no-deps)
373392
else
374-
pip install --only-binary=:all: --no-deps $(ls cuda_python*.whl)[all]
393+
dependency_args=(
394+
./cuda_pathfinder/cuda_pathfinder-*.whl
395+
"${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-*.whl
396+
)
397+
fi
398+
python_requirements=(cuda_python*.whl)
399+
if [[ "${{ matrix.LOCAL_CTK }}" != 1 ]]; then
400+
python_requirements=("${python_requirements[@]/%/[all]}")
375401
fi
402+
pip install --only-binary=:all: "${dependency_args[@]}" "${python_requirements[@]}"
376403
377404
- name: Install cuda.pathfinder extra wheels for testing
378-
if: ${{ inputs.test-mode == 'standard' }}
405+
if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }}
379406
run: |
380407
set -euo pipefail
381408
pushd cuda_pathfinder
@@ -384,7 +411,7 @@ jobs:
384411
popd
385412
386413
- name: Run cuda.pathfinder tests with all_must_work
387-
if: ${{ inputs.test-mode == 'standard' }}
414+
if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }}
388415
env:
389416
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
390417
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work

0 commit comments

Comments
 (0)