Skip to content

Commit 2fb253a

Browse files
committed
test
1 parent e235e69 commit 2fb253a

File tree

7 files changed

+237
-480
lines changed

7 files changed

+237
-480
lines changed

.github/workflows/build_wheels_linux.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ jobs:
285285
bazel build //:libtorchtrt --compilation_mode opt --config=linux
286286
cp bazel-bin/libtorchtrt.tar.gz \
287287
release/tarball/libtorchtrt-${BUILD_VERSION}-tensorrt${TRT_VERSION}-cuda${CU_VERSION:2}-libtorch${PYTORCH_VERSION}-x86_64-linux.tar.gz
288+
return 0
288289
else
289290
if [[ ${{ inputs.is-release-wheel }} == true ]]; then
290291
param="--release"
@@ -378,7 +379,7 @@ jobs:
378379
# NB: Only upload to GitHub after passing smoke tests
379380

380381
- name: Upload wheel to GitHub
381-
if: ${{ inputs.is-release-wheel == false }}
382+
if: ${{ inputs.is-release-tarball == false }}
382383
continue-on-error: true
383384
uses: actions/upload-artifact@v4
384385
with:

.github/workflows/build_wheels_windows.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ on:
8989
description: 'CPU architecture to build for'
9090
default: "x64"
9191
type: string
92+
is-release-tarball:
93+
description: Set to true if the build is for release tarball
94+
required: false
95+
default: false
96+
type: boolean
97+
is-release-wheel:
98+
description: Set to true if the build is for release wheel
99+
required: false
100+
default: false
101+
type: boolean
92102

93103
permissions:
94104
id-token: write
@@ -277,6 +287,19 @@ jobs:
277287
BUILD_PARAMS: ${{ inputs.wheel-build-params }}
278288
run: |
279289
source "${BUILD_ENV_FILE}"
290+
if [[ ${{ inputs.is-release-wheel }} == true || ${{ inputs.is-release-tarball }} == true ]]; then
291+
# release version for upload to pypi
292+
# BUILD_VERSION example: 2.4.0+cu121, we don't want the +cu121 part, so remove +cu121
293+
BUILD_VERSION=${BUILD_VERSION%+*}
294+
if [[ ${{ inputs.is-release-tarball }} == true ]]; then
295+
mkdir -p release/tarball
296+
TRT_VERSION=$(cat dev_dep_versions.yml | grep __tensorrt_version__ | sed 's/__tensorrt_version__: //g' | sed 's/"//g')
297+
bazel build //:libtorchtrt --compilation_mode opt --config=windows
298+
cp bazel-bin/libtorchtrt.tar.gz \
299+
release/tarball/libtorchtrt-${BUILD_VERSION}-tensorrt${TRT_VERSION}-cuda${CU_VERSION:2}-libtorch${PYTORCH_VERSION}-x86_64-windows.tar.gz
300+
return 0
301+
fi
302+
fi
280303
if [[ -z "${ENV_SCRIPT}" ]]; then
281304
${CONDA_RUN} python setup.py bdist_wheel
282305
else
@@ -365,11 +388,19 @@ jobs:
365388
run: |
366389
echo "ARTIFACT_NAME=${REPOSITORY//\//_}_${REF//\//_}_${PYTHON_VERSION}_${CU_VERSION}_${ARCH}" >> "${GITHUB_ENV}"
367390
- name: Upload wheel to GitHub
391+
if: ${{ inputs.is-release-tarball == false }}
368392
continue-on-error: true
369393
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
370394
with:
371395
name: ${{ env.ARTIFACT_NAME }}
372396
path: ${{ inputs.repository }}/dist/
397+
- name: Upload tarball to GitHub
398+
if: ${{ inputs.is-release-tarball == true }}
399+
continue-on-error: true
400+
uses: actions/upload-artifact@v4
401+
with:
402+
name: ${{ env.ARTIFACT_NAME }}
403+
path: ${{ inputs.repository }}/release/tarball/
373404
- uses: ./test-infra/.github/actions/teardown-windows
374405
if: inputs.architecture == 'x64'
375406
name: Teardown Windows
@@ -378,7 +409,8 @@ jobs:
378409
needs: build
379410
uses: pytorch/test-infra/.github/workflows/_binary_upload.yml@main
380411
# for tensorrt-rtx build, do not upload to pytorch indexat at all
381-
if: ${{ inputs.use-rtx == false }}
412+
# if it is the release wheel or tarball, then skip upload to pytorch index(release wheel are uploaded to pypi)
413+
if: ${{ inputs.use-rtx == false && inputs.is-release-wheel == false && inputs.is-release-tarball == false }}
382414
with:
383415
repository: ${{ inputs.repository }}
384416
ref: ${{ inputs.ref }}
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Release aarch64 Linux wheels and tarball artifacts
2+
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
8+
# Release candidate tags look like: v1.11.0-rc1
9+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
10+
workflow_dispatch:
11+
12+
permissions:
13+
id-token: write
14+
contents: read
15+
packages: write
16+
17+
jobs:
18+
generate-matrix:
19+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
20+
if: ${{ contains(github.event.pull_request.labels.*.name, 'build-release-artifacts') || startsWith(github.event.ref, 'refs/tags/v') }}
21+
with:
22+
package-type: wheel
23+
os: linux
24+
test-infra-repository: pytorch/test-infra
25+
test-infra-ref: main
26+
with-rocm: false
27+
with-cpu: false
28+
29+
generate-release-tarball-matrix:
30+
needs: [generate-matrix]
31+
outputs:
32+
matrix: ${{ steps.generate.outputs.matrix }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.11'
38+
- uses: actions/checkout@v4
39+
with:
40+
repository: pytorch/tensorrt
41+
- name: Generate release matrix
42+
id: generate
43+
run: |
44+
set -eou pipefail
45+
MATRIX_BLOB=${{ toJSON(needs.generate-matrix.outputs.matrix) }}
46+
MATRIX_BLOB="$(python3 .github/scripts/generate-release-matrix.py --tarball_matrix "${MATRIX_BLOB}")"
47+
echo "${MATRIX_BLOB}"
48+
echo "matrix=${MATRIX_BLOB}" >> "${GITHUB_OUTPUT}"
49+
50+
release-cxx11-tarball-artifacts:
51+
needs: [generate-release-tarball-matrix]
52+
name: Release torch-tensorrt cxx11 tarball artifacts
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
include:
57+
- repository: pytorch/tensorrt
58+
package-name: torch_tensorrt
59+
pre-script: packaging/pre_build_script.sh
60+
env-var-script: packaging/env_vars.txt
61+
post-script: packaging/post_build_script.sh
62+
smoke-test-script: packaging/smoke_test_script.sh
63+
is-release-tarball: "true"
64+
uses: ./.github/workflows/build_wheels_linux.yml
65+
with:
66+
repository: ${{ matrix.repository }}
67+
ref: ""
68+
test-infra-repository: pytorch/test-infra
69+
test-infra-ref: main
70+
build-matrix: ${{ needs.generate-release-tarball-matrix.outputs.matrix }}
71+
pre-script: ${{ matrix.pre-script }}
72+
env-var-script: ${{ matrix.env-var-script }}
73+
post-script: ${{ matrix.post-script }}
74+
package-name: ${{ matrix.package-name }}
75+
smoke-test-script: ${{ matrix.smoke-test-script }}
76+
trigger-event: ${{ github.event_name }}
77+
is-release-tarball: true
78+
79+
generate-release-wheel-matrix:
80+
needs: [generate-matrix]
81+
outputs:
82+
matrix: ${{ steps.generate.outputs.matrix }}
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/setup-python@v5
86+
with:
87+
python-version: '3.11'
88+
- uses: actions/checkout@v4
89+
with:
90+
repository: pytorch/tensorrt
91+
- name: Generate release matrix
92+
id: generate
93+
run: |
94+
set -eou pipefail
95+
MATRIX_BLOB=${{ toJSON(needs.generate-matrix.outputs.matrix) }}
96+
MATRIX_BLOB="$(python3 .github/scripts/generate-release-matrix.py --wheel_matrix "${MATRIX_BLOB}")"
97+
echo "${MATRIX_BLOB}"
98+
echo "matrix=${MATRIX_BLOB}" >> "${GITHUB_OUTPUT}"
99+
100+
release-wheel-artifacts:
101+
name: Release torch-tensorrt wheel artifacts
102+
needs: [generate-release-wheel-matrix]
103+
strategy:
104+
fail-fast: false
105+
matrix:
106+
include:
107+
- repository: pytorch/tensorrt
108+
package-name: torch_tensorrt
109+
pre-script: packaging/pre_build_script.sh
110+
env-var-script: packaging/env_vars.txt
111+
post-script: packaging/post_build_script.sh
112+
smoke-test-script: packaging/smoke_test_script.sh
113+
is-release-wheel: true
114+
uses: ./.github/workflows/build_wheels_linux.yml
115+
with:
116+
repository: ${{ matrix.repository }}
117+
ref: ""
118+
test-infra-repository: pytorch/test-infra
119+
test-infra-ref: main
120+
build-matrix: ${{ needs.generate-release-wheel-matrix.outputs.matrix }}
121+
pre-script: ${{ matrix.pre-script }}
122+
env-var-script: ${{ matrix.env-var-script }}
123+
post-script: ${{ matrix.post-script }}
124+
package-name: ${{ matrix.package-name }}
125+
smoke-test-script: ${{ matrix.smoke-test-script }}
126+
trigger-event: ${{ github.event_name }}
127+
is-release-wheel: true
128+
129+
concurrency:
130+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}-${{ inputs.job-name }}
131+
cancel-in-progress: true

.github/workflows/release-linux-x86_64.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
package-name: ${{ matrix.package-name }}
7575
smoke-test-script: ${{ matrix.smoke-test-script }}
7676
trigger-event: ${{ github.event_name }}
77-
is-release-tarball: "true"
77+
is-release-tarball: true
7878

7979
generate-release-wheel-matrix:
8080
needs: [generate-matrix]
@@ -110,7 +110,7 @@ jobs:
110110
env-var-script: packaging/env_vars.txt
111111
post-script: packaging/post_build_script.sh
112112
smoke-test-script: packaging/smoke_test_script.sh
113-
is-release-wheel: "true"
113+
is-release-wheel: true
114114
uses: ./.github/workflows/build_wheels_linux.yml
115115
with:
116116
repository: ${{ matrix.repository }}
@@ -124,7 +124,7 @@ jobs:
124124
package-name: ${{ matrix.package-name }}
125125
smoke-test-script: ${{ matrix.smoke-test-script }}
126126
trigger-event: ${{ github.event_name }}
127-
is-release-wheel: "true"
127+
is-release-wheel: true
128128

129129
concurrency:
130130
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}-${{ inputs.job-name }}

0 commit comments

Comments
 (0)