Skip to content

Commit 3d6a1ba

Browse files
authored
feat: build manylinux compatible builds (#1527)
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 8dc1a06 commit 3d6a1ba

File tree

7 files changed

+200
-80
lines changed

7 files changed

+200
-80
lines changed

.circleci/config.yml

Lines changed: 65 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ commands:
460460
- run:
461461
name: Run core / C++ tests
462462
environment:
463-
LD_LIBRARY_PATH: "/home/circleci/project/bazel-project/external/libtorch_pre_cxx11_abi/lib/:/home/circleci/project/bazel-project/external/tensorrt/lib/:/usr/local/cuda/lib64/:$LD_LIBRARY_PATH"
463+
LD_LIBRARY_PATH: "/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch_tensorrt.libs:/home/circleci/project/bazel-project/external/libtorch_pre_cxx11_abi/lib/:/home/circleci/project/bazel-project/external/tensorrt/lib/:/usr/local/cuda/lib64/:$LD_LIBRARY_PATH"
464464
command: |
465465
set -e
466466
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
@@ -682,7 +682,7 @@ jobs:
682682
at: /tmp/dist
683683
- run:
684684
name: "Install torch-tensorrt"
685-
command: pip3 install /tmp/dist/x86_64-linux/*
685+
command: pip3 install /tmp/dist/x86_64-linux/*cp39-cp39*.whl
686686
- dump-test-env
687687
- test-ts-core
688688

@@ -710,7 +710,7 @@ jobs:
710710
torch-build-index: << parameters.torch-build-index >>
711711
- run:
712712
name: "Install torch-tensorrt"
713-
command: pip3 install --pre /tmp/dist/x86_64-linux/*
713+
command: pip3 install --pre /tmp/dist/x86_64-linux/*cp39-cp39*.whl
714714
- dump-test-env
715715
- test-ts-py-api
716716

@@ -740,7 +740,7 @@ jobs:
740740
command: export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
741741
- run:
742742
name: "Install torch-tensorrt"
743-
command: pip3 install --pre /tmp/dist/x86_64-linux/*
743+
command: pip3 install --pre /tmp/dist/x86_64-linux/*cp39-cp39*.whl
744744
# We install torch after torch-trt because pip automatically enforces the version constraint otherwise
745745
- dump-test-env
746746
- test-fx
@@ -754,9 +754,10 @@ jobs:
754754
type: string
755755
torch-build-index:
756756
type: string
757+
parallelism: 5
757758
machine:
758759
image: ubuntu-2004-cuda-11.4:202110-01
759-
resource_class: xlarge
760+
resource_class: gpu.nvidia.small
760761
steps:
761762
- when:
762763
condition: << parameters.enabled >>
@@ -768,18 +769,58 @@ jobs:
768769
cd ~/project/py/
769770
docker build -t torch_tensorrt_release_env --build-arg trt_version=<< pipeline.parameters.trt-version-short >> -f ci/Dockerfile.ci .
770771
- run:
771-
name: Build Python packages and pre-cxx11-abi tarball
772+
name: Build Python packages
772773
command: |
773774
cd ~/project/py/
774775
cp ~/project/toolchains/ci_workspaces/WORKSPACE.x86_64.release.rhel ~/project/WORKSPACE
775-
docker run -it --rm -v ~/project:/workspace/project torch_tensorrt_release_env /bin/bash /workspace/project/py/ci/build_whl.sh
776+
docker run -it --rm --gpus all -v ~/project:/workspace/project torch_tensorrt_release_env /bin/bash -c "source /workspace/project/py/ci/build_whl.sh && $(circleci tests split --total=5 ~/project/py/ci/build_manifest.txt)"
777+
- run:
778+
name: Collect packages
779+
command: |
780+
mkdir -p /tmp/dist/x86_64-linux
781+
cp -r ~/project/py/wheelhouse/* /tmp/dist/x86_64-linux
782+
- persist_to_workspace:
783+
root: /tmp/dist
784+
paths:
785+
- x86_64-linux
786+
- store_artifacts:
787+
path: /tmp/dist/x86_64-linux
788+
destination: x86_64-linux
789+
- unless:
790+
condition: << parameters.enabled >>
791+
steps:
792+
- run:
793+
name: Skipped packaging
794+
command: echo -e "Packaging stage not enabled"
795+
796+
# TODO: Merge this with above
797+
package-x86_64-linux-cxx11-abi:
798+
parameters:
799+
enabled:
800+
type: boolean
801+
default: false
802+
torch-build:
803+
type: string
804+
torch-build-index:
805+
type: string
806+
machine:
807+
image: ubuntu-2004-cuda-11.4:202110-01
808+
resource_class: xlarge
809+
steps:
810+
- when:
811+
condition: << parameters.enabled >>
812+
steps:
813+
- checkout
776814
- create-env:
777815
os: "ubuntu2004"
778816
platform: "x86_64"
779817
cudnn-version: << pipeline.parameters.cudnn-version >>
780818
trt-version-short: << pipeline.parameters.trt-version-short >>
781819
bazel-version: << pipeline.parameters.bazel-version >>
782820
bazel-platform: "x86_64"
821+
- install-torch-from-index:
822+
torch-build: << parameters.torch-build >>
823+
torch-build-index: << parameters.torch-build-index >>
783824
- run:
784825
name: Build cxx11-abi tarball
785826
command: |
@@ -788,13 +829,16 @@ jobs:
788829
cp ~/project/toolchains/ci_workspaces/WORKSPACE.x86_64.release.ubuntu ~/project/WORKSPACE
789830
bazel build //:libtorchtrt -c opt --noshow_progress
790831
sudo chown -R $(whoami) ~/project/py
791-
CUDA_VERSION=$(cd ~/project/py/torch_tensorrt && python3 -c "from _version import __cuda_version__;print(__cuda_version__)")
792-
TORCHTRT_VERSION=$(cd ~/project/py/torch_tensorrt && python3 -c "from _version import __version__;print(__version__)")
793-
TRT_VERSION=$(cd ~/project/py/torch_tensorrt && python3 -c "from _version import __tensorrt_version__;print(__tensorrt_version__)")
794-
CUDNN_VERSION=$(cd ~/project/py/torch_tensorrt && python3 -c "from _version import __cudnn_version__;print(__cudnn_version__)")
832+
cd ~/project/py
833+
CUDA_VERSION=$(python3 -c "from versions import __cuda_version__;print(__cuda_version__)")
834+
TORCHTRT_VERSION=$(python3 -c "from versions import __version__;print(__version__)")
835+
TRT_VERSION=$(python3 -c "from versions import __tensorrt_version__;print(__tensorrt_version__)")
836+
CUDNN_VERSION=$(python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)")
837+
TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
795838
pip3 install --upgrade pip
796839
pip3 install -r ~/project/py/requirements.txt
797840
TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
841+
mkdir -p ~/project/py/dist/
798842
cp ~/project/bazel-bin/libtorchtrt.tar.gz ~/project/py/dist/libtorchtrt-${TORCHTRT_VERSION}-cudnn${CUDNN_VERSION}-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
799843
- run:
800844
name: Collect packages
@@ -1076,7 +1120,13 @@ workflows:
10761120
when: << pipeline.parameters.enable-packaging >>
10771121
jobs:
10781122

1079-
- build-x86_64-linux:
1123+
- package-x86_64-linux:
1124+
enabled: << pipeline.parameters.enable-packaging >>
1125+
torch-build: << pipeline.parameters.torch-build >>
1126+
torch-build-index: << pipeline.parameters.torch-build-index >>
1127+
1128+
- package-x86_64-linux-cxx11-abi:
1129+
enabled: << pipeline.parameters.enable-packaging >>
10801130
torch-build: << pipeline.parameters.torch-build >>
10811131
torch-build-index: << pipeline.parameters.torch-build-index >>
10821132

@@ -1087,31 +1137,21 @@ workflows:
10871137
trt-version-long: << pipeline.parameters.trt-version-long >>
10881138
cudnn-version: << pipeline.parameters.cudnn-version >>
10891139
requires:
1090-
- build-x86_64-linux
1140+
- package-x86_64-linux
10911141

10921142
- test-py-ts-x86_64-linux:
10931143
torch-build: << pipeline.parameters.torch-build >>
10941144
torch-build-index: << pipeline.parameters.torch-build-index >>
10951145
trt-version-long: << pipeline.parameters.trt-version-long >>
10961146
requires:
1097-
- build-x86_64-linux
1147+
- package-x86_64-linux
10981148

10991149
- test-py-fx-x86_64-linux:
11001150
torch-build: << pipeline.parameters.torch-build >>
11011151
torch-build-index: << pipeline.parameters.torch-build-index >>
11021152
trt-version-long: << pipeline.parameters.trt-version-long >>
11031153
requires:
1104-
- build-x86_64-linux
1105-
1106-
1107-
- package-x86_64-linux:
1108-
enabled: << pipeline.parameters.enable-packaging >>
1109-
torch-build: << pipeline.parameters.torch-build >>
1110-
torch-build-index: << pipeline.parameters.torch-build-index >>
1111-
#requires:
1112-
#- test-core-cpp-x86_64-linux
1113-
#- test-py-ts-x86_64-linux
1114-
#- test-py-fx-x86_64-linux
1154+
- package-x86_64-linux
11151155

11161156
on-push:
11171157
jobs:

py/ci/build_manifest.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
py37
2+
py38
3+
py39
4+
py310
5+
libtorchtrt_pre_cxx11_abi

py/ci/build_whl.sh

Lines changed: 84 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,66 @@
22

33
# Example usage: docker run -it -v$(pwd)/..:/workspace/TRTorch build_trtorch_wheel /bin/bash /workspace/TRTorch/py/build_whl.sh
44

5-
cd /workspace/project/py
6-
75
export CXX=g++
86
export CUDA_HOME=/usr/local/cuda-11.7
9-
PROJECT_DIR=/workspace/project
7+
export PROJECT_DIR=/workspace/project
108

119
cp -r $CUDA_HOME /usr/local/cuda
1210

13-
build_py37() {
14-
/opt/python/cp37-cp37m/bin/python -m pip install --upgrade pip
15-
/opt/python/cp37-cp37m/bin/python -m pip install -r requirements.txt
16-
/opt/python/cp37-cp37m/bin/python setup.py bdist_wheel --release --ci
17-
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python/cp37-cp37m/lib/python3.7/site-packages/torch/lib:/opt/python/cp37-cp37m/lib/python3.7/site-packages/tensorrt/:/usr/local/cuda-11.7/lib64:/usr/local/cuda-11.7/lib64/stubs /opt/python/cp37-cp37m/bin/python -m auditwheel repair --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-cp37-cp37m-linux_x86_64.whl
11+
py37() {
12+
cd /workspace/project/py
13+
PY_BUILD_CODE=cp37-cp37m
14+
PY_VERSION=3.7
15+
PY_NAME=python${PY_VERSION}
16+
PY_DIR=/opt/python/${PY_BUILD_CODE}
17+
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/
18+
${PY_DIR}/bin/python -m pip install --upgrade pip
19+
${PY_DIR}/bin/python -m pip install -r requirements.txt
20+
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel
21+
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci
22+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PY_PKG_DIR}/torch/lib:${PY_PKG_DIR}/tensorrt/:${CUDA_HOME}/lib64:${CUDA_HOME}/lib64/stubs ${PY_DIR}/bin/python -m auditwheel repair $(cat ${PROJECT_DIR}/py/ci/soname_excludes.params) --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-${PY_BUILD_CODE}-linux_x86_64.whl
1823
}
1924

20-
build_py38() {
21-
/opt/python/cp38-cp38/bin/python -m pip install --upgrade pip
22-
/opt/python/cp38-cp38/bin/python -m pip install -r requirements.txt
23-
/opt/python/cp38-cp38/bin/python setup.py bdist_wheel --release --ci
24-
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python/cp38-cp38/lib/python3.8/site-packages/torch/lib:/opt/python/cp38-cp38/lib/python3.8/site-packages/tensorrt/:/usr/local/cuda-11.7/lib64:/usr/local/cuda-11.7/lib64/stubs /opt/python/cp38-cp38/bin/python -m auditwheel repair --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-cp38-cp38-linux_x86_64.whl
25+
py38() {
26+
cd /workspace/project/py
27+
PY_BUILD_CODE=cp38-cp38
28+
PY_VERSION=3.8
29+
PY_NAME=python${PY_VERSION}
30+
PY_DIR=/opt/python/${PY_BUILD_CODE}
31+
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/
32+
${PY_DIR}/bin/python -m pip install --upgrade pip
33+
${PY_DIR}/bin/python -m pip install -r requirements.txt
34+
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel
35+
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci
36+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PY_PKG_DIR}/torch/lib:${PY_PKG_DIR}/tensorrt/:${CUDA_HOME}/lib64:${CUDA_HOME}/lib64/stubs ${PY_DIR}/bin/python -m auditwheel repair $(cat ${PROJECT_DIR}/py/ci/soname_excludes.params) --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-${PY_BUILD_CODE}-linux_x86_64.whl
2537
}
2638

27-
build_py39() {
28-
/opt/python/cp39-cp39/bin/python -m pip install --upgrade pip
29-
/opt/python/cp39-cp39/bin/python -m pip install -r requirements.txt
30-
/opt/python/cp39-cp39/bin/python setup.py bdist_wheel --release --ci
31-
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python/cp39-cp39/lib/python3.8/site-packages/torch/lib:/opt/python/cp39-cp39/lib/python3.9/site-packages/tensorrt/:/usr/local/cuda-11.7/lib64:/usr/local/cuda-11.7/lib64/stubs /opt/python/cp39-cp39/bin/python -m auditwheel repair --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-cp39-cp39-linux_x86_64.whl
39+
py39() {
40+
cd /workspace/project/py
41+
PY_BUILD_CODE=cp39-cp39
42+
PY_VERSION=3.9
43+
PY_NAME=python${PY_VERSION}
44+
PY_DIR=/opt/python/${PY_BUILD_CODE}
45+
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/
46+
${PY_DIR}/bin/python -m pip install --upgrade pip
47+
${PY_DIR}/bin/python -m pip install -r requirements.txt
48+
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel
49+
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci
50+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PY_PKG_DIR}/torch/lib:${PY_PKG_DIR}/tensorrt/:${CUDA_HOME}/lib64:${CUDA_HOME}/lib64/stubs ${PY_DIR}/bin/python -m auditwheel repair $(cat ${PROJECT_DIR}/py/ci/soname_excludes.params) --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-${PY_BUILD_CODE}-linux_x86_64.whl
3251
}
3352

34-
build_py310() {
35-
/opt/python/cp310-cp310/bin/python -m pip install --upgrade pip
36-
/opt/python/cp310-cp310/bin/python -m pip install -r requirements.txt
37-
/opt/python/cp310-cp310/bin/python setup.py bdist_wheel --release --ci
38-
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python/cp310-cp310/lib/python3.8/site-packages/torch/lib:/opt/python/cp310-cp310/lib/python3.8/site-packages/tensorrt/:/usr/local/cuda-11.7/lib64:/usr/local/cuda-11.7/lib64/stubs /opt/python/cp38-cp38/bin/python -m auditwheel repair --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-cp310-cp310-linux_x86_64.whl
53+
py310() {
54+
cd /workspace/project/py
55+
PY_BUILD_CODE=cp310-cp310
56+
PY_VERSION=3.10
57+
PY_NAME=python${PY_VERSION}
58+
PY_DIR=/opt/python/${PY_BUILD_CODE}
59+
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/
60+
${PY_DIR}/bin/python -m pip install --upgrade pip
61+
${PY_DIR}/bin/python -m pip install -r requirements.txt
62+
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel
63+
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci
64+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PY_PKG_DIR}/torch/lib:${PY_PKG_DIR}/tensorrt/:${CUDA_HOME}/lib64:${CUDA_HOME}/lib64/stubs ${PY_DIR}/bin/python -m auditwheel repair $(cat ${PROJECT_DIR}/py/ci/soname_excludes.params) --plat manylinux_2_17_x86_64 dist/torch_tensorrt-*-${PY_BUILD_CODE}-linux_x86_64.whl
3965
}
4066

4167
#build_py311() {
@@ -44,31 +70,42 @@ build_py310() {
4470
# #auditwheel repair --plat manylinux_2_17_x86_64
4571
#}
4672

47-
build_libtorchtrt() {
48-
bazel clean
73+
libtorchtrt() {
74+
cd /workspace/project/py
75+
mkdir -p /workspace/project/py/wheelhouse
76+
PY_BUILD_CODE=cp310-cp310
77+
PY_VERSION=3.10
78+
PY_NAME=python${PY_VERSION}
79+
PY_DIR=/opt/python/${PY_BUILD_CODE}
80+
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/
81+
${PY_DIR}/bin/python -m pip install --upgrade pip
82+
${PY_DIR}/bin/python -m pip install -r requirements.txt
83+
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel
4984
bazel build //:libtorchtrt --platforms //toolchains:ci_rhel_x86_64_linux -c opt --noshow_progress
50-
CUDA_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cuda_version__;print(__cuda_version__)")
51-
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __version__;print(__version__)")
52-
TRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __tensorrt_version__;print(__tensorrt_version__)")
53-
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cudnn_version__;print(__cudnn_version__)")
54-
TORCH_VERSION=$(/opt/python/cp310-cp310/bin/python -c "from torch import __version__;print(__version__.split('+')[0])")
55-
cp ${PROJECT_DIR}/bazel-bin/libtorchtrt.tar.gz ${PROJECT_DIR}/py/dist/libtorchtrt-${TORCHTRT_VERSION}-cudnn${CUDNN_VERSION}-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
85+
CUDA_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cuda_version__;print(__cuda_version__)")
86+
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __version__;print(__version__)")
87+
TRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __tensorrt_version__;print(__tensorrt_version__)")
88+
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)")
89+
TORCH_VERSION=$(${PY_DIR}/bin/python -c "from torch import __version__;print(__version__.split('+')[0])")
90+
cp ${PROJECT_DIR}/bazel-bin/libtorchtrt.tar.gz ${PROJECT_DIR}/py/wheelhouse/libtorchtrt-${TORCHTRT_VERSION}-cudnn${CUDNN_VERSION}-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
5691
}
5792

58-
build_libtorchtrt_pre_cxx11_abi() {
93+
libtorchtrt_pre_cxx11_abi() {
94+
cd /workspace/project/py
95+
mkdir -p /workspace/project/py/wheelhouse
96+
PY_BUILD_CODE=cp310-cp310
97+
PY_VERSION=3.10
98+
PY_NAME=python${PY_VERSION}
99+
PY_DIR=/opt/python/${PY_BUILD_CODE}
100+
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/
101+
${PY_DIR}/bin/python -m pip install --upgrade pip
102+
${PY_DIR}/bin/python -m pip install -r requirements.txt
103+
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel
59104
bazel build //:libtorchtrt --config pre_cxx11_abi --platforms //toolchains:ci_rhel_x86_64_linux -c opt --noshow_progress
60-
CUDA_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cuda_version__;print(__cuda_version__)")
61-
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __version__;print(__version__)")
62-
TRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __tensorrt_version__;print(__tensorrt_version__)")
63-
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cudnn_version__;print(__cudnn_version__)")
64-
TORCH_VERSION=$(/opt/python/cp310-cp310/bin/python -c "from torch import __version__;print(__version__.split('+')[0])")
65-
cp ${PROJECT_DIR}/bazel-bin/libtorchtrt.tar.gz ${PROJECT_DIR}/py/dist/libtorchtrt-${TORCHTRT_VERSION}-pre-cxx11-abi-cudnn${CUDNN_VERSION}-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
66-
}
67-
68-
build_py37
69-
build_py38
70-
build_py39
71-
build_py310
72-
#build_py311
73-
build_libtorchtrt_pre_cxx11_abi
74-
#build_libtorchtrt
105+
CUDA_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cuda_version__;print(__cuda_version__)")
106+
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __version__;print(__version__)")
107+
TRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __tensorrt_version__;print(__tensorrt_version__)")
108+
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)")
109+
TORCH_VERSION=$(${PY_DIR}/bin/python -c "from torch import __version__;print(__version__.split('+')[0])")
110+
cp ${PROJECT_DIR}/bazel-bin/libtorchtrt.tar.gz ${PROJECT_DIR}/py/wheelhouse/libtorchtrt-${TORCHTRT_VERSION}-pre-cxx11-abi-cudnn${CUDNN_VERSION}-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-x86_64-linux.tar.gz
111+
}

0 commit comments

Comments
 (0)