-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[CI][Packaging] Cibuildwheel-based multi-platform wheel publishing #19641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ddb6eea
5498239
39907d9
55ffc29
a36d3b8
5738a1f
93b9c52
0ef42c4
3b12e76
10bd65e
a90d2e7
74ae3e2
1b5724d
0d31684
32f5349
bc2a7e4
59c47bd
0e95460
1865e46
2b20497
c87fdf2
656b89c
99eba8c
265a1c8
7ac2e4c
a5594e0
1c663a1
94a4e0f
198224a
bf10c6a
bb87383
11f7e6b
af2a217
b918918
0c40e0d
7ce86b0
4855ebe
8221238
01934ab
bc20088
6f7743e
f03ec66
887734c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| name: Build CUDA Runtime | ||
| description: Build libtvm_runtime_cuda for the TVM wheel packaging flow. | ||
|
|
||
| inputs: | ||
| arch: | ||
| description: "Target Linux architecture for CUDA builds (x86_64 or aarch64)" | ||
| required: true | ||
| linux_image: | ||
| description: "Manylinux image tag to use on Linux runners" | ||
| required: false | ||
| default: "" | ||
| linux_image_tag: | ||
| description: "Pinned manylinux container tag shared with cibuildwheel" | ||
| required: false | ||
| default: "" | ||
| cuda_architectures: | ||
| description: "CMake CUDA architectures for libtvm_runtime_cuda.so" | ||
| required: false | ||
| default: "75" | ||
| include_cuda_runtime: | ||
| description: "Set to true to build the CUDA runtime library" | ||
| required: false | ||
| default: "false" | ||
|
|
||
| outputs: | ||
| cuda_runtime_path: | ||
| description: "Absolute path to the built libtvm_runtime_cuda.so, or empty for CPU-only wheels" | ||
| value: ${{ steps.cuda_runtime.outputs.path }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: ./.github/actions/detect-env-vars | ||
| id: env_vars | ||
|
|
||
| - name: Detect CUDA inputs | ||
| id: cuda_inputs | ||
| shell: bash -l {0} | ||
| env: | ||
| INPUT_INCLUDE_CUDA_RUNTIME: ${{ inputs.include_cuda_runtime }} | ||
| run: | | ||
| set -eux | ||
| include_cuda_runtime="$(printf '%s' "${INPUT_INCLUDE_CUDA_RUNTIME}" | tr '[:upper:]' '[:lower:]')" | ||
| case "${include_cuda_runtime}" in | ||
| 1|true|yes|on) include_cuda_runtime=1 ;; | ||
| 0|false|no|off) include_cuda_runtime=0 ;; | ||
| *) | ||
| echo "include_cuda_runtime must be a boolean value" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| echo "include_cuda_runtime=${include_cuda_runtime}" >> "${GITHUB_OUTPUT}" | ||
|
Comment on lines
+53
to
+69
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this check unnecessary? |
||
|
|
||
| - name: Build CUDA runtime in manylinux | ||
| if: runner.os == 'Linux' && steps.cuda_inputs.outputs.include_cuda_runtime == '1' | ||
| shell: bash -l {0} | ||
| env: | ||
| TVM_MANYLINUX_IMAGE: ${{ inputs.linux_image }} | ||
| TVM_MANYLINUX_IMAGE_TAG: ${{ inputs.linux_image_tag }} | ||
| TVM_ARCH: ${{ inputs.arch }} | ||
| TVM_CUDA_ARCHITECTURES: ${{ inputs.cuda_architectures }} | ||
| TVM_CUDA_BUILD_DIR: ${{ runner.temp }}/tvm-wheel-cuda | ||
| TVM_INCLUDE_CUDA_RUNTIME: "1" | ||
| TVM_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }} | ||
| CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }} | ||
| run: ci/scripts/package/tvm_wheel_helper.sh manylinux-cuda | ||
|
|
||
| - name: Reject non-Linux CUDA runtime builds | ||
| if: runner.os != 'Linux' && steps.cuda_inputs.outputs.include_cuda_runtime == '1' | ||
| shell: bash -l {0} | ||
| run: | | ||
| echo "CUDA runtime wheels are only enabled on Linux in this workflow" >&2 | ||
| exit 1 | ||
|
Comment on lines
+85
to
+90
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be dropped? |
||
|
|
||
| - name: Report CUDA runtime output | ||
| id: cuda_runtime | ||
| shell: bash -l {0} | ||
| env: | ||
| INCLUDE_CUDA_RUNTIME: ${{ steps.cuda_inputs.outputs.include_cuda_runtime }} | ||
| TVM_CUDA_BUILD_DIR: ${{ runner.temp }}/tvm-wheel-cuda | ||
| TVM_CUDA_RUNTIME_PATH: "" | ||
| run: | | ||
| set -eux | ||
| if [[ "${INCLUDE_CUDA_RUNTIME}" != "1" ]]; then | ||
| echo "path=" >> "${GITHUB_OUTPUT}" | ||
| exit 0 | ||
| fi | ||
| cuda_runtime="$(ci/scripts/package/tvm_wheel_helper.sh cuda-path)" | ||
| if [[ -z "${cuda_runtime}" ]]; then | ||
| echo "CUDA runtime build did not produce libtvm_runtime_cuda.so" >&2 | ||
| exit 1 | ||
| fi | ||
| case "${cuda_runtime}" in | ||
| "${TVM_CUDA_BUILD_DIR}"/*) ;; | ||
| *) | ||
| echo "CUDA runtime path is outside the expected build directory: ${cuda_runtime}" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| echo "path=${cuda_runtime}" >> "${GITHUB_OUTPUT}" | ||
|
Comment on lines
+92
to
+117
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this report step? Or the "Build CUDA runtime in manylinux" step above already reports necessary info (e.g., success, failure, or failure reason) |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should always be true? If that's the case, we can remove this param?