-
Notifications
You must be signed in to change notification settings - Fork 364
feat: build manylinux compatible builds #1527
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
7c946ff
c808089
31d0a0a
ac3c596
35b97dc
59df0fb
a920e21
6891c24
50e3193
3e787c7
a7c17b7
5b64012
f68e93d
3a49585
eeb4e1c
81f3f8e
d67eb13
c8a8267
74f9506
96620d5
ac96016
e3202e9
18dd56c
478d2a1
a780c45
b567f3a
fabe47d
fc56c3d
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,5 @@ | ||
py37 | ||
py38 | ||
py39 | ||
py310 | ||
libtorchtrt_pre_cxx11_abi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,40 +2,66 @@ | |
|
||
# Example usage: docker run -it -v$(pwd)/..:/workspace/TRTorch build_trtorch_wheel /bin/bash /workspace/TRTorch/py/build_whl.sh | ||
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. Replace trtorch references here |
||
|
||
cd /workspace/project/py | ||
|
||
export CXX=g++ | ||
export CUDA_HOME=/usr/local/cuda-11.7 | ||
PROJECT_DIR=/workspace/project | ||
export PROJECT_DIR=/workspace/project | ||
|
||
cp -r $CUDA_HOME /usr/local/cuda | ||
|
||
build_py37() { | ||
/opt/python/cp37-cp37m/bin/python -m pip install --upgrade pip | ||
/opt/python/cp37-cp37m/bin/python -m pip install -r requirements.txt | ||
/opt/python/cp37-cp37m/bin/python setup.py bdist_wheel --release --ci | ||
#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 | ||
py37() { | ||
cd /workspace/project/py | ||
PY_BUILD_CODE=cp37-cp37m | ||
PY_VERSION=3.7 | ||
PY_NAME=python${PY_VERSION} | ||
PY_DIR=/opt/python/${PY_BUILD_CODE} | ||
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/ | ||
${PY_DIR}/bin/python -m pip install --upgrade pip | ||
${PY_DIR}/bin/python -m pip install -r requirements.txt | ||
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel | ||
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci | ||
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 | ||
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 you let me know what is happening here with this soname_excludes ? |
||
} | ||
|
||
build_py38() { | ||
/opt/python/cp38-cp38/bin/python -m pip install --upgrade pip | ||
/opt/python/cp38-cp38/bin/python -m pip install -r requirements.txt | ||
/opt/python/cp38-cp38/bin/python setup.py bdist_wheel --release --ci | ||
#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 | ||
py38() { | ||
cd /workspace/project/py | ||
PY_BUILD_CODE=cp38-cp38 | ||
PY_VERSION=3.8 | ||
PY_NAME=python${PY_VERSION} | ||
PY_DIR=/opt/python/${PY_BUILD_CODE} | ||
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/ | ||
${PY_DIR}/bin/python -m pip install --upgrade pip | ||
${PY_DIR}/bin/python -m pip install -r requirements.txt | ||
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel | ||
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci | ||
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 | ||
} | ||
|
||
build_py39() { | ||
/opt/python/cp39-cp39/bin/python -m pip install --upgrade pip | ||
/opt/python/cp39-cp39/bin/python -m pip install -r requirements.txt | ||
/opt/python/cp39-cp39/bin/python setup.py bdist_wheel --release --ci | ||
#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 | ||
py39() { | ||
cd /workspace/project/py | ||
PY_BUILD_CODE=cp39-cp39 | ||
PY_VERSION=3.9 | ||
PY_NAME=python${PY_VERSION} | ||
PY_DIR=/opt/python/${PY_BUILD_CODE} | ||
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/ | ||
${PY_DIR}/bin/python -m pip install --upgrade pip | ||
${PY_DIR}/bin/python -m pip install -r requirements.txt | ||
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel | ||
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci | ||
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 | ||
} | ||
|
||
build_py310() { | ||
/opt/python/cp310-cp310/bin/python -m pip install --upgrade pip | ||
/opt/python/cp310-cp310/bin/python -m pip install -r requirements.txt | ||
/opt/python/cp310-cp310/bin/python setup.py bdist_wheel --release --ci | ||
#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 | ||
py310() { | ||
cd /workspace/project/py | ||
PY_BUILD_CODE=cp310-cp310 | ||
PY_VERSION=3.10 | ||
PY_NAME=python${PY_VERSION} | ||
PY_DIR=/opt/python/${PY_BUILD_CODE} | ||
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/ | ||
${PY_DIR}/bin/python -m pip install --upgrade pip | ||
${PY_DIR}/bin/python -m pip install -r requirements.txt | ||
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel | ||
${PY_DIR}/bin/python setup.py bdist_wheel --release --ci | ||
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 | ||
} | ||
|
||
#build_py311() { | ||
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. Should we remove this and add later ? |
||
|
@@ -44,31 +70,42 @@ build_py310() { | |
# #auditwheel repair --plat manylinux_2_17_x86_64 | ||
#} | ||
|
||
build_libtorchtrt() { | ||
bazel clean | ||
libtorchtrt() { | ||
cd /workspace/project/py | ||
mkdir -p /workspace/project/py/wheelhouse | ||
PY_BUILD_CODE=cp310-cp310 | ||
PY_VERSION=3.10 | ||
PY_NAME=python${PY_VERSION} | ||
PY_DIR=/opt/python/${PY_BUILD_CODE} | ||
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/ | ||
${PY_DIR}/bin/python -m pip install --upgrade pip | ||
${PY_DIR}/bin/python -m pip install -r requirements.txt | ||
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel | ||
bazel build //:libtorchtrt --platforms //toolchains:ci_rhel_x86_64_linux -c opt --noshow_progress | ||
CUDA_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cuda_version__;print(__cuda_version__)") | ||
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __version__;print(__version__)") | ||
TRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __tensorrt_version__;print(__tensorrt_version__)") | ||
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cudnn_version__;print(__cudnn_version__)") | ||
TORCH_VERSION=$(/opt/python/cp310-cp310/bin/python -c "from torch import __version__;print(__version__.split('+')[0])") | ||
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 | ||
CUDA_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cuda_version__;print(__cuda_version__)") | ||
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __version__;print(__version__)") | ||
TRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __tensorrt_version__;print(__tensorrt_version__)") | ||
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)") | ||
TORCH_VERSION=$(${PY_DIR}/bin/python -c "from torch import __version__;print(__version__.split('+')[0])") | ||
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 | ||
peri044 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
build_libtorchtrt_pre_cxx11_abi() { | ||
libtorchtrt_pre_cxx11_abi() { | ||
cd /workspace/project/py | ||
mkdir -p /workspace/project/py/wheelhouse | ||
PY_BUILD_CODE=cp310-cp310 | ||
PY_VERSION=3.10 | ||
PY_NAME=python${PY_VERSION} | ||
PY_DIR=/opt/python/${PY_BUILD_CODE} | ||
PY_PKG_DIR=${PY_DIR}/lib/${PY_NAME}/site-packages/ | ||
${PY_DIR}/bin/python -m pip install --upgrade pip | ||
${PY_DIR}/bin/python -m pip install -r requirements.txt | ||
${PY_DIR}/bin/python -m pip install setuptools wheel auditwheel | ||
bazel build //:libtorchtrt --config pre_cxx11_abi --platforms //toolchains:ci_rhel_x86_64_linux -c opt --noshow_progress | ||
CUDA_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cuda_version__;print(__cuda_version__)") | ||
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __version__;print(__version__)") | ||
TRT_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __tensorrt_version__;print(__tensorrt_version__)") | ||
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py/torch_tensorrt && python3 -c "from _version import __cudnn_version__;print(__cudnn_version__)") | ||
TORCH_VERSION=$(/opt/python/cp310-cp310/bin/python -c "from torch import __version__;print(__version__.split('+')[0])") | ||
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 | ||
} | ||
|
||
build_py37 | ||
build_py38 | ||
build_py39 | ||
build_py310 | ||
#build_py311 | ||
build_libtorchtrt_pre_cxx11_abi | ||
#build_libtorchtrt | ||
CUDA_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cuda_version__;print(__cuda_version__)") | ||
TORCHTRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __version__;print(__version__)") | ||
TRT_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __tensorrt_version__;print(__tensorrt_version__)") | ||
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)") | ||
TORCH_VERSION=$(${PY_DIR}/bin/python -c "from torch import __version__;print(__version__.split('+')[0])") | ||
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 | ||
} |
Uh oh!
There was an error while loading. Please reload this page.