Skip to content

Commit a08dbb3

Browse files
peri044gs-olive
authored andcommitted
feat: Upgrade Pytorch and TensorRT versions
Signed-off-by: Dheeraj Peri <[email protected]>
1 parent 25db257 commit a08dbb3

File tree

12 files changed

+136
-103
lines changed

12 files changed

+136
-103
lines changed

.circleci/config.yml

Lines changed: 104 additions & 54 deletions
Large diffs are not rendered by default.

WORKSPACE

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

47-
new_local_repository(
48-
name = "cublas",
49-
build_file = "@//third_party/cublas:BUILD",
50-
path = "/usr",
51-
)
5247
#############################################################################################################
5348
# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
5449
#############################################################################################################
5550

5651
http_archive(
5752
name = "libtorch",
5853
build_file = "@//third_party/libtorch:BUILD",
59-
sha256 = "7c4b8754830fef23ec19c5eaf414794cee9597b435df055f5c1d0471d3e81568",
54+
sha256 = "486aeb5cf498f3df8713a96a0d178660828fc579e740c39b054bef0adef6315b",
6055
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230314%2Bcu117.zip"],
56+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
6257
)
6358

6459
http_archive(
6560
name = "libtorch_pre_cxx11_abi",
6661
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "f1e64a75dd12d0ba4c8c1f61947299e0a9c50684dff64f0cfbf355aa7a13e8cf",
62+
sha256 = "03b1c29a2a2e412ab6cdb957b5fd48a64aeed1b3551ee7679908c4ac177b89ab",
6863
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-shared-with-deps-2.1.0.dev20230314%2Bcu117.zip"],
64+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
7065
)
7166

7267
# Download these tarballs manually from the NVIDIA website
@@ -86,10 +81,10 @@ http_archive(
8681
http_archive(
8782
name = "tensorrt",
8883
build_file = "@//third_party/tensorrt/archive:BUILD",
89-
sha256 = "39cc7f077057d1363794e8ff51c4cf21a5dbeccf1116b0020ba0dae0f3063076",
90-
strip_prefix = "TensorRT-8.5.1.7",
84+
sha256 = "c1732a1093c57ab79fa0b687f061be369e449c9c17792b660f3663ecd8fa7b63",
85+
strip_prefix = "TensorRT-8.6.0.12",
9186
urls = [
92-
"https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.5.1/tars/TensorRT-8.5.1.7.Linux.x86_64-gnu.cuda-11.8.cudnn8.6.tar.gz",
87+
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.0/tars/TensorRT-8.6.0.12.Linux.x86_64-gnu.cuda-11.8.tar.gz",
9388
],
9489
)
9590

core/runtime/TRTEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ TRTEngine::TRTEngine(
150150
}
151151

152152
TRTEngine::~TRTEngine() {
153-
rt.reset();
154153
trt_engine_profiler.reset();
155154
exec_ctx.reset();
156155
cuda_engine.reset();
156+
rt.reset();
157157
}
158158

159159
void TRTEngine::disable_profiling() {

py/ci/build_whl.sh

Lines changed: 2 additions & 2 deletions
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.7
6+
export CUDA_HOME=/usr/local/cuda-11.8
77
export PROJECT_DIR=/workspace/project
88

99
cp -r $CUDA_HOME /usr/local/cuda
@@ -108,4 +108,4 @@ libtorchtrt_pre_cxx11_abi() {
108108
CUDNN_VERSION=$(cd ${PROJECT_DIR}/py && ${PY_DIR}/bin/python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)")
109109
TORCH_VERSION=$(${PY_DIR}/bin/python -c "from torch import __version__;print(__version__.split('+')[0])")
110110
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-
}
111+
}

py/requirements.txt

Lines changed: 4 additions & 4 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/cu117
5-
torch==2.1.0.dev20230314+cu117
6-
torchvision==0.15.0.dev20230314+cu117
4+
--extra-index-url https://download.pytorch.org/whl/nightly/cu118
5+
torch==2.1.0.dev20230421+cu118
6+
torchvision==0.16.0.dev20230421+cu118
77
--extra-index-url https://pypi.ngc.nvidia.com
8-
tensorrt==8.5.1.7
8+
tensorrt==8.6.0

py/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def run(self):
420420
long_description=long_description,
421421
ext_modules=ext_modules,
422422
install_requires=[
423-
"torch>=1.13.1",
423+
"torch==2.0.0",
424424
],
425425
setup_requires=[],
426426
cmdclass={

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/lib64",
62+
"/usr/local/cuda-11.8/lib64",
6363
]
6464

6565
if "LD_LIBRARY_PATH" in os.environ:

third_party/tensorrt/archive/BUILD

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ cc_library(
4646
"nvinfer_lib",
4747
"@cuda//:cudart",
4848
"@cudnn",
49-
] + select({
50-
":windows": ["@cuda//:cublas"],
51-
"//conditions:default": ["@cuda//:cublas"],
52-
}),
49+
],
5350
)
5451

5552
####################################################################################
@@ -186,8 +183,5 @@ cc_library(
186183
"nvinferplugin_lib",
187184
"@cuda//:cudart",
188185
"@cudnn",
189-
] + select({
190-
":windows": ["@cuda//:cublas"],
191-
"//conditions:default": ["@cuda//:cublas"],
192-
}),
186+
],
193187
)

third_party/tensorrt/local/BUILD

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ cc_library(
113113
"nvinfer_lib",
114114
"@cuda//:cudart",
115115
"@cudnn",
116-
] + select({
117-
":windows": ["@cuda//:cublas"],
118-
"//conditions:default": ["@cuda//:cublas"],
119-
}),
116+
],
120117
)
121118

122119
####################################################################################
@@ -370,9 +367,6 @@ cc_library(
370367
"nvinfer",
371368
"@cuda//:cudart",
372369
"@cudnn",
373-
] + select({
374-
":windows": ["@cuda//:cublas"],
375-
"//conditions:default": ["@cuda//:cublas"],
376-
}),
370+
],
377371
alwayslink = True,
378372
)

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/",
44+
path = "/usr/local/cuda-11.8/",
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.7",
44+
path = "/usr/local/cuda-11.8",
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 = "7c4b8754830fef23ec19c5eaf414794cee9597b435df055f5c1d0471d3e81568",
59+
sha256 = "486aeb5cf498f3df8713a96a0d178660828fc579e740c39b054bef0adef6315b",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230314%2Bcu117.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
6262
)
6363

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

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

toolchains/ci_workspaces/WORKSPACE.x86_64.release.ubuntu

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",
44+
path = "/usr/local/cuda-11.8",
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 = "7c4b8754830fef23ec19c5eaf414794cee9597b435df055f5c1d0471d3e81568",
59+
sha256 = "486aeb5cf498f3df8713a96a0d178660828fc579e740c39b054bef0adef6315b",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230314%2Bcu117.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230421%2Bcu118.zip"],
6262
)
6363

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

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

0 commit comments

Comments
 (0)