@@ -3,32 +3,81 @@ name: "CI: Test wheels"
3
3
on:
4
4
workflow_call:
5
5
inputs:
6
- host-platform :
6
+ build-type :
7
7
type: string
8
8
required: true
9
- python-version :
9
+ host-platform :
10
10
type: string
11
11
required: true
12
12
build-ctk-ver:
13
13
type: string
14
14
required: true
15
- cuda-version:
16
- type: string
17
- required: true
18
15
local-ctk:
19
16
type: string
20
17
required: true
21
- runner:
22
- type: string
23
- required: true
24
18
25
19
jobs:
20
+ compute-matrix:
21
+ runs-on: ubuntu-latest
22
+ env:
23
+ BUILD_TYPE: ${{ inputs.build-type }}
24
+ ARCH: ${{ (inputs.host-platform == 'linux-64' && 'amd64') ||
25
+ (inputs.host-platform == 'linux-aarch64' && 'arm64') }}
26
+ outputs:
27
+ MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }}
28
+ steps:
29
+ - name: Validate Test Type
30
+ run: |
31
+ if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]] && [[ "$BUILD_TYPE" != "branch" ]]; then
32
+ echo "Invalid build type! Must be one of 'nightly', 'pull-request', or 'branch'."
33
+ exit 1
34
+ fi
35
+ - name: Compute Python Test Matrix
36
+ id: compute-matrix
37
+ run: |
38
+ set -eo pipefail
39
+ # Please keep the matrices sorted in ascending order by the following:
40
+ #
41
+ # [PY_VER, CUDA_VER, LINUX_VER, GPU, DRIVER]
42
+ #
43
+ gpu="l4"
44
+ if [[ "${ARCH}" == "arm64" ]]; then
45
+ gpu="a100"
46
+ fi
47
+ export MATRICES="
48
+ pull-request:
49
+ - { ARCH=${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: ${gpu}, DRIVER: 'earliest' }
50
+ - { ARCH=${ARCH}, PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu24.04', GPU: ${gpu}, DRIVER: 'latest' }
51
+ - { ARCH=${ARCH}, PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu22.04', GPU: ${gpu}, DRIVER: 'latest' }
52
+ nightly:
53
+ - { ARCH=${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: ${gpu}, DRIVER: 'earliest' }
54
+ - { ARCH=${ARCH}, PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu22.04', GPU: ${gpu}, DRIVER: 'latest' }
55
+ "
56
+
57
+ # Use the nightly matrix for branch tests
58
+ MATRIX_TYPE="${BUILD_TYPE}"
59
+ if [[ "${MATRIX_TYPE}" == "branch" ]]; then
60
+ MATRIX_TYPE="nightly"
61
+ fi
62
+ export MATRIX_TYPE
63
+ TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(MATRIX_TYPE)]')
64
+ export TEST_MATRIX
65
+
66
+ MATRIX="$(
67
+ yq -n -o json 'env(TEST_MATRIX)' | \
68
+ jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end'
69
+ )"
70
+
71
+ echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}"
72
+
26
73
test:
74
+ needs: compute-matrix
75
+ strategy:
76
+ fail-fast: false
77
+ matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
78
+ runs-on: "linux-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-1"
27
79
# The build stage could fail but we want the CI to keep moving.
28
80
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
29
- runs-on: ${{ (inputs.runner == 'default' && inputs.host-platform == 'linux-64' && 'linux-amd64-gpu-v100-latest-1') ||
30
- (inputs.runner == 'default' && inputs.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') ||
31
- (inputs.runner == 'H100' && 'linux-amd64-gpu-h100-latest-1') }}
32
81
# Our self-hosted runners require a container
33
82
# TODO: use a different (nvidia?) container
34
83
container:
50
99
51
100
- name: Set environment variables
52
101
run: |
53
- PYTHON_VERSION_FORMATTED=$(echo '${{ inputs.python-version }}' | tr -d '.')
102
+ PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.PY_VER }}' | tr -d '.')
54
103
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
55
104
REPO_DIR=$(pwd)
56
105
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
@@ -59,14 +108,14 @@ jobs:
59
108
fi
60
109
61
110
BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.build-ctk-ver }})"
62
- TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
111
+ TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.CUDA_VER }})"
63
112
if [[ $BUILD_CUDA_MAJOR != $TEST_CUDA_MAJOR ]]; then
64
113
SKIP_CUDA_BINDINGS_TEST=1
65
114
SKIP_CUDA_CORE_CYTHON_TEST=0
66
115
else
67
116
SKIP_CUDA_BINDINGS_TEST=0
68
117
BUILD_CUDA_MINOR="$(cut -d '.' -f 2 <<< ${{ inputs.build-ctk-ver }})"
69
- TEST_CUDA_MINOR="$(cut -d '.' -f 2 <<< ${{ inputs.cuda-version }})"
118
+ TEST_CUDA_MINOR="$(cut -d '.' -f 2 <<< ${{ matrix.CUDA_VER }})"
70
119
if [[ $BUILD_CUDA_MINOR != $TEST_CUDA_MINOR ]]; then
71
120
SKIP_CUDA_CORE_CYTHON_TEST=1
72
121
else
@@ -164,10 +213,10 @@ jobs:
164
213
pwd
165
214
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
166
215
167
- - name: Set up Python ${{ inputs.python-version }}
216
+ - name: Set up Python ${{ matrix.PY_VER }}
168
217
uses: actions/setup-python@v5
169
218
with:
170
- python-version: ${{ inputs.python-version }}
219
+ python-version: ${{ matrix.PY_VER }}
171
220
env:
172
221
# we use self-hosted runners on which setup-python behaves weirdly...
173
222
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
@@ -178,7 +227,7 @@ jobs:
178
227
continue-on-error: false
179
228
with:
180
229
host-platform: ${{ inputs.host-platform }}
181
- cuda-version: ${{ inputs.cuda-version }}
230
+ cuda-version: ${{ matrix.CUDA_VER }}
182
231
183
232
- name: Run cuda.bindings tests
184
233
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
@@ -222,7 +271,7 @@ jobs:
222
271
fi
223
272
popd
224
273
fi
225
- TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
274
+ TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.CUDA_VER }})"
226
275
pushd "${CUDA_CORE_ARTIFACTS_DIR}"
227
276
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}"]
228
277
popd
0 commit comments