Skip to content

Commit e3cb32d

Browse files
author
Yinghai Lu
authored
Fix build (#1479)
* Fix build * different nightly torch * fix lint * c10_cuda * update WORKSPACE * print torch version * Update setup.py requirement * fix TRTModuleNext
1 parent 90b13a9 commit e3cb32d

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ commands:
367367
- run:
368368
name: Test torch
369369
command: |
370-
python3 -c "import torch; print(torch.cuda.is_available()); print(torch.cuda.device_count())"
370+
python3 -c "import torch; print(torch.cuda.is_available()); print(torch.cuda.device_count()); print(torch.__version__)"
371371
372372
- run:
373373
name: Get torch-tensorrt version information
@@ -946,7 +946,7 @@ parameters:
946946
# Nightly platform config
947947
torch-build:
948948
type: string
949-
default: "1.13.0.dev20220921+cu116"
949+
default: "1.14.0.dev20221114+cu116"
950950
torch-build-index:
951951
type: string
952952
default: "https://download.pytorch.org/whl/nightly/cu116"

WORKSPACE

Lines changed: 4 additions & 4 deletions
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 = "486106ddc5b5ad532f030f447940a571b924da821b9534d25c0cef5503cdfaea",
59+
sha256 = "b565c662435fd58ec295fa0791388ea52ad0f5fd33517b2d7c0fdcc91b6db531",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/nightly/cu116/libtorch-cxx11-abi-shared-with-deps-1.13.0.dev20220921%2Bcu116.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/nightly/cu116/libtorch-cxx11-abi-shared-with-deps-1.14.0.dev20221114%2Bcu116.zip"],
6262
)
6363

6464
http_archive(
6565
name = "libtorch_pre_cxx11_abi",
6666
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "b304ebf26effcbbefcec99134bcfb0127c499306343fbe2e2cd127213448a4a6",
67+
sha256 = "fbb37446c33b05c1e26256c09f6ffb46cea1f6ff9ee2ad5b79b146d09023b0c1",
6868
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu116/libtorch-shared-with-deps-1.13.0.dev20220921%2Bcu116.zip"],
69+
urls = ["https://download.pytorch.org/libtorch/nightly/cu116/libtorch-shared-with-deps-1.14.0.dev20221114%2Bcu116.zip"],
7070
)
7171

7272
# Download these tarballs manually from the NVIDIA website

core/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ cc_library(
3333
"//core/util/logging",
3434
"@tensorrt//:nvinfer",
3535
] + select({
36-
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
37-
"//conditions:default": ["@libtorch//:libtorch"],
36+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch", "@libtorch_pre_cxx11_abi//:c10_cuda"],
37+
"//conditions:default": ["@libtorch//:libtorch", "@libtorch//:c10_cuda"],
3838
}),
3939
alwayslink = True,
4040
)

core/runtime/TRTEngine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ TRTEngine::TRTEngine(
142142
num_io = std::make_pair(inputs, outputs);
143143
}
144144

145-
#ifndef NDEBUG
146-
this->enable_profiling();
147-
#endif
145+
#ifndef NDEBUG
146+
this->enable_profiling();
147+
#endif
148148
LOG_DEBUG(*this);
149149
}
150150

cpp/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ target_sources(${lib_name}
2424

2525
target_link_libraries(${lib_name}
2626
PUBLIC
27-
torch
27+
"${TORCH_LIBRARIES}"
2828
TensorRT::nvinfer
2929
core
3030
)
@@ -71,7 +71,7 @@ target_sources(${torchtrt_lib_name}
7171
target_link_libraries(${torchtrt_lib_name}
7272
PUBLIC
7373
TensorRT::TensorRT
74-
torch
74+
"${TORCH_LIBRARIES}"
7575
PRIVATE
7676
torch_tensorrt
7777
core
@@ -111,7 +111,7 @@ target_sources(${runtime_lib_name}
111111
target_link_libraries(${runtime_lib_name}
112112
PUBLIC
113113
TensorRT::TensorRT
114-
torch
114+
"${TORCH_LIBRARIES}"
115115
PRIVATE
116116
core_runtime
117117
core_plugins

py/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
numpy
22
pybind11==2.6.2
33
--extra-index-url https://download.pytorch.org/whl/nightly/cu116
4-
torch==1.13.0.dev20220921+cu116
4+
torch==1.14.0.dev20221114+cu116
55
torchvision==0.14.0.dev20220921+cu116
66
--extra-index-url https://pypi.ngc.nvidia.com
77
nvidia-tensorrt==8.4.3.1

py/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def run(self):
376376
long_description=long_description,
377377
ext_modules=ext_modules,
378378
install_requires=[
379-
"torch>=1.13.0.dev0,<1.14.0",
379+
"torch>=1.14.0.dev0",
380380
],
381381
setup_requires=[],
382382
cmdclass={

py/torch_tensorrt/_TRTModuleNext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TRTModuleNext(torch.nn.Module):
3131

3232
def __init__(
3333
self,
34-
serialized_engine: bytearray,
34+
serialized_engine: bytearray = bytearray(),
3535
name: str = "",
3636
input_binding_names: List[str] = [],
3737
output_binding_names: List[str] = [],

0 commit comments

Comments
 (0)