Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ jobs:
host-platform: ${{ matrix.host-platform }}
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
nruns: ${{ (github.event_name == 'schedule' && 5) || 1}}
skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }}
test-bindings: ${{ fromJSON(needs.detect-changes.outputs.test_bindings) }}

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

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

doc:
name: Docs
Expand Down
95 changes: 61 additions & 34 deletions .github/workflows/test-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ on:
nruns:
type: number
default: 1
# When true, cuda.bindings tests (and the Cython tests that depend on
# them) are skipped even when CTK majors match. Callers set this based
# on the output of the detect-changes job in ci.yml so PRs that only
# touch unrelated modules avoid the expensive bindings test suite.
skip-bindings-test:
test-pathfinder:
type: boolean
default: false
default: true
test-bindings:
type: boolean
default: true
test-core:
type: boolean
default: true
test-python:
type: boolean
default: true
run-id:
description: >
Workflow run ID to download artifacts from.
Expand Down Expand Up @@ -159,7 +164,7 @@ jobs:
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
PY_VER: ${{ matrix.PY_VER }}
SHA: ${{ inputs.sha || github.sha }}
SKIP_BINDINGS_TEST_OVERRIDE: ${{ inputs.skip-bindings-test && '1' || '0' }}
SKIP_BINDINGS_TEST_OVERRIDE: ${{ !inputs.test-bindings && '1' || '0' }}
run: ./ci/tools/env-vars test

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

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

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

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

- name: Download cuda-python & cuda.bindings build artifacts from the prior branch
if: ${{ env.BINDINGS_SOURCE == 'backport' }}
if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) &&
env.BINDINGS_SOURCE == 'backport' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -220,25 +228,28 @@ jobs:
mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/
rmdir $OLD_BASENAME

gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python
ls -al cuda-python-wheel
mv cuda-python-wheel/*.whl .
rmdir cuda-python-wheel
if ${{ inputs.test-python }}; then
gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python
ls -al cuda-python-wheel
mv cuda-python-wheel/*.whl .
rmdir cuda-python-wheel
fi

- name: Display structure of downloaded cuda-python artifacts
if: ${{ env.BINDINGS_SOURCE != 'published' }}
if: ${{ inputs.test-python && env.BINDINGS_SOURCE != 'published' }}
run: |
pwd
ls -lah cuda_python*.whl cuda_pathfinder/

- name: Display structure of downloaded cuda.bindings artifacts
if: ${{ env.BINDINGS_SOURCE != 'published' }}
if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) &&
env.BINDINGS_SOURCE != 'published' }}
run: |
pwd
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR

- name: Download cuda.bindings Cython tests
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests
Expand All @@ -247,12 +258,13 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Display structure of downloaded cuda.bindings Cython tests
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }}
run: |
pwd
ls -lahR $CUDA_BINDINGS_CYTHON_TESTS_DIR

- name: Download cuda.core build artifacts
if: ${{ inputs.test-core }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
Expand All @@ -261,12 +273,13 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Display structure of downloaded cuda.core build artifacts
if: ${{ inputs.test-core }}
run: |
pwd
ls -lahR $CUDA_CORE_ARTIFACTS_DIR

- name: Download cuda.core Cython tests
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
Expand All @@ -275,12 +288,13 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Display structure of downloaded cuda.core Cython tests
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }}
run: |
pwd
ls -lahR $CUDA_CORE_CYTHON_TESTS_DIR

- name: Download cuda.core test binaries
if: ${{ inputs.test-core }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries
Expand All @@ -289,6 +303,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

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

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

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

- name: Set up compute-sanitizer
if: ${{ inputs.test-bindings || inputs.test-core }}
run: setup-sanitizer

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

# ── Standard test steps (skipped for nightly modes) ──
- name: Run cuda.pathfinder tests with see_what_works
if: ${{ inputs.test-mode == 'standard' }}
if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }}
env:
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works
CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: see_what_works
run: run-tests pathfinder

- name: Run cuda.bindings tests
if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
if: ${{ inputs.test-mode == 'standard' && inputs.test-bindings && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
env:
CUDA_VER: ${{ matrix.CUDA_VER }}
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
run: run-tests bindings

- name: Run cuda.bindings benchmarks (smoke test)
if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
if: ${{ inputs.test-mode == 'standard' && inputs.test-bindings && env.SKIP_CUDA_BINDINGS_TEST == '0' }}
run: |
pip install pyperf
pushd benchmarks/cuda_bindings
python run_pyperf.py --debug-single-value
popd

- name: Run cuda.core tests
if: ${{ inputs.test-mode == 'standard' }}
if: ${{ inputs.test-mode == 'standard' && inputs.test-core }}
env:
CUDA_VER: ${{ matrix.CUDA_VER }}
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
run: run-tests core

- name: Ensure cuda-python installable
if: ${{ inputs.test-mode == 'standard' && env.BINDINGS_SOURCE == 'main' }}
if: ${{ inputs.test-mode == 'standard' && inputs.test-python && env.BINDINGS_SOURCE == 'main' }}
run: |
# Subpackages are already installed from CI artifacts; --no-deps keeps
# tag-release cuda-core wheels from being replaced by PyPI pins.
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
pip install --only-binary=:all: --no-deps cuda_python*.whl
# Package suites install their own dependencies. A metapackage-only
# run has no preceding suite, so install the exact local internal
# wheels in one transaction while resolving released dependencies
# such as cuda-core from the package index.
if ${{ inputs.test-bindings || inputs.test-core }}; then
dependency_args=(--no-deps)
else
pip install --only-binary=:all: --no-deps $(ls cuda_python*.whl)[all]
dependency_args=(
./cuda_pathfinder/cuda_pathfinder-*.whl
"${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-*.whl
)
fi
python_requirements=(cuda_python*.whl)
if [[ "${{ matrix.LOCAL_CTK }}" != 1 ]]; then
python_requirements=("${python_requirements[@]/%/[all]}")
fi
pip install --only-binary=:all: "${dependency_args[@]}" "${python_requirements[@]}"

- name: Install cuda.pathfinder extra wheels for testing
if: ${{ inputs.test-mode == 'standard' }}
if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }}
run: |
set -euo pipefail
pushd cuda_pathfinder
Expand All @@ -384,7 +411,7 @@ jobs:
popd

- name: Run cuda.pathfinder tests with all_must_work
if: ${{ inputs.test-mode == 'standard' }}
if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }}
env:
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work
Expand Down
Loading
Loading