Skip to content

Commit bcffdb5

Browse files
committed
Add in some testing matrix updates (simple version)
1 parent 3fff795 commit bcffdb5

File tree

2 files changed

+90
-18
lines changed

2 files changed

+90
-18
lines changed

.github/workflows/ci.yml

+23
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,26 @@ jobs:
3030
with:
3131
host-platform: ${{ matrix.host-platform }}
3232
cuda-version: "12.8.0"
33+
34+
test-linux:
35+
strategy:
36+
fail-fast: false
37+
# TODO: add driver version here
38+
matrix:
39+
host-platform:
40+
- linux-64
41+
- linux-aarch64
42+
name: Test ${{ matrix.host-platform }}
43+
if: ${{ github.repository_owner == 'nvidia' }}
44+
permissions:
45+
contents: read # This is required for actions/checkout
46+
needs:
47+
- build
48+
secrets: inherit
49+
uses:
50+
./.github/workflows/test-wheel-linux.yml
51+
with:
52+
build-type: pull-request
53+
host-platform: ${{ matrix.host-platform }}
54+
local-ctk: 1
55+
build-ctk-ver: 12.8.0

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

+67-18
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,81 @@ name: "CI: Test wheels"
33
on:
44
workflow_call:
55
inputs:
6-
host-platform:
6+
build-type:
77
type: string
88
required: true
9-
python-version:
9+
host-platform:
1010
type: string
1111
required: true
1212
build-ctk-ver:
1313
type: string
1414
required: true
15-
cuda-version:
16-
type: string
17-
required: true
1815
local-ctk:
1916
type: string
2017
required: true
21-
runner:
22-
type: string
23-
required: true
2418

2519
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+
2673
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"
2779
# The build stage could fail but we want the CI to keep moving.
2880
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') }}
3281
# Our self-hosted runners require a container
3382
# TODO: use a different (nvidia?) container
3483
container:
@@ -50,7 +99,7 @@ jobs:
5099

51100
- name: Set environment variables
52101
run: |
53-
PYTHON_VERSION_FORMATTED=$(echo '${{ inputs.python-version }}' | tr -d '.')
102+
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.PY_VER }}' | tr -d '.')
54103
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
55104
REPO_DIR=$(pwd)
56105
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
@@ -59,14 +108,14 @@ jobs:
59108
fi
60109
61110
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 }})"
63112
if [[ $BUILD_CUDA_MAJOR != $TEST_CUDA_MAJOR ]]; then
64113
SKIP_CUDA_BINDINGS_TEST=1
65114
SKIP_CUDA_CORE_CYTHON_TEST=0
66115
else
67116
SKIP_CUDA_BINDINGS_TEST=0
68117
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 }})"
70119
if [[ $BUILD_CUDA_MINOR != $TEST_CUDA_MINOR ]]; then
71120
SKIP_CUDA_CORE_CYTHON_TEST=1
72121
else
@@ -164,10 +213,10 @@ jobs:
164213
pwd
165214
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
166215
167-
- name: Set up Python ${{ inputs.python-version }}
216+
- name: Set up Python ${{ matrix.PY_VER }}
168217
uses: actions/setup-python@v5
169218
with:
170-
python-version: ${{ inputs.python-version }}
219+
python-version: ${{ matrix.PY_VER }}
171220
env:
172221
# we use self-hosted runners on which setup-python behaves weirdly...
173222
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
@@ -178,7 +227,7 @@ jobs:
178227
continue-on-error: false
179228
with:
180229
host-platform: ${{ inputs.host-platform }}
181-
cuda-version: ${{ inputs.cuda-version }}
230+
cuda-version: ${{ matrix.CUDA_VER }}
182231

183232
- name: Run cuda.bindings tests
184233
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
@@ -222,7 +271,7 @@ jobs:
222271
fi
223272
popd
224273
fi
225-
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
274+
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.CUDA_VER }})"
226275
pushd "${CUDA_CORE_ARTIFACTS_DIR}"
227276
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}"]
228277
popd

0 commit comments

Comments
 (0)