Skip to content

Commit 5fdb1c9

Browse files
committed
feat: Upgrade Pytorch and TensorRT versions
Signed-off-by: Dheeraj Peri <[email protected]>
1 parent 248793d commit 5fdb1c9

File tree

12 files changed

+135
-101
lines changed

12 files changed

+135
-101
lines changed

.circleci/config.yml

Lines changed: 103 additions & 52 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 = "8b3b48615169c83c1b643c0efade078ea080b1da598e15fcf01bc59421f3095e",
54+
sha256 = "292b3f81e7c857fc102be93e2e44c40cdb4d8ef03d98121bc6af434c66e8490b",
6055
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.0.0.dev20230219%2Bcu117.zip"],
56+
urls = ["https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcu118.zip"],
6257
)
6358

6459
http_archive(
6560
name = "libtorch_pre_cxx11_abi",
6661
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "aa7fd06079d260ff83c344d043fb84fbd9cf831cf375ed8b5a1b62416817af31",
62+
sha256 = "f3cbd7e9593f0c64b8671d02a21d562c98b60ef1abf5898c0ee9acfbc5a6b5d2",
6863
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-shared-with-deps-2.0.0.dev20230219%2Bcu117.zip"],
64+
urls = ["https://download.pytorch.org/libtorch/cu118/libtorch-shared-with-deps-2.0.0%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
@@ -148,10 +148,10 @@ TRTEngine::TRTEngine(
148148
}
149149

150150
TRTEngine::~TRTEngine() {
151-
rt.reset();
152151
trt_engine_profiler.reset();
153152
exec_ctx.reset();
154153
cuda_engine.reset();
154+
rt.reset();
155155
}
156156

157157
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,7 +1,7 @@
11
numpy
22
pybind11==2.6.2
3-
--extra-index-url https://download.pytorch.org/whl/nightly/cu117
4-
torch==2.0.0.dev20230219+cu117
5-
torchvision==0.15.0.dev20230219+cu117
3+
--extra-index-url https://download.pytorch.org/whl/nightly/cu118
4+
torch==2.0.0
5+
torchvision==0.15.1
66
--extra-index-url https://pypi.ngc.nvidia.com
7-
tensorrt==8.5.1.7
7+
tensorrt==8.6.0

py/setup.py

Lines changed: 1 addition & 1 deletion
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>=1.13.1",
383+
"torch==2.0.0",
384384
],
385385
setup_requires=[],
386386
cmdclass={

py/torch_tensorrt/__init__.py

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

5959
elif sys.platform.startswith("linux"):
6060
LINUX_PATHS = [
61-
"/usr/local/cuda/lib64",
61+
"/usr/local/cuda-11.8/lib64",
6262
]
6363

6464
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 = "8b3b48615169c83c1b643c0efade078ea080b1da598e15fcf01bc59421f3095e",
59+
sha256 = "292b3f81e7c857fc102be93e2e44c40cdb4d8ef03d98121bc6af434c66e8490b",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.0.0.dev20230219%2Bcu117.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcu118.zip"],
6262
)
6363

6464
http_archive(
6565
name = "libtorch_pre_cxx11_abi",
6666
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "aa7fd06079d260ff83c344d043fb84fbd9cf831cf375ed8b5a1b62416817af31",
67+
sha256 = "f3cbd7e9593f0c64b8671d02a21d562c98b60ef1abf5898c0ee9acfbc5a6b5d2",
6868
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-shared-with-deps-2.0.0.dev20230219%2Bcu117.zip"],
69+
urls = ["https://download.pytorch.org/libtorch/cu118/libtorch-shared-with-deps-2.0.0%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 = "8b3b48615169c83c1b643c0efade078ea080b1da598e15fcf01bc59421f3095e",
59+
sha256 = "292b3f81e7c857fc102be93e2e44c40cdb4d8ef03d98121bc6af434c66e8490b",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.0.0.dev20230219%2Bcu117.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcu118.zip"],
6262
)
6363

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

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

0 commit comments

Comments
 (0)