|
11 | 11 | cuda-version: |
12 | 12 | required: true |
13 | 13 | type: string |
| 14 | + prev-cuda-version: |
| 15 | + required: true |
| 16 | + type: string |
14 | 17 |
|
15 | 18 | defaults: |
16 | 19 | run: |
@@ -109,45 +112,67 @@ jobs: |
109 | 112 | path: cuda_pathfinder/*.whl |
110 | 113 | if-no-files-found: error |
111 | 114 |
|
| 115 | + - name: Set up mini CTK |
| 116 | + uses: ./.github/actions/fetch_ctk |
| 117 | + continue-on-error: false |
| 118 | + with: |
| 119 | + host-platform: ${{ inputs.host-platform }} |
| 120 | + cuda-version: ${{ inputs.cuda-version }} |
| 121 | + |
| 122 | + # TODO: this currently builds against the public cuda.bindings wheel. Consider |
| 123 | + # building against the wheel from main instead (the below step). |
112 | 124 | - name: Build cuda.core wheel |
113 | 125 | uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4 |
114 | 126 | with: |
115 | 127 | package-dir: ./cuda_core/ |
116 | 128 | output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
117 | | - |
118 | | - - name: List the cuda.core artifacts directory |
| 129 | + env: |
| 130 | + CIBW_BUILD: ${{ env.CIBW_BUILD }} |
| 131 | + CIBW_ENVIRONMENT: > |
| 132 | + CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }} |
| 133 | + # CIBW mounts the host filesystem under /host |
| 134 | + CIBW_ENVIRONMENT_LINUX: > |
| 135 | + CUDA_PATH=/host/${{ env.CUDA_PATH }} |
| 136 | + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} |
| 137 | + CIBW_ENVIRONMENT_WINDOWS: > |
| 138 | + CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" |
| 139 | + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} |
| 140 | +
|
| 141 | + - name: List the cuda.core artifacts directory and rename |
119 | 142 | run: | |
120 | 143 | if [[ "${{ inputs.host-platform }}" == win* ]]; then |
121 | 144 | export CHOWN=chown |
122 | 145 | else |
123 | 146 | export CHOWN="sudo chown" |
124 | 147 | fi |
125 | 148 | $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
126 | | - ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
127 | | -
|
128 | | - - name: Check cuda.core wheel |
129 | | - run: | |
130 | | - twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl |
131 | 149 |
|
132 | | - - name: Upload cuda.core build artifacts |
133 | | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
134 | | - with: |
135 | | - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} |
136 | | - path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl |
137 | | - if-no-files-found: error |
| 150 | + # Rename wheel to include CUDA version suffix |
| 151 | + for wheel in ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl; do |
| 152 | + if [[ -f "$wheel" ]]; then |
| 153 | + base_name=$(basename "$wheel" .whl) |
| 154 | + new_name="${base_name}.cu${BUILD_CUDA_MAJOR}.whl" |
| 155 | + mv "$wheel" "cu${BUILD_CUDA_MAJOR}/${new_name}" |
| 156 | + echo "Renamed wheel to: ${new_name}" |
| 157 | + fi |
| 158 | + done |
138 | 159 |
|
139 | | - - name: Set up mini CTK |
140 | | - uses: ./.github/actions/fetch_ctk |
141 | | - continue-on-error: false |
142 | | - with: |
143 | | - host-platform: ${{ inputs.host-platform }} |
144 | | - cuda-version: ${{ inputs.cuda-version }} |
| 160 | + ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
145 | 161 |
|
146 | 162 | - name: Build cuda.bindings wheel |
147 | 163 | uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4 |
148 | 164 | with: |
149 | 165 | package-dir: ./cuda_bindings/ |
150 | 166 | output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} |
| 167 | + env: |
| 168 | + CIBW_BUILD: ${{ env.CIBW_BUILD }} |
| 169 | + # CIBW mounts the host filesystem under /host |
| 170 | + CIBW_ENVIRONMENT_LINUX: > |
| 171 | + CUDA_PATH=/host/${{ env.CUDA_PATH }} |
| 172 | + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} |
| 173 | + CIBW_ENVIRONMENT_WINDOWS: > |
| 174 | + CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" |
| 175 | + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} |
151 | 176 |
|
152 | 177 | - name: List the cuda.bindings artifacts directory |
153 | 178 | run: | |
@@ -252,3 +277,71 @@ jobs: |
252 | 277 | name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests |
253 | 278 | path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }} |
254 | 279 | if-no-files-found: error |
| 280 | + |
| 281 | + # Note: This overwrites CUDA_PATH etc |
| 282 | + - name: Set up mini CTK |
| 283 | + uses: ./.github/actions/fetch_ctk |
| 284 | + continue-on-error: false |
| 285 | + with: |
| 286 | + host-platform: ${{ inputs.host-platform }} |
| 287 | + cuda-version: ${{ inputs.prev-cuda-version }} |
| 288 | + cuda-path: "./cuda_toolkit_prev" |
| 289 | + |
| 290 | + # TODO: this currently builds against the public cuda.bindings wheel. Consider |
| 291 | + # building against the wheel from the backport branch instead. |
| 292 | + - name: Build cuda.core wheel |
| 293 | + uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4 |
| 294 | + with: |
| 295 | + package-dir: ./cuda_core/ |
| 296 | + output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
| 297 | + env: |
| 298 | + CIBW_BUILD: ${{ env.CIBW_BUILD }} |
| 299 | + CIBW_ENVIRONMENT: > |
| 300 | + CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }} |
| 301 | + # CIBW mounts the host filesystem under /host |
| 302 | + CIBW_ENVIRONMENT_LINUX: > |
| 303 | + CUDA_PATH=/host/${{ env.CUDA_PATH }} |
| 304 | + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} |
| 305 | + CIBW_ENVIRONMENT_WINDOWS: > |
| 306 | + CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" |
| 307 | + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} |
| 308 | +
|
| 309 | + - name: List the cuda.core artifacts directory and rename |
| 310 | + run: | |
| 311 | + if [[ "${{ inputs.host-platform }}" == win* ]]; then |
| 312 | + export CHOWN=chown |
| 313 | + else |
| 314 | + export CHOWN="sudo chown" |
| 315 | + fi |
| 316 | + $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
| 317 | + ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
| 318 | +
|
| 319 | + # Rename wheel to include CUDA version suffix |
| 320 | + for wheel in ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl; do |
| 321 | + if [[ -f "$wheel" ]]; then |
| 322 | + base_name=$(basename "$wheel" .whl) |
| 323 | + new_name="${base_name}.cu${BUILD_PREV_CUDA_MAJOR}.whl" |
| 324 | + mv "$wheel" "cu${BUILD_PREV_CUDA_MAJOR}/${new_name}" |
| 325 | + echo "Renamed wheel to: ${new_name}" |
| 326 | + fi |
| 327 | + done |
| 328 | +
|
| 329 | + ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} |
| 330 | +
|
| 331 | + - name: Merge cuda.core wheels |
| 332 | + run: | |
| 333 | + python ci/tools/merge_cuda_core_wheels.py \ |
| 334 | + "${{ env.CUDA_CORE_ARTIFACTS_DIR }}"/cu"${BUILD_CUDA_MAJOR}"/cuda_core*.whl \ |
| 335 | + "${{ env.CUDA_CORE_ARTIFACTS_DIR }}"/cu"${BUILD_PREV_CUDA_MAJOR}"/cuda_core*.whl \ |
| 336 | + --output-dir "${{ env.CUDA_CORE_ARTIFACTS_DIR }}" |
| 337 | +
|
| 338 | + - name: Check cuda.core wheel |
| 339 | + run: | |
| 340 | + twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl |
| 341 | +
|
| 342 | + - name: Upload cuda.core build artifacts |
| 343 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 344 | + with: |
| 345 | + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} |
| 346 | + path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl |
| 347 | + if-no-files-found: error |
0 commit comments