1
- on :
2
- workflow_call :
3
- inputs :
4
- host-platform :
5
- type : string
6
- required : true
7
- python-version :
8
- type : string
9
- required : true
10
- cuda-version :
11
- type : string
12
- required : true
1
+ on : workflow_call
13
2
14
3
jobs :
15
4
build :
16
- name : Build (${{ inputs.host-platform }}, Python "${{ inputs.python-version }}")
5
+ strategy :
6
+ fail-fast : false
7
+ matrix :
8
+ # TODO: align host-platform names with conda convention
9
+ host-platform :
10
+ - linux-x64
11
+ - linux-aarch64
12
+ - win-x64
13
+ python-version :
14
+ - " 3.13"
15
+ - " 3.12"
16
+ - " 3.11"
17
+ - " 3.10"
18
+ - " 3.9"
19
+ cuda-version :
20
+ # Note: this is for build-time only.
21
+ - " 12.6.2"
22
+ name : Build (${{ matrix.host-platform }}, Python "${{ matrix.python-version }}")
17
23
if : ${{ github.repository_owner == 'nvidia' }}
18
24
permissions :
19
25
id-token : write # This is required for configure-aws-credentials
20
26
contents : read # This is required for actions/checkout
21
- runs-on : ${{ (inputs .host-platform == 'linux-x64' && 'linux-amd64-cpu8') ||
22
- (inputs .host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
23
- (inputs .host-platform == 'win-x64' && 'windows-2019') }}
24
- # (inputs .host-platform == 'win-x64' && 'windows-amd64-cpu8') }}
27
+ runs-on : ${{ (matrix .host-platform == 'linux-x64' && 'linux-amd64-cpu8') ||
28
+ (matrix .host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
29
+ (matrix .host-platform == 'win-x64' && 'windows-2019') }}
30
+ # (matrix .host-platform == 'win-x64' && 'windows-amd64-cpu8') }}
25
31
outputs :
26
32
CUDA_CORE_ARTIFACT_NAME : ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACT_NAME }}
27
33
CUDA_CORE_ARTIFACTS_DIR : ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACTS_DIR }}
@@ -35,34 +41,34 @@ jobs:
35
41
36
42
# WAR: setup-python is not relocatable...
37
43
# see https://github.com/actions/setup-python/issues/871
38
- - name : Set up Python ${{ inputs .python-version }}
39
- if : ${{ startsWith(inputs .host-platform, 'linux') }}
44
+ - name : Set up Python ${{ matrix .python-version }}
45
+ if : ${{ startsWith(matrix .host-platform, 'linux') }}
40
46
id : setup-python
41
47
uses : actions/setup-python@v5
42
48
with :
43
49
python-version : " 3.12"
44
50
45
51
- name : Set up MSVC
46
- if : ${{ startsWith(inputs .host-platform, 'win') }}
52
+ if : ${{ startsWith(matrix .host-platform, 'win') }}
47
53
uses : ilammy/msvc-dev-cmd@v1
48
54
49
55
- name : Set environment variables
50
56
shell : bash --noprofile --norc -xeuo pipefail {0}
51
57
run : |
52
- PYTHON_VERSION_FORMATTED=$(echo '${{ inputs .python-version }}' | tr -d '.')
53
- if [[ "${{ inputs .host-platform }}" == linux* ]]; then
58
+ PYTHON_VERSION_FORMATTED=$(echo '${{ matrix .python-version }}' | tr -d '.')
59
+ if [[ "${{ matrix .host-platform }}" == linux* ]]; then
54
60
CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-manylinux*"
55
61
REPO_DIR=$(pwd)
56
- elif [[ "${{ inputs .host-platform }}" == win* ]]; then
62
+ elif [[ "${{ matrix .host-platform }}" == win* ]]; then
57
63
CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-win_amd64"
58
64
PWD=$(pwd)
59
65
REPO_DIR=$(cygpath -w $PWD)
60
66
fi
61
67
62
68
echo "PARALLEL_LEVEL=$(nproc)" >> $GITHUB_ENV
63
- echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ inputs .host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
69
+ echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ matrix .host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
64
70
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
65
- echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs .cuda-version }}-${{ inputs .host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
71
+ echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ matrix .cuda-version }}-${{ matrix .host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
66
72
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
67
73
echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV
68
74
84
90
- name : List the cuda.core artifacts directory
85
91
shell : bash --noprofile --norc -xeuo pipefail {0}
86
92
run : |
87
- if [[ "${{ inputs .host-platform }}" == win* ]]; then
93
+ if [[ "${{ matrix .host-platform }}" == win* ]]; then
88
94
export CHOWN=chown
89
95
else
90
96
export CHOWN="sudo chown"
@@ -110,8 +116,8 @@ jobs:
110
116
uses : ./.github/actions/fetch_ctk
111
117
continue-on-error : false
112
118
with :
113
- host-platform : ${{ inputs .host-platform }}
114
- cuda-version : ${{ inputs .cuda-version }}
119
+ host-platform : ${{ matrix .host-platform }}
120
+ cuda-version : ${{ matrix .cuda-version }}
115
121
fail-on-ctk-cache-miss : false
116
122
117
123
- name : Build cuda.bindings wheel
@@ -134,7 +140,7 @@ jobs:
134
140
- name : List the cuda.bindings artifacts directory
135
141
shell : bash --noprofile --norc -xeuo pipefail {0}
136
142
run : |
137
- if [[ "${{ inputs .host-platform }}" == win* ]]; then
143
+ if [[ "${{ matrix .host-platform }}" == win* ]]; then
138
144
export CHOWN=chown
139
145
else
140
146
export CHOWN="sudo chown"
@@ -165,16 +171,33 @@ jobs:
165
171
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${CUDA_BINDINGS_ARTIFACTS_DIR}" >> $GITHUB_OUTPUT
166
172
167
173
test :
168
- # TODO: improve the name once a separate test matrix is defined
169
- name : Test (CUDA ${{ inputs.cuda-version }})
170
- # TODO: enable testing once win-64 GPU runners are up
171
- if : ${{ (github.repository_owner == 'nvidia') &&
172
- startsWith(inputs.host-platform, 'linux') }}
174
+ strategy :
175
+ fail-fast : false
176
+ matrix :
177
+ # TODO: align host-platform names with conda convention
178
+ host-platform :
179
+ - linux-x64
180
+ - linux-aarch64
181
+ # TODO: enable testing once win-64 GPU runners are up
182
+ # - win-x64
183
+ python-version :
184
+ - " 3.13"
185
+ - " 3.12"
186
+ - " 3.11"
187
+ - " 3.10"
188
+ - " 3.9"
189
+ cuda-version :
190
+ # Note: this is for test-time only.
191
+ - " 12.6.2"
192
+ - " 12.0.1"
193
+ - " 11.8.0"
194
+ name : Test (${{ matrix.host-platform }}, CUDA ${{ matrix.cuda-version }}, Python "${{ matrix.python-version }}")
195
+ if : ${{ (github.repository_owner == 'nvidia') }}
173
196
permissions :
174
197
id-token : write # This is required for configure-aws-credentials
175
198
contents : read # This is required for actions/checkout
176
- runs-on : ${{ (inputs .host-platform == 'linux-x64' && 'linux-amd64-gpu-v100-latest-1') ||
177
- (inputs .host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') }}
199
+ runs-on : ${{ (matrix .host-platform == 'linux-x64' && 'linux-amd64-gpu-v100-latest-1') ||
200
+ (matrix .host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') }}
178
201
# Our self-hosted runners require a container
179
202
# TODO: use a different (nvidia?) container
180
203
container :
@@ -227,10 +250,10 @@ jobs:
227
250
pwd
228
251
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
229
252
230
- - name : Set up Python ${{ inputs .python-version }}
253
+ - name : Set up Python ${{ matrix .python-version }}
231
254
uses : actions/setup-python@v5
232
255
with :
233
- python-version : ${{ inputs .python-version }}
256
+ python-version : ${{ matrix .python-version }}
234
257
235
258
# The cache action needs this
236
259
- name : Install zstd
@@ -243,8 +266,8 @@ jobs:
243
266
uses : ./.github/actions/fetch_ctk
244
267
continue-on-error : false
245
268
with :
246
- host-platform : ${{ inputs .host-platform }}
247
- cuda-version : ${{ inputs .cuda-version }}
269
+ host-platform : ${{ matrix .host-platform }}
270
+ cuda-version : ${{ matrix .cuda-version }}
248
271
fail-on-ctk-cache-miss : true
249
272
250
273
- name : Run test / analysis
0 commit comments