Skip to content

version: TRT upgrade to 9.2 on Linux Testing #2538

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

Merged
merged 12 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/install-torch-tensorrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -eou pipefail
source ${BUILD_ENV_FILE}
${CONDA_RUN} ${PIP_INSTALL_TORCH} torchvision pyyaml
export TRT_VERSION=$(${CONDA_RUN} python -c "import versions; versions.tensorrt_version()")
${CONDA_RUN} python -m pip install /opt/torch-tensorrt-builds/torch_tensorrt*+${CU_VERSION}*.whl tensorrt~=${TRT_VERSION} tensorrt-bindings~=${TRT_VERSION} --extra-index-url=https://pypi.ngc.nvidia.com
${CONDA_RUN} python -m pip install /opt/torch-tensorrt-builds/torch_tensorrt*+${CU_VERSION}*.whl tensorrt~=${TRT_VERSION} tensorrt-bindings~=${TRT_VERSION} --extra-index-url=https://pypi.nvidia.com

echo -e "Running test script";
echo -e "Running test script";
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ These are the following dependencies used to verify the testcases. Torch-TensorR
- Libtorch 2.3.0.dev (latest nightly) (built with CUDA 12.1)
- CUDA 12.1
- cuDNN 8.9.5
- TensorRT 8.6.1
- TensorRT 9.2.0

## Prebuilt Binaries and Wheel files

Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ http_archive(
http_archive(
name = "tensorrt",
build_file = "@//third_party/tensorrt/archive:BUILD",
sha256 = "0f8157a5fc5329943b338b893591373350afa90ca81239cdadd7580cd1eba254",
strip_prefix = "TensorRT-8.6.1.6",
sha256 = "3dd505a9e0d0adf9257080b543f51d91df736dbd1f75417b9dde1a7b7a5d87f2",
strip_prefix = "tensorrt-9.2.0.5",
urls = [
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/tars/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz",
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/9.2.0/tensorrt-9.2.0.5.linux.x86_64-gnu.cuda-12.2.tar.gz",
],
)

Expand Down
2 changes: 1 addition & 1 deletion dev_dep_versions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__: "2.3.0.dev0"
__cuda_version__: "12.1"
__cudnn_version__: "8.9"
__tensorrt_version__: "8.6"
__tensorrt_version__: "9.2.0.post12.dev5"
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Note: By default the container uses the `pre-cxx11-abi` version of Torch + Torch

### Instructions

- The example below uses CUDNN 8.9 and TensorRT 8.6
- The example below uses CUDNN 8.9 and TensorRT 9.2
- See <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a> for a list of current default dependencies.

> From root of Torch-TensorRT repo

Build:
```
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=8.6 --build-arg CUDNN_VERSION=8.9 -f docker/Dockerfile -t torch_tensorrt:latest .
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=9.2 --build-arg CUDNN_VERSION=8.9 -f docker/Dockerfile -t torch_tensorrt:latest .
```

Run:
Expand Down
24 changes: 22 additions & 2 deletions packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,35 @@

# Install dependencies
python3 -m pip install pyyaml
TRT_VERSION=$(python3 -c "import versions; versions.tensorrt_version()")
CUDNN_VERSION=$(python3 -c "import versions; print(versions.__cudnn_version__.split('.')[0])")
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
yum check-update
yum install -y ninja-build gettext tensorrt-${TRT_VERSION}.*
yum install -y ninja-build gettext libcudnn${CUDNN_VERSION} libcudnn${CUDNN_VERSION}-devel
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 \
&& mv bazelisk-linux-amd64 /usr/bin/bazel \
&& chmod +x /usr/bin/bazel

wget https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/9.2.0/tensorrt-9.2.0.5.linux.x86_64-gnu.cuda-12.2.tar.gz
mkdir -p /usr/tensorrt
tar -xzvf tensorrt-9.2.0.5.linux.x86_64-gnu.cuda-12.2.tar.gz -C /usr/tensorrt --strip-components=1
mkdir -p /usr/lib
cp /usr/tensorrt/lib/* /usr/lib/ || :
mkdir -p /usr/lib64
cp /usr/tensorrt/lib/* /usr/lib64/ || :
mkdir -p /usr/include
cp /usr/tensorrt/include/* /usr/include/ || :

mkdir -p /usr/lib/x86_64-linux-gnu
cp /usr/tensorrt/targets/x86_64-linux-gnu/lib/* /usr/lib/x86_64-linux-gnu/ || :
mkdir -p /usr/include/x86_64-linux-gnu
cp /usr/tensorrt/targets/x86_64-linux-gnu/include/* /usr/include/x86_64-linux-gnu/ || :

rm tensorrt-9.2.0.5.linux.x86_64-gnu.cuda-12.2.tar.gz
rm -rf /usr/tensorrt

export TORCH_BUILD_NUMBER=$(python -c "import torch, urllib.parse as ul; print(ul.quote_plus(torch.__version__))")

cat toolchains/ci_workspaces/WORKSPACE.x86_64.release.rhel.tmpl | envsubst > WORKSPACE
export CI_BUILD=1

python -m pip config set global.extra-index-url "https://pypi.nvidia.com"
4 changes: 3 additions & 1 deletion py/ci/soname_excludes.params
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@
--exclude libcudart.so.11
--exclude libcudart.so.11.7.60
--exclude libnvrtc.so.11.2
--exclude libnvinfer_plugin.so.9
--exclude libnvinfer_plugin.so.8
--exclude libcublas.so.11
--exclude libcuda.so.1
--exclude libcuda.so.515
--exclude libcublasLt.so.11
--exclude libnvinfer.so.9
--exclude libnvinfer.so.8
--exclude libcudnn.so.8
--exclude libcublas.so.12
--exclude libcublasLt.so.12
--exclude libcublas.so.12.1.3.1
--exclude libcublasLt.so.12.1.3.1
--exclude libcudart.so.11.8.89
--exclude libcudart.so.11
--exclude libcudart.so.11
4 changes: 2 additions & 2 deletions py/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ pybind11==2.6.2
--extra-index-url https://download.pytorch.org/whl/nightly/cu121
torch>=2.3.0.dev,<2.4.0
torchvision>=0.18.0.dev,<0.19.0
--extra-index-url https://pypi.ngc.nvidia.com
tensorrt==8.6.1
--extra-index-url https://pypi.nvidia.com
tensorrt==9.2.0.post12.dev5
pyyaml
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ requires = [
"cffi>=1.15.1",
"typing-extensions>=4.7.0",
"future>=0.18.3",
"tensorrt>=8.6,<8.7",
"torch >=2.3.0.dev,<2.4.0",
"tensorrt==9.2.0.post12.dev5",
"pybind11==2.6.2",
"numpy",
]
Expand Down Expand Up @@ -42,7 +42,7 @@ requires-python = ">=3.8"
keywords = ["pytorch", "torch", "tensorrt", "trt", "ai", "artificial intelligence", "ml", "machine learning", "dl", "deep learning", "compiler", "dynamo", "torchscript", "inference"]
dependencies = [
"torch >=2.3.0.dev,<2.4.0",
"tensorrt>=8.6,<8.7",
"tensorrt==9.2.0.post12.dev5",
"packaging>=23",
"numpy",
"typing-extensions>=4.7.0",
Expand Down
Binary file modified tests/py/ts/models/hw_compat.ts
Binary file not shown.
4 changes: 2 additions & 2 deletions third_party/cudnn/local/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ config_setting(

cc_library(
name = "cudnn_headers",
hdrs = ["include/cudnn.h"] + glob([
"include/cudnn_*.h",
hdrs = glob([
"include/cudnn*.h",
]),
includes = ["include/"],
visibility = ["//visibility:private"],
Expand Down
4 changes: 1 addition & 3 deletions third_party/tensorrt/local/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ cc_library(
"include/aarch64-linux-gnu/NvInferPluginUtils.h",
],
),
":ci_rhel_x86_64_linux": [
"include/NvUtils.h",
] + glob(
":ci_rhel_x86_64_linux": glob(
[
"include/NvInfer*.h",
],
Expand Down
4 changes: 2 additions & 2 deletions toolchains/legacy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires = [
"cffi>=1.15.1",
"typing-extensions>=4.7.0",
"future>=0.18.3",
"tensorrt>=8.6,<8.7",
"tensorrt==9.2.0.post12.dev5",
"torch>=1.13.0,<2.0",
"pybind11==2.6.2",
"numpy",
Expand Down Expand Up @@ -42,7 +42,7 @@ requires-python = ">=3.8"
keywords = ["pytorch", "torch", "tensorrt", "trt", "ai", "artificial intelligence", "ml", "machine learning", "dl", "deep learning", "compiler", "dynamo", "torchscript", "inference"]
dependencies = [
"torch>=1.13.0,<2.0",
"tensorrt>=8.6,<8.7",
"tensorrt==9.2.0.post12.dev5",
"packaging>=23",
"numpy",
"typing-extensions>=4.7.0",
Expand Down