Skip to content

Commit 06be3a9

Browse files
committed
Add back in Windows build and test
1 parent db9fca8 commit 06be3a9

File tree

2 files changed

+94
-25
lines changed

2 files changed

+94
-25
lines changed

.github/workflows/ci.yml

+21-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
host-platform:
2222
- linux-64
2323
- linux-aarch64
24-
#- win-64
24+
- win-64
2525
name: Build ${{ matrix.host-platform }}, CUDA 12.8.0
2626
if: ${{ github.repository_owner == 'nvidia' }}
2727
secrets: inherit
@@ -34,7 +34,6 @@ jobs:
3434
test-linux:
3535
strategy:
3636
fail-fast: false
37-
# TODO: add driver version here
3837
matrix:
3938
host-platform:
4039
- linux-64
@@ -52,3 +51,23 @@ jobs:
5251
build-type: pull-request
5352
host-platform: ${{ matrix.host-platform }}
5453
build-ctk-ver: 12.8.0
54+
55+
test-windows:
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
host-platform:
60+
- win-64
61+
name: Test ${{ matrix.host-platform }}
62+
if: ${{ github.repository_owner == 'nvidia' }}
63+
permissions:
64+
contents: read # This is required for actions/checkout
65+
needs:
66+
- build
67+
secrets: inherit
68+
uses:
69+
./.github/workflows/test-wheel-windows.yml
70+
with:
71+
build-type: pull-request
72+
host-platform: ${{ matrix.host-platform }}
73+
build-ctk-ver: 12.8.0

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

+73-23
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,80 @@ 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
18-
local-ctk:
15+
matrix_filter:
1916
type: string
20-
required: true
21-
runner:
22-
type: string
23-
required: true
17+
default: "."
2418

2519
jobs:
20+
compute-matrix:
21+
runs-on: ubuntu-latest
22+
env:
23+
BUILD_TYPE: ${{ inputs.build-type }}
24+
ARCH: ${{ (inputs.host-platform == 'win-64' && 'amd64') }}
25+
outputs:
26+
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }}
27+
steps:
28+
- name: Validate Test Type
29+
run: |
30+
if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]] && [[ "$BUILD_TYPE" != "branch" ]]; then
31+
echo "Invalid build type! Must be one of 'nightly', 'pull-request', or 'branch'."
32+
exit 1
33+
fi
34+
- name: Compute Python Test Matrix
35+
id: compute-matrix
36+
run: |
37+
set -eo pipefail
38+
39+
# Please keep the matrices sorted in ascending order by the following:
40+
#
41+
# [PY_VER, CUDA_VER, LOCAL_CTK]
42+
#
43+
export MATRICES="
44+
pull-request:
45+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' }
46+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' }
47+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '0' }
48+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '1' }
49+
nightly:
50+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' }
51+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' }
52+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '0' }
53+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '1' }
54+
"
55+
56+
# Use the nightly matrix for branch tests
57+
MATRIX_TYPE="${BUILD_TYPE}"
58+
if [[ "${MATRIX_TYPE}" == "branch" ]]; then
59+
MATRIX_TYPE="nightly"
60+
fi
61+
export MATRIX_TYPE
62+
TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(MATRIX_TYPE)]')
63+
export TEST_MATRIX
64+
65+
MATRIX="$(
66+
yq -n -o json 'env(TEST_MATRIX)' | \
67+
jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end'
68+
)"
69+
70+
echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}"
71+
2672
test:
2773
# The build stage could fail but we want the CI to keep moving.
74+
needs: compute-matrix
75+
strategy:
76+
fail-fast: false
77+
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
2878
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
29-
runs-on: ${{ (inputs.runner == 'default' && inputs.host-platform == 'win-64' && 'cuda-python-windows-gpu-github') }}
79+
runs-on: 'cuda-python-windows-gpu-github'
3080
steps:
3181
- name: Checkout ${{ github.event.repository.name }}
3282
uses: actions/checkout@v4
@@ -42,18 +92,18 @@ jobs:
4292

4393
- name: Set environment variables
4494
run: |
45-
$PYTHON_VERSION_FORMATTED = '${{ inputs.python-version }}' -replace '\.'
95+
$PYTHON_VERSION_FORMATTED = '${{ matrix.PY_VER }}' -replace '\.'
4696
$REPO_DIR = $PWD.Path
4797
4898
$BUILD_CUDA_MAJOR = '${{ inputs.build-ctk-ver }}' -split '\.' | Select-Object -First 1
49-
$TEST_CUDA_MAJOR = '${{ inputs.cuda-version }}' -split '\.' | Select-Object -First 1
99+
$TEST_CUDA_MAJOR = '${{ matrix.CUDA_VER }}' -split '\.' | Select-Object -First 1
50100
if ($BUILD_CUDA_MAJOR -ne $TEST_CUDA_MAJOR) {
51101
$SKIP_CUDA_BINDINGS_TEST = 1
52102
} else {
53103
$SKIP_CUDA_BINDINGS_TEST = 0
54104
}
55105
56-
if ('${{ inputs.local-ctk }}' -eq '1') {
106+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
57107
if ($TEST_CUDA_MAJOR -eq '12') {
58108
$MINI_CTK_DEPS = '["nvcc", "nvrtc", "nvjitlink"]'
59109
} else {
@@ -149,23 +199,23 @@ jobs:
149199
Get-Location
150200
Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName
151201
152-
- name: Set up Python ${{ inputs.python-version }}
202+
- name: Set up Python ${{ matrix.PY_VER }}
153203
uses: actions/setup-python@v5
154204
with:
155-
python-version: ${{ inputs.python-version }}
205+
python-version: ${{ matrix.PY_VER }}
156206

157207
- name: Set up mini CTK
158-
if: ${{ inputs.local-ctk == '1' }}
208+
if: ${{ matrix.LOCAL_CTK == '1' }}
159209
# Note: The GH-hosted Windows GPU runner does not have Git for Windows pre-installed,
160210
# so we cannot use our own fetch_ctk action unfortunately...
161211
uses: Jimver/cuda-toolkit@v0.2.21
162212
with:
163-
cuda: ${{ inputs.cuda-version }}
213+
cuda: ${{ matrix.CUDA_VER }}
164214
method: 'network'
165215
sub-packages: ${{ env.MINI_CTK_DEPS }}
166216

167217
- name: Update PATH
168-
if: ${{ inputs.local-ctk == '1' }}
218+
if: ${{ matrix.LOCAL_CTK == '1' }}
169219
run: |
170220
# mimics actual CTK installation
171221
echo $PATH
@@ -175,7 +225,7 @@ jobs:
175225
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
176226
run: |
177227
Push-Location $env:CUDA_BINDINGS_ARTIFACTS_DIR
178-
if ('${{ inputs.local-ctk }}' -eq '1') {
228+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
179229
Get-ChildItem $env:CUDA_PATH
180230
echo $PATH
181231
pip install (Get-ChildItem -Filter *.whl).FullName
@@ -196,14 +246,14 @@ jobs:
196246
# If mismatch: cuda.bindings is installed from the backport branch.
197247
if ($env:SKIP_CUDA_BINDINGS_TEST -eq '1') {
198248
Push-Location $env:CUDA_BINDINGS_ARTIFACTS_DIR
199-
if ('${{ inputs.local-ctk }}' -eq '1') {
249+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
200250
pip install (Get-ChildItem -Filter *.whl).FullName
201251
} else {
202252
pip install "$((Get-ChildItem -Filter *.whl).FullName)[all]"
203253
}
204254
Pop-Location
205255
}
206-
$TEST_CUDA_MAJOR = '${{ inputs.cuda-version }}' -split '\.' | Select-Object -First 1
256+
$TEST_CUDA_MAJOR = '${{ matrix.CUDA_VER }}' -split '\.' | Select-Object -First 1
207257
Push-Location $env:CUDA_CORE_ARTIFACTS_DIR
208258
pip install "$((Get-ChildItem -Filter *.whl).FullName)[cu${TEST_CUDA_MAJOR}]"
209259
Pop-Location
@@ -215,7 +265,7 @@ jobs:
215265
216266
- name: Ensure cuda-python installable
217267
run: |
218-
if ('${{ inputs.local-ctk }}' -eq '1') {
268+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
219269
pip install (Get-ChildItem -Filter cuda_python*.whl).FullName
220270
} else {
221271
pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"

0 commit comments

Comments
 (0)