Skip to content

Commit 8824afb

Browse files
committed
test
1 parent 59f5cdc commit 8824afb

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

.github/scripts/build-linux-release-artifacts.sh

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ set -x
44

55
CURRENT_DIR=`pwd`
66

7-
ls
8-
9-
python -m pip list | grep torch
10-
11-
python -m pip list | grep tensorrt
12-
137
if [[ "${PYTHON_VERSION}" == "3.8" ]]; then
148
PY_BUILD_CODE=cp38-cp38
159
elif [[ "${PYTHON_VERSION}" == "3.9" ]]; then
@@ -25,7 +19,14 @@ fi
2519

2620
python -m pip install auditwheel
2721

22+
# Setup Bazel via Bazelisk
23+
wget -q https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 -O /usr/bin/bazel &&\
24+
chmod a+x /usr/bin/bazel
25+
26+
which bazel
27+
2828
# download TensorRT tarball
29+
TRT_VERSION=10.0.1
2930
wget -q https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.0.1/tars/TensorRT-10.0.1.6.Linux.x86_64-gnu.cuda-12.4.tar.gz \
3031
&& gunzip TensorRT-10.0.1.6.Linux.x86_64-gnu.cuda-12.4.tar.gz \
3132
&& tar -xvf TensorRT-10.0.1.6.Linux.x86_64-gnu.cuda-12.4.tar \
@@ -37,20 +38,13 @@ SITE_PKG_DIR=`python -c 'import sysconfig; print(sysconfig.get_paths()["purelib
3738

3839
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${TENSERRT_DIR}/lib:${SITE_PKG_DIR}/torch/lib:${SITE_PKG_DIR}/tensorrt/:${CUDA_HOME}/lib64:${CUDA_HOME}/lib64/stubs \
3940

40-
python -m auditwheel repair \
41-
$(cat py/ci/soname_excludes.params) \
42-
--plat manylinux_2_34_x86_64 \
43-
/opt/torch-tensorrt-builds/torch_tensorrt-*-${PY_BUILD_CODE}-linux_x86_64.whl
44-
4541
if [[ ! -d dist ]]; then
4642
mkdir dist
4743
fi
48-
cp wheelhouse/torch_tensorrt*x86_64.whl dist/
4944

50-
CUDA_VERSION=$(python -c "import versions; versions.cuda_version()")
51-
TORCHTRT_VERSION=$(python -c "import versions; versions.torch_tensorrt_version_release()")
52-
TRT_VERSION=$(python -c "import versions; versions.tensorrt_version()")
53-
TORCH_VERSION=$(python -c "from torch import __version__;print(__version__.split('+')[0])")
45+
# BUILD_VERSION is 2.3.0+cu121
46+
# but we don't want the +cu121 in the wheel file name
47+
TORCHTRT_VERSION=${BUILD_VERSION%+*}
5448

5549
libtorchtrt() {
5650
pre_cxx11_abi=${1}
@@ -62,18 +56,29 @@ libtorchtrt() {
6256
PY_DIR=/opt/python/${PY_BUILD_CODE}
6357

6458
python -m pip install -r ${PROJECT_DIR}/py/requirements.txt
59+
60+
TORCH_VERSION=$(python -c "from torch import __version__;print(__version__.split('+')[0])")
61+
6562
if [[ '${pre_cxx11_abi}' == 'true' ]]; then
6663
bazel build //:libtorchtrt --config pre_cxx11_abi --platforms //toolchains:ci_rhel_x86_64_linux -c opt --noshow_progress
6764
cp ${PROJECT_DIR}/bazel-bin/libtorchtrt.tar.gz \
68-
${PROJECT_DIR}/dist/libtorchtrt-${TORCHTRT_VERSION}-pre-cxx11-abi-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
65+
${PROJECT_DIR}/dist/libtorchtrt-${TORCHTRT_VERSION}-pre-cxx11-abi-tensorrt${TRT_VERSION}-cuda${CU_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
6966
else
7067
bazel build //:libtorchtrt --platforms //toolchains:ci_rhel_x86_64_linux -c opt --noshow_progress
7168
cp ${PROJECT_DIR}/bazel-bin/libtorchtrt.tar.gz \
72-
${PROJECT_DIR}/dist/libtorchtrt-${TORCHTRT_VERSION}-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
69+
${PROJECT_DIR}/dist/libtorchtrt-${TORCHTRT_VERSION}-tensorrt${TRT_VERSION}-cuda${CU_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
7370
fi
7471
}
7572

7673
# build pre_cxx11_abi
7774
libtorchtrt true
7875
# build cxx11_abi
7976
libtorchtrt false
77+
78+
# auditwheel repair
79+
python -m auditwheel repair \
80+
$(cat py/ci/soname_excludes.params) \
81+
--plat manylinux_2_34_x86_64 \
82+
/opt/torch-tensorrt-builds/torch_tensorrt-*-${PY_BUILD_CODE}-linux_x86_64.whl
83+
84+
cp wheelhouse/torch_tensorrt*x86_64.whl dist/

0 commit comments

Comments
 (0)