Skip to content

Commit c009a1f

Browse files
committed
feat: Update Pytorch version to 1.11
Signed-off-by: Dheeraj Peri <[email protected]>
1 parent f1f151b commit c009a1f

File tree

11 files changed

+16
-19
lines changed

11 files changed

+16
-19
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd
111111
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.
112112

113113
- Bazel 4.2.1
114-
- Libtorch 1.10.0 (built with CUDA 11.3)
114+
- Libtorch 1.11.0 (built with CUDA 11.3)
115115
- CUDA 11.3 (10.2 on Jetson)
116116
- cuDNN 8.2.1
117117
- TensorRT 8.2.4.2 (TensorRT 8.2.1 on Jetson)

Diff for: WORKSPACE

+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 = "190e963e739d5f7c2dcf94b3994de8fcd335706a4ebb333812ea7d8c841beb06",
59+
sha256 = "8d9e829ce9478db4f35bdb7943308cf02e8a2f58cf9bb10f742462c1d57bf287",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/cu113/libtorch-cxx11-abi-shared-with-deps-1.10.0%2Bcu113.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/cu113/libtorch-cxx11-abi-shared-with-deps-1.11.0%2Bcu113.zip"],
6262
)
6363

6464
http_archive(
6565
name = "libtorch_pre_cxx11_abi",
6666
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "0996a6a4ea8bbc1137b4fb0476eeca25b5efd8ed38955218dec1b73929090053",
67+
sha256 = "90159ecce3ff451f3ef3f657493b6c7c96759c3b74bbd70c1695f2ea2f81e1ad",
6868
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/cu113/libtorch-shared-with-deps-1.10.0%2Bcu113.zip"],
69+
urls = ["https://download.pytorch.org/libtorch/cu113/libtorch-shared-with-deps-1.11.0%2Bcu113.zip"],
7070
)
7171

7272
# Download these tarballs manually from the NVIDIA website

Diff for: core/conversion/evaluators/eval_util.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <ATen/ATen.h>
12
#include "ATen/InitialTensorOptions.h"
23
#include "ATen/core/List.h"
34
#include "ATen/core/functional.h"
@@ -238,7 +239,7 @@ at::Tensor createTensorFromList(
238239
/// Gets shape of tensor to be created
239240
auto sizes = compute_sizes(data);
240241
checkListInputType(elem_type, sizes.size() == 1 && sizes[0] == 0);
241-
at::ScalarType initial_scalar_type = c10::scalarTypeFromJitType(elem_type);
242+
at::ScalarType initial_scalar_type = c10::scalarTypeFromJitType(*elem_type);
242243
if (initial_scalar_type == at::ScalarType::Double) {
243244
initial_scalar_type = at::typeMetaToScalarType(c10::get_default_dtype());
244245
}

Diff for: core/lowering/passes/linear_to_addmm.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#include "torch/csrc/jit/passes/guard_elimination.h"
88
#include "torch/csrc/jit/passes/peephole.h"
99
#include "torch/csrc/jit/runtime/graph_executor.h"
10-
11-
#include "core/util/prelude.h"
10+
#include "torch/csrc/jit/api/function_impl.h"
1211
#include "torch/csrc/jit/passes/subgraph_rewrite.h"
12+
#include "core/util/prelude.h"
1313

1414
namespace torch_tensorrt {
1515
namespace core {
@@ -34,7 +34,7 @@ void replaceLinearWithBiasNonePattern(std::shared_ptr<torch::jit::Graph> graph)
3434
continue;
3535
} else {
3636
torch::jit::WithInsertPoint guard(*it);
37-
std::shared_ptr<torch::jit::Graph> d_graph = decompose_funcs.get_function("linear").graph();
37+
std::shared_ptr<torch::jit::Graph> d_graph = toGraphFunction(decompose_funcs.get_function("linear")).graph();;
3838
torch::jit::Value* new_output = insertGraph(*it->owningGraph(), *d_graph, it->inputs()).at(0);
3939
new_output->setType(it->output()->type());
4040
it->output()->replaceAllUsesWith(new_output);

Diff for: core/partitioning/shape_analysis.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <ATen/ATen.h>
12
#include "core/partitioning/shape_analysis.h"
23
#include "core/util/prelude.h"
34
#include "torch/csrc/jit/api/module.h"

Diff for: py/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-f https://download.pytorch.org/whl/torch_stable.html
2-
torch==1.10.0+cu113
2+
torch==1.11.0+cu113
33
pybind11==2.6.2

Diff for: tests/cpp/test_modules_as_engines.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ INSTANTIATE_TEST_SUITE_P(
6363
PathAndInSize({"tests/modules/resnet18_scripted.jit.pt", {{1, 3, 224, 224}}, 2e-5}),
6464
PathAndInSize({"tests/modules/resnet50_scripted.jit.pt", {{1, 3, 224, 224}}, 2e-5}),
6565
PathAndInSize({"tests/modules/mobilenet_v2_scripted.jit.pt", {{1, 3, 224, 224}}, 2e-5}),
66-
PathAndInSize({"tests/modules/efficientnet_b0_scripted.jit.pt", {{1, 3, 224, 224}}, 2e-5}),
66+
PathAndInSize({"tests/modules/efficientnet_b0_scripted.jit.pt", {{1, 3, 224, 224}}, 1e-4}),
6767
PathAndInSize({"tests/modules/vit_scripted.jit.pt", {{1, 3, 224, 224}}, 8e-2})));
6868

6969
#endif

Diff for: tests/modules/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-f https://download.pytorch.org/whl/torch_stable.html
22
timm==v0.4.12
3-
torch==1.10.0+cu113
3+
torch==1.11.0+cu113

Diff for: tests/py/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
torchvision==0.11.1+cu113
1+
torchvision==0.12.0+cu113
22
-f https://download.pytorch.org/whl/torch_stable.html

Diff for: tests/util/util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <string>
44
#include <vector>
5-
5+
#include <ATen/ATen.h>
66
#include "ATen/Tensor.h"
77
#include "core/ir/ir.h"
88
#include "core/util/prelude.h"

Diff for: third_party/libtorch/BUILD

-5
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,9 @@ cc_library(
9090
srcs = select({
9191
":windows": [
9292
"lib/caffe2_nvrtc.lib",
93-
"lib/caffe2_detectron_ops_gpu.lib",
94-
"lib/caffe2_module_test_dynamic.lib",
9593
],
9694
"//conditions:default": [
9795
"lib/libcaffe2_nvrtc.so",
98-
"lib/libcaffe2_detectron_ops_gpu.so",
99-
"lib/libcaffe2_observers.so",
100-
"lib/libcaffe2_module_test_dynamic.so",
10196
],
10297
}),
10398
hdrs = glob([

0 commit comments

Comments
 (0)