Skip to content

Commit 8c71910

Browse files
committed
fix: Upgrade main to TRT 8.6, CUDA 11.8, Torch Dev
- Upgrade versions, make required code edits for functionality and coverage for tests and CI
1 parent 2dc510b commit 8c71910

File tree

10 files changed

+35
-37
lines changed

10 files changed

+35
-37
lines changed

.circleci/config.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,19 @@ commands:
269269
parameters:
270270
torch-build:
271271
type: string
272-
default: "2.1.0.dev20230421+cu118"
272+
default: "2.1.0.dev20230419+cu118"
273+
torchvision-build:
274+
type: string
275+
default: "0.16.0.dev20230419+cu118"
273276
torch-build-index:
274277
type: string
275-
default: "https://download.pytorch.org/whl/cu118"
278+
default: "https://download.pytorch.org/whl/nightly/cu118"
276279
steps:
277280
- run:
278281
name: Install Torch
279282
command: |
280283
pip3 install --upgrade pip
281-
pip3 install torch==<< parameters.torch-build >> torchvision torchaudio --extra-index-url << parameters.torch-build-index >>
284+
pip3 install torch==<< parameters.torch-build >> torchvision==<< parameters.torchvision-build >> --extra-index-url << parameters.torch-build-index >>
282285
283286
build-py:
284287
description: "Build the torch-tensorrt python release (pre-cxx11-abi)"
@@ -1205,16 +1208,16 @@ parameters:
12051208
# Nightly platform config
12061209
torch-build:
12071210
type: string
1208-
default: "2.1.0.dev20230421+cu118"
1211+
default: "2.1.0.dev20230419+cu118"
12091212
torch-build-index:
12101213
type: string
1211-
default: "https://download.pytorch.org/whl/cu118"
1214+
default: "https://download.pytorch.org/whl/nightly/cu118"
12121215
torch-build-legacy:
12131216
type: string
1214-
default: "1.13.1+cu118"
1217+
default: "1.13.1+cu117"
12151218
torch-build-index-legacy:
12161219
type: string
1217-
default: "https://download.pytorch.org/whl/cu118"
1220+
default: "https://download.pytorch.org/whl/cu117"
12181221
cudnn-version:
12191222
type: string
12201223
default: "8.5.0.96"

README.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ In the case of building on top of a custom base container, you first must determ
3131
version of the PyTorch C++ ABI. If your source of PyTorch is pytorch.org, likely this is the pre-cxx11-abi in which case you must modify `//docker/dist-build.sh` to not build the
3232
C++11 ABI version of Torch-TensorRT.
3333

34-
You can then build the container using:
35-
36-
37-
```bash
38-
docker build --build-arg BASE_IMG=<IMAGE> -f docker/Dockerfile -t torch_tensorrt:latest .
39-
```
34+
You can then build the container using the build command in the [docker README](docker/README.md#instructions)
4035

4136
If you would like to build outside a docker container, please follow the section [Compiling Torch-TensorRT](#compiling-torch-tensorrt)
4237

@@ -121,10 +116,10 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd
121116
These are the following dependencies used to verify the testcases. Torch-TensorRT can work with other versions, but the tests are not guaranteed to pass.
122117

123118
- Bazel 5.2.0
124-
- Libtorch 2.1.0.dev20230314 (built with CUDA 11.7)
125-
- CUDA 11.7
119+
- Libtorch 2.1.0.dev20230419 (built with CUDA 11.8)
120+
- CUDA 11.8
126121
- cuDNN 8.5.0
127-
- TensorRT 8.5.1.7
122+
- TensorRT 8.6.0
128123

129124
## Prebuilt Binaries and Wheel files
130125

WORKSPACE

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ new_local_repository(
5151
http_archive(
5252
name = "libtorch",
5353
build_file = "@//third_party/libtorch:BUILD",
54-
sha256 = "486aeb5cf498f3df8713a96a0d178660828fc579e740c39b054bef0adef6315b",
54+
sha256 = "1a526a9cd19c1015674d26921dbb94bcd2d632a6f9c431a21c43f4e24768d834",
5555
strip_prefix = "libtorch",
56-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
56+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230419%2Bcu118.zip"],
5757
)
5858

5959
http_archive(
6060
name = "libtorch_pre_cxx11_abi",
6161
build_file = "@//third_party/libtorch:BUILD",
62-
sha256 = "03b1c29a2a2e412ab6cdb957b5fd48a64aeed1b3551ee7679908c4ac177b89ab",
62+
sha256 = "60c5912a5085a6a7073b3804b10d41d6cc054693bbeb7a45e0247050c2837bac",
6363
strip_prefix = "libtorch",
64-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
64+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230419%2Bcu118.zip"],
6565
)
6666

6767
# Download these tarballs manually from the NVIDIA website

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Base image starts with CUDA
2-
ARG BASE_IMG=nvidia/cuda:11.7.1-devel-ubuntu22.04
2+
ARG BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04
33
FROM ${BASE_IMG} as base
44

55
ARG TENSORRT_VERSION

docker/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* The `Dockerfile` currently uses <a href="https://github.com/bazelbuild/bazelisk">Bazelisk</a> to select the Bazel version, and uses the exact library versions of Torch and CUDA listed in <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a>.
66
* The desired versions of CUDNN and TensorRT must be specified as build-args, with major, minor, and patch versions as in: `--build-arg TENSORRT_VERSION=a.b.c --build-arg CUDNN_VERSION=x.y.z`
7-
* [**Optional**] The desired base image be changed by explicitly setting a base image, as in `--build-arg BASE_IMG=nvidia/cuda:11.7.1-devel-ubuntu22.04`, though this is optional
7+
* [**Optional**] The desired base image be changed by explicitly setting a base image, as in `--build-arg BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04`, though this is optional
88
* [**Optional**] Additionally, the desired Python version can be changed by explicitly setting a version, as in `--build-arg PYTHON_VERSION=3.10`, though this is optional as well.
99

1010
* This `Dockerfile` installs `pre-cxx11-abi` versions of Pytorch and builds Torch-TRT using `pre-cxx11-abi` libtorch as well.
@@ -17,14 +17,14 @@ Note: By default the container uses the `pre-cxx11-abi` version of Torch + Torch
1717

1818
### Instructions
1919

20-
- The example below uses CUDNN 8.5.0 and TensorRT 8.5.1
20+
- The example below uses CUDNN 8.5.0 and TensorRT 8.6.0
2121
- See <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a> for a list of current default dependencies.
2222

2323
> From root of Torch-TensorRT repo
2424
2525
Build:
2626
```
27-
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=8.5.1 --build-arg CUDNN_VERSION=8.5.0 -f docker/Dockerfile -t torch_tensorrt:latest .
27+
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=8.6.0 --build-arg CUDNN_VERSION=8.5.0 -f docker/Dockerfile -t torch_tensorrt:latest .
2828
```
2929

3030
Run:

py/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ numpy
22
packaging
33
pybind11==2.6.2
44
--extra-index-url https://download.pytorch.org/whl/nightly/cu118
5-
torch==2.1.0.dev20230421+cu118
6-
torchvision==0.16.0.dev20230421+cu118
5+
torch==2.1.0.dev20230419+cu118
6+
torchvision==0.16.0.dev20230419+cu118
77
--extra-index-url https://pypi.ngc.nvidia.com
88
tensorrt==8.6.0

py/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def run(self):
380380
long_description=long_description,
381381
ext_modules=ext_modules,
382382
install_requires=[
383-
"torch==2.0.0",
383+
"torch>=1.13.1",
384384
],
385385
setup_requires=[],
386386
cmdclass={

py/versions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__version__ = "1.4.0.dev0"
2-
__cuda_version__ = "11.7"
2+
__cuda_version__ = "11.8"
33
__cudnn_version__ = "8.5"
4-
__tensorrt_version__ = "8.5"
4+
__tensorrt_version__ = "8.6"

toolchains/ci_workspaces/WORKSPACE.x86_64.release.rhel

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ new_local_repository(
5656
http_archive(
5757
name = "libtorch",
5858
build_file = "@//third_party/libtorch:BUILD",
59-
sha256 = "486aeb5cf498f3df8713a96a0d178660828fc579e740c39b054bef0adef6315b",
59+
sha256 = "1a526a9cd19c1015674d26921dbb94bcd2d632a6f9c431a21c43f4e24768d834",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230419%2Bcu118.zip"],
6262
)
6363

6464
http_archive(
6565
name = "libtorch_pre_cxx11_abi",
6666
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "03b1c29a2a2e412ab6cdb957b5fd48a64aeed1b3551ee7679908c4ac177b89ab",
67+
sha256 = "60c5912a5085a6a7073b3804b10d41d6cc054693bbeb7a45e0247050c2837bac",
6868
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
69+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230419%2Bcu118.zip"],
7070
)
7171

7272
####################################################################################

toolchains/ci_workspaces/WORKSPACE.x86_64.release.ubuntu

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ new_local_repository(
5656
http_archive(
5757
name = "libtorch",
5858
build_file = "@//third_party/libtorch:BUILD",
59-
sha256 = "486aeb5cf498f3df8713a96a0d178660828fc579e740c39b054bef0adef6315b",
59+
sha256 = "1a526a9cd19c1015674d26921dbb94bcd2d632a6f9c431a21c43f4e24768d834",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230419%2Bcu118.zip"],
6262
)
6363

6464
http_archive(
6565
name = "libtorch_pre_cxx11_abi",
6666
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "03b1c29a2a2e412ab6cdb957b5fd48a64aeed1b3551ee7679908c4ac177b89ab",
67+
sha256 = "60c5912a5085a6a7073b3804b10d41d6cc054693bbeb7a45e0247050c2837bac",
6868
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
69+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230419%2Bcu118.zip"],
7070
)
7171

7272
####################################################################################

0 commit comments

Comments
 (0)