Skip to content

Commit 23038f2

Browse files
committed
chore: Upgrade to CUDA 12.1 and CuDNN 8.9
- Upgrade CUDA version across CI, dependencies, and build systems - Upgrade versions for Torch, CuDNN, TensorRT, and other dependencies in accordance with new CUDA version 12.1 - Upgrade Torch nightly date to latest available
1 parent 1735088 commit 23038f2

File tree

13 files changed

+65
-73
lines changed

13 files changed

+65
-73
lines changed

.circleci/config.yml

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,9 @@ commands:
9292
key: cmake-<< parameters.cache-key >>-<< parameters.version >>
9393
paths:
9494
- << parameters.install-dir >>
95-
uninstall-cuda:
96-
description: "Uninstall CUDA-11.4"
97-
steps:
98-
- run:
99-
name: "Uninstall CUDA-11.4"
100-
command: |
101-
sudo apt-get --purge remove "cuda*" "nsight*"
102-
sudo apt-get --purge remove "*nvidia*"
10395

10496
install-cudnn:
105-
description: "Install CUDNN 8.8.0"
97+
description: "Install CUDNN 8.9.1"
10698
parameters:
10799
os:
108100
type: string
@@ -112,10 +104,10 @@ commands:
112104
default: "x86_64"
113105
cudnn-version:
114106
type: string
115-
default: "8.8.0.121"
107+
default: "8.9.1.23"
116108
cuda-version:
117109
type: string
118-
default: "cuda11.8"
110+
default: "cuda12.1"
119111
steps:
120112
- run:
121113
name: Install CUDNN
@@ -149,13 +141,13 @@ commands:
149141
default: "amd64"
150142
cuda-pkg-name:
151143
type: string
152-
default: "cuda-toolkit-11-8"
144+
default: "cuda-toolkit-12-1"
153145
cuda-pkg-version:
154146
type: string
155-
default: "11-8"
147+
default: "12-1"
156148
cuda-version:
157149
type: string
158-
default: "11.8.0"
150+
default: "12.1.1"
159151
steps:
160152
- run:
161153
name: Install CUDA
@@ -188,19 +180,19 @@ commands:
188180
default: "amd64"
189181
cuda-pkg-name:
190182
type: string
191-
default: "cuda-toolkit-11-8"
183+
default: "cuda-toolkit-12-1"
192184
cuda-pkg-version:
193185
type: string
194-
default: "11-8"
186+
default: "12-1"
195187
cuda-version:
196188
type: string
197-
default: "11.8.0"
189+
default: "12.1.1"
198190
cuda-string-version:
199191
type: string
200-
default: "cuda11.8"
192+
default: "cuda12.1"
201193
cudnn-version:
202194
type: string
203-
default: "8.8.0.121"
195+
default: "8.9.1.23"
204196
trt-version-short:
205197
type: string
206198
default: "8.6.1"
@@ -252,7 +244,7 @@ commands:
252244
default: "8.6.1"
253245
cudnn-version-long:
254246
type: string
255-
default: "8.8.0.121"
247+
default: "8.9.1.23"
256248
steps:
257249
- run:
258250
name: Set up python environment
@@ -261,21 +253,21 @@ commands:
261253
pip3 install wheel setuptools
262254
pip3 install nvidia-pyindex
263255
pip3 install tabulate
264-
pip3 install tensorrt==<< parameters.trt-version-long >> nvidia-cudnn-cu11==<< parameters.cudnn-version-long >>
256+
pip3 install tensorrt==<< parameters.trt-version-long >> nvidia-cudnn-cu12==<< parameters.cudnn-version-long >>
265257
pip3 install pytest parameterized expecttest nox
266258
267259
install-torch-from-index:
268260
description: "Install Pytorch"
269261
parameters:
270262
torch-build:
271263
type: string
272-
default: "2.1.0.dev20230605+cu118"
264+
default: "2.1.0.dev20230613+cu121"
273265
torchvision-build:
274266
type: string
275-
default: "0.16.0.dev20230605+cu118"
267+
default: "0.16.0.dev20230613+cu121"
276268
torch-build-index:
277269
type: string
278-
default: "https://download.pytorch.org/whl/nightly/cu118"
270+
default: "https://download.pytorch.org/whl/nightly/cu121"
279271
steps:
280272
- run:
281273
name: Install Torch
@@ -293,7 +285,7 @@ commands:
293285
- run:
294286
name: Build torch-tensorrt python release (pre-cxx11-abi)
295287
command: |
296-
export CUDA_HOME=/usr/local/cuda-11.8/
288+
export CUDA_HOME=/usr/local/cuda-12.1/
297289
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
298290
cd py
299291
python3 -m pip install wheel setuptools
@@ -313,7 +305,7 @@ commands:
313305
- run:
314306
name: Build torch-tensorrt python legacy release (pre-cxx11-abi)
315307
command: |
316-
export CUDA_HOME=/usr/local/cuda-11.8/
308+
export CUDA_HOME=/usr/local/cuda-12.1/
317309
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
318310
cd py
319311
python3 -m pip install wheel setuptools
@@ -345,7 +337,7 @@ commands:
345337
- run:
346338
name: Build torch-tensorrt python release package
347339
command: |
348-
export CUDA_HOME=/usr/local/cuda-11.8/
340+
export CUDA_HOME=/usr/local/cuda-12.1/
349341
cd ~/project/py
350342
python3 setup.py bdist_wheel --use-cxx11-abi --release
351343
python3 setup.py install --use-cxx11-abi --release
@@ -357,7 +349,7 @@ commands:
357349
- run:
358350
name: Build torch-tensorrt python package
359351
command: |
360-
export CUDA_HOME=/usr/local/cuda-11.8/
352+
export CUDA_HOME=/usr/local/cuda-12.1/
361353
cd ~/project/py
362354
python3 setup.py bdist_wheel --use-cxx11-abi
363355
python3 setup.py install --use-cxx11-abi
@@ -375,7 +367,7 @@ commands:
375367
- run:
376368
name: Build torch-tensorrt python release with only the fx backend
377369
command: |
378-
export CUDA_HOME=/usr/local/cuda-11.8/
370+
export CUDA_HOME=/usr/local/cuda-12.1/
379371
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
380372
cd py
381373
python3 -m pip install wheel setuptools
@@ -447,7 +439,7 @@ commands:
447439
name: Build torch-tensorrt library with CMake
448440
command: |
449441
mkdir build
450-
export PATH=$PATH:/usr/local/cuda-11.8/bin
442+
export PATH=$PATH:/usr/local/cuda-12.1/bin
451443
~/cmake/bin/cmake -S. -Bbuild \
452444
-DCMAKE_MODULE_PATH=cmake/Module \
453445
-DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
@@ -499,7 +491,7 @@ commands:
499491
name: Run core / C++ tests
500492
no_output_timeout: 15m
501493
environment:
502-
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-11.8/lib64/:$LD_LIBRARY_PATH"
494+
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-12.1/lib64/:$LD_LIBRARY_PATH"
503495
command: |
504496
set -e
505497
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
@@ -529,7 +521,7 @@ commands:
529521
environment:
530522
USE_HOST_DEPS: "1"
531523
PYT_PATH: "/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/"
532-
LD_LIBRARY_PATH: "/usr/lib/x86_64-linux-gnu/:/usr/local/cuda-11.8/lib64/:$LD_LIBRARY_PATH"
524+
LD_LIBRARY_PATH: "/usr/lib/x86_64-linux-gnu/:/usr/local/cuda-12.1/lib64/:$LD_LIBRARY_PATH"
533525
command: |
534526
set -e
535527
mkdir -p /tmp/artifacts/test_results
@@ -819,7 +811,7 @@ jobs:
819811
type: boolean
820812
default: false
821813
machine:
822-
image: linux-cuda-11:2023.02.1
814+
image: linux-cuda-12:2023.05.1
823815
resource_class: gpu.nvidia.small
824816
steps:
825817
- checkout
@@ -1352,13 +1344,13 @@ parameters:
13521344
# Nightly platform config
13531345
torch-build:
13541346
type: string
1355-
default: "2.1.0.dev20230605+cu118"
1347+
default: "2.1.0.dev20230613+cu121"
13561348
torchvision-build:
13571349
type: string
1358-
default: "0.16.0.dev20230605+cu118"
1350+
default: "0.16.0.dev20230613+cu121"
13591351
torch-build-index:
13601352
type: string
1361-
default: "https://download.pytorch.org/whl/nightly/cu118"
1353+
default: "https://download.pytorch.org/whl/nightly/cu121"
13621354
torch-build-legacy:
13631355
type: string
13641356
default: "1.13.1+cu117"
@@ -1373,7 +1365,7 @@ parameters:
13731365
default: true
13741366
cudnn-version:
13751367
type: string
1376-
default: "8.8.0.121"
1368+
default: "8.9.1.23"
13771369
trt-version-short:
13781370
type: string
13791371
default: "8.6.1"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd
116116
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.
117117

118118
- Bazel 5.2.0
119-
- Libtorch 2.1.0.dev20230605 (built with CUDA 11.8)
120-
- CUDA 11.8
121-
- cuDNN 8.8.0
119+
- Libtorch 2.1.0.dev20230613 (built with CUDA 12.1)
120+
- CUDA 12.1
121+
- cuDNN 8.9.1
122122
- TensorRT 8.6.1
123123

124124
## Prebuilt Binaries and Wheel files

WORKSPACE

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local_repository(
4141
new_local_repository(
4242
name = "cuda",
4343
build_file = "@//third_party/cuda:BUILD",
44-
path = "/usr/local/cuda-11.8/",
44+
path = "/usr/local/cuda-12.1/",
4545
)
4646

4747
#############################################################################################################
@@ -51,17 +51,17 @@ new_local_repository(
5151
http_archive(
5252
name = "libtorch",
5353
build_file = "@//third_party/libtorch:BUILD",
54-
sha256 = "999becce82b73e566d0ffe010cd21fea8cf3a33f90f09dcc6b01150b820ae063",
54+
sha256 = "1c3712b3b1de34e9989549f53675b557f6f0ca0b800ccbbc80c941af68abcc65",
5555
strip_prefix = "libtorch",
56-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230605%2Bcu118.zip"],
56+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230613%2Bcu121.zip"],
5757
)
5858

5959
http_archive(
6060
name = "libtorch_pre_cxx11_abi",
6161
build_file = "@//third_party/libtorch:BUILD",
62-
sha256 = "786cc728c63ea69c40bd8fb535cf8e5e1dfff1d43eaad3eb5256b9ed89c1b268",
62+
sha256 = "6bbb53f2f9533804175a0d2eeae5093ee1907158a9ec75c7fb9d10e2103d5df5",
6363
strip_prefix = "libtorch",
64-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230605%2Bcu118.zip"],
64+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230613%2Bcu121.zip"],
6565
)
6666

6767
# Download these tarballs manually from the NVIDIA website
@@ -71,20 +71,20 @@ http_archive(
7171
http_archive(
7272
name = "cudnn",
7373
build_file = "@//third_party/cudnn/archive:BUILD",
74-
sha256 = "36fff137153ef73e6ee10bfb07f4381240a86fb9fb78ce372414b528cbab2293",
75-
strip_prefix = "cudnn-linux-x86_64-8.8.0.121_cuda11-archive",
74+
sha256 = "35163c5c542be0c511738b27e25235193cbeedc5e0e006e44b1cdeaf1922e83e",
75+
strip_prefix = "cudnn-linux-x86_64-8.9.1.23_cuda12-archive",
7676
urls = [
77-
"https://developer.download.nvidia.com/compute/cudnn/secure/8.8.0/local_installers/11.8/cudnn-linux-x86_64-8.8.0.121_cuda11-archive.tar.xz",
77+
"https://developer.nvidia.com/downloads/compute/cudnn/secure/8.9.1/local_installers/12.x/cudnn-linux-x86_64-8.9.1.23_cuda12-archive.tar.xz",
7878
],
7979
)
8080

8181
http_archive(
8282
name = "tensorrt",
8383
build_file = "@//third_party/tensorrt/archive:BUILD",
84-
sha256 = "15bfe6053d45feec45ecc7123a9106076b0b43fa0435f242d89dca0778337759",
84+
sha256 = "0f8157a5fc5329943b338b893591373350afa90ca81239cdadd7580cd1eba254",
8585
strip_prefix = "TensorRT-8.6.1.6",
8686
urls = [
87-
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/tars/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz",
87+
"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",
8888
],
8989
)
9090

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Base image starts with CUDA
2-
ARG BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04
2+
ARG BASE_IMG=nvidia/cuda:12.1.1-devel-ubuntu22.04
33
FROM ${BASE_IMG} as base
4-
ENV BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04
4+
ENV BASE_IMG=nvidia/cuda:12.1.1-devel-ubuntu22.04
55

66
ARG TENSORRT_VERSION
77
ENV TENSORRT_VERSION=${TENSORRT_VERSION}

docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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.8 and TensorRT 8.6
20+
- The example below uses CUDNN 8.9 and TensorRT 8.6
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.6 --build-arg CUDNN_VERSION=8.8 -f docker/Dockerfile -t torch_tensorrt:latest .
27+
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=8.6 --build-arg CUDNN_VERSION=8.9 -f docker/Dockerfile -t torch_tensorrt:latest .
2828
```
2929

3030
Run:

py/ci/build_whl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Example usage: docker run -it -v$(pwd)/..:/workspace/TRTorch build_trtorch_wheel /bin/bash /workspace/TRTorch/py/build_whl.sh
44

55
export CXX=g++
6-
export CUDA_HOME=/usr/local/cuda-11.8
6+
export CUDA_HOME=/usr/local/cuda-12.1
77
export PROJECT_DIR=/workspace/project
88

99
cp -r $CUDA_HOME /usr/local/cuda

py/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
numpy
22
packaging
33
pybind11==2.6.2
4-
--extra-index-url https://download.pytorch.org/whl/nightly/cu118
5-
torch==2.1.0.dev20230605+cu118
6-
torchvision==0.16.0.dev20230605+cu118
4+
--extra-index-url https://download.pytorch.org/whl/nightly/cu121
5+
torch==2.1.0.dev20230613+cu121
6+
torchvision==0.16.0.dev20230613+cu121
77
--extra-index-url https://pypi.ngc.nvidia.com
88
tensorrt==8.6.1

py/torch_tensorrt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _find_lib(name, paths):
5959

6060
elif sys.platform.startswith("linux"):
6161
LINUX_PATHS = [
62-
"/usr/local/cuda-11.8/lib64",
62+
"/usr/local/cuda-12.1/lib64",
6363
]
6464

6565
if "LD_LIBRARY_PATH" in os.environ:

py/torch_tensorrt/fx/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FX2TRT is merged as FX module in Torch-TensorRT
99
$ conda create --name python_env python=3.8
1010
$ conda activate python_env
1111
# Recommend to install PyTorch 2.0 and later
12-
$ conda install pytorch torchvision torchtext cudatoolkit=11.8 -c pytorch-nightly
12+
$ conda install pytorch torchvision torchtext cudatoolkit=12.1 -c pytorch-nightly
1313
# Install TensorRT python package
1414
$ pip3 install nvidia-pyindex
1515
$ pip3 install tensorrt==8.6.1

py/versions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__version__ = "1.5.0.dev0"
2-
__cuda_version__ = "11.8"
3-
__cudnn_version__ = "8.8"
2+
__cuda_version__ = "12.1"
3+
__cudnn_version__ = "8.9"
44
__tensorrt_version__ = "8.6"

toolchains/ci_workspaces/WORKSPACE.x86_64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local_repository(
4141
new_local_repository(
4242
name = "cuda",
4343
build_file = "@//third_party/cuda:BUILD",
44-
path = "/usr/local/cuda-11.8/",
44+
path = "/usr/local/cuda-12.1/",
4545
)
4646

4747
new_local_repository(

toolchains/ci_workspaces/WORKSPACE.x86_64.release.rhel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local_repository(
4141
new_local_repository(
4242
name = "cuda",
4343
build_file = "@//third_party/cuda:BUILD",
44-
path = "/usr/local/cuda-11.8",
44+
path = "/usr/local/cuda-12.1",
4545
)
4646

4747
new_local_repository(
@@ -56,17 +56,17 @@ new_local_repository(
5656
http_archive(
5757
name = "libtorch",
5858
build_file = "@//third_party/libtorch:BUILD",
59-
sha256 = "999becce82b73e566d0ffe010cd21fea8cf3a33f90f09dcc6b01150b820ae063",
59+
sha256 = "1c3712b3b1de34e9989549f53675b557f6f0ca0b800ccbbc80c941af68abcc65",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230605%2Bcu118.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230613%2Bcu121.zip"],
6262
)
6363

6464
http_archive(
6565
name = "libtorch_pre_cxx11_abi",
6666
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "786cc728c63ea69c40bd8fb535cf8e5e1dfff1d43eaad3eb5256b9ed89c1b268",
67+
sha256 = "6bbb53f2f9533804175a0d2eeae5093ee1907158a9ec75c7fb9d10e2103d5df5",
6868
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230605%2Bcu118.zip"],
69+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230613%2Bcu121.zip"],
7070
)
7171

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

0 commit comments

Comments
 (0)