Skip to content

Commit efc8202

Browse files
authored
Merge branch 'master' into aten_size_fix_bug
2 parents 093de46 + 4da65b3 commit efc8202

File tree

143 files changed

+4895
-1249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4895
-1249
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Steps to reproduce the behavior:
2929

3030
> Build information about the TRTorch compiler can be found by turning on debug messages
3131
32-
- PyTorch Version (e.g., 1.0):
32+
- TRTorch Version (e.g. 0.2.0):
33+
- PyTorch Version (e.g. 1.0):
3334
- CPU Architecture:
3435
- OS (e.g., Linux):
3536
- How you installed PyTorch (`conda`, `pip`, `libtorch`, source):

.github/scripts/run_cpp_linter.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
comment = '''There are some changes that do not conform to C++ style guidelines:\n ```diff\n{}```'''.format(output.stdout.decode("utf-8"))
2525
approval = 'REQUEST_CHANGES'
2626

27-
pr.create_review(commit, comment, approval)
28-
29-
27+
try:
28+
pr.create_review(commit, comment, approval)
29+
except:
30+
print("Unable to submit in depth review, please review logs for linting issues")
31+
32+
if output.returncode != 0:
33+
exit(1)
34+
else:
35+
exit(0)

.github/scripts/run_py_linter.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@
2424
comment = '''There are some changes that do not conform to Python style guidelines:\n ```diff\n{}```'''.format(output.stdout.decode("utf-8"))
2525
approval = 'REQUEST_CHANGES'
2626

27-
pr.create_review(commit, comment, approval)
27+
try:
28+
pr.create_review(commit, comment, approval)
29+
except:
30+
print("Unable to submit in depth review, please review logs for linting issues")
31+
32+
if output.returncode != 0:
33+
exit(1)
34+
else:
35+
exit(0)

BUILD

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,28 @@ pkg_tar(
1515
"//core/conversion:include",
1616
"//core/conversion/conversionctx:include",
1717
"//core/conversion/converters:include",
18-
"//core/conversion/var:include",
19-
"//core/conversion/tensorcontainer:include",
20-
"//core/conversion/evaluators:include",
2118
"//core/conversion/converters/impl/plugins:include",
22-
"//core/runtime:include",
19+
"//core/conversion/evaluators:include",
20+
"//core/conversion/tensorcontainer:include",
21+
"//core/conversion/var:include",
2322
"//core/lowering:include",
2423
"//core/lowering/passes:include",
24+
"//core/runtime:include",
2525
"//core/util:include",
26-
"//core/util/logging:include"
26+
"//core/util/logging:include",
2727
],
2828
)
2929

3030
pkg_tar(
3131
name = "include",
32-
package_dir = "include/trtorch/",
3332
srcs = [
3433
"//cpp/api:api_headers",
3534
],
35+
package_dir = "include/trtorch/",
3636
)
3737

3838
pkg_tar(
3939
name = "lib",
40-
package_dir = "lib/",
4140
srcs = select({
4241
":windows": ["//cpp/api/lib:trtorch.dll"],
4342
"//conditions:default": [
@@ -46,26 +45,25 @@ pkg_tar(
4645
],
4746
}),
4847
mode = "0755",
48+
package_dir = "lib/",
4949
)
5050

51-
5251
pkg_tar(
5352
name = "bin",
54-
package_dir = "bin/",
5553
srcs = [
56-
"//cpp/trtorchc:trtorchc",
54+
"//cpp/trtorchc",
5755
],
5856
mode = "0755",
57+
package_dir = "bin/",
5958
)
6059

61-
6260
pkg_tar(
6361
name = "libtrtorch",
64-
extension = "tar.gz",
65-
package_dir = "trtorch",
6662
srcs = [
67-
"//:LICENSE"
63+
"//:LICENSE",
6864
],
65+
extension = "tar.gz",
66+
package_dir = "trtorch",
6967
deps = [
7068
":lib",
7169
":include",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts")
7474
These are the following dependencies used to verify the testcases. TRTorch can work with other versions, but the tests are not guaranteed to pass.
7575

7676
- Bazel 4.0.0
77-
- Libtorch 1.8.0 (built with CUDA 11.1)
77+
- Libtorch 1.8.1 (built with CUDA 11.1)
7878
- CUDA 11.1 (10.2 on Jetson)
7979
- cuDNN 8.1
8080
- TensorRT 7.2.3

WORKSPACE

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,39 @@ workspace(name = "TRTorch")
33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
55

6-
git_repository(
6+
http_archive(
77
name = "rules_python",
8-
remote = "https://github.com/bazelbuild/rules_python.git",
9-
commit = "4fcc24fd8a850bdab2ef2e078b1de337eea751a6",
10-
shallow_since = "1589292086 -0400"
8+
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
9+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
1110
)
1211

13-
load("@rules_python//python:repositories.bzl", "py_repositories")
14-
py_repositories()
15-
16-
load("@rules_python//python:pip.bzl", "pip_repositories", "pip3_import")
17-
pip_repositories()
12+
load("@rules_python//python:pip.bzl", "pip_install")
1813

1914
http_archive(
2015
name = "rules_pkg",
21-
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
22-
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
16+
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
17+
urls = [
18+
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
19+
"https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
20+
],
2321
)
2422

2523
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
24+
2625
rules_pkg_dependencies()
2726

2827
git_repository(
2928
name = "googletest",
30-
remote = "https://github.com/google/googletest",
3129
commit = "703bd9caab50b139428cea1aaff9974ebee5742e",
32-
shallow_since = "1570114335 -0400"
30+
remote = "https://github.com/google/googletest",
31+
shallow_since = "1570114335 -0400",
3332
)
3433

3534
# CUDA should be installed on the system locally
3635
new_local_repository(
3736
name = "cuda",
38-
path = "/usr/local/cuda-11.1/",
3937
build_file = "@//third_party/cuda:BUILD",
40-
)
41-
42-
new_local_repository(
43-
name = "cublas",
44-
path = "/usr",
45-
build_file = "@//third_party/cublas:BUILD",
38+
path = "/usr/local/cuda-11.1/",
4639
)
4740

4841
#############################################################################################################
@@ -52,17 +45,17 @@ new_local_repository(
5245
http_archive(
5346
name = "libtorch",
5447
build_file = "@//third_party/libtorch:BUILD",
48+
sha256 = "1f8aec376f9343538bd7c2fd3abb81ed3af11f575efe3aa72777c4d62044b832",
5549
strip_prefix = "libtorch",
56-
sha256 = "62a2c06761c32576b30f5884240cf675b937945d929e4b13cc776de8d9c2236c",
57-
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.8.0%2Bcu111.zip"],
50+
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu111.zip"],
5851
)
5952

6053
http_archive(
6154
name = "libtorch_pre_cxx11_abi",
6255
build_file = "@//third_party/libtorch:BUILD",
56+
sha256 = "3a6e0dc11859111e75caa640c8ce9bf904fbb6e9992b4345e444ed5410e4d77e",
6357
strip_prefix = "libtorch",
64-
sha256 = "1c8b0c0883dd17f5ce952d42ec5f7f0cc7ceb370307535cee26a66c10419f1f6",
65-
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-shared-with-deps-1.8.0%2Bcu111.zip"],
58+
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-shared-with-deps-1.8.1%2Bcu111.zip"],
6659
)
6760

6861
# Download these tarballs manually from the NVIDIA website
@@ -71,18 +64,22 @@ http_archive(
7164

7265
http_archive(
7366
name = "cudnn",
74-
urls = ["https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.1.1.33/11.2_20210301/cudnn-11.2-linux-x64-v8.1.1.33.tgz",],
7567
build_file = "@//third_party/cudnn/archive:BUILD",
7668
sha256 = "98a8784e92862f20018d20c281b30d4a0cd951f93694f6433ccf4ae9c502ba6a",
77-
strip_prefix = "cuda"
69+
strip_prefix = "cuda",
70+
urls = [
71+
"https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.1.1.33/11.2_20210301/cudnn-11.2-linux-x64-v8.1.1.33.tgz",
72+
],
7873
)
7974

8075
http_archive(
8176
name = "tensorrt",
82-
urls = ["https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/7.2.3/tars/TensorRT-7.2.3.4.Ubuntu-18.04.x86_64-gnu.cuda-11.1.cudnn8.1.tar.gz",],
8377
build_file = "@//third_party/tensorrt/archive:BUILD",
78+
sha256 = "d3a1f478e304b48878604fac70ce7920fece71f9cac62f925c9c59c197f5d087",
8479
strip_prefix = "TensorRT-7.2.3.4",
85-
sha256 = "d3a1f478e304b48878604fac70ce7920fece71f9cac62f925c9c59c197f5d087"
80+
urls = [
81+
"https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/7.2.3/tars/TensorRT-7.2.3.4.Ubuntu-18.04.x86_64-gnu.cuda-11.1.cudnn8.1.tar.gz",
82+
],
8683
)
8784

8885
####################################################################################
@@ -123,26 +120,17 @@ http_archive(
123120
#########################################################################
124121
# Testing Dependencies (optional - comment out on aarch64)
125122
#########################################################################
126-
pip3_import(
123+
pip_install(
127124
name = "trtorch_py_deps",
128-
requirements = "//py:requirements.txt"
125+
requirements = "//py:requirements.txt",
129126
)
130127

131-
load("@trtorch_py_deps//:requirements.bzl", "pip_install")
132-
pip_install()
133-
134-
pip3_import(
128+
pip_install(
135129
name = "py_test_deps",
136-
requirements = "//tests/py:requirements.txt"
130+
requirements = "//tests/py:requirements.txt",
137131
)
138132

139-
load("@py_test_deps//:requirements.bzl", "pip_install")
140-
pip_install()
141-
142-
pip3_import(
143-
name = "pylinter_deps",
144-
requirements = "//tools/linter:requirements.txt",
133+
pip_install(
134+
name = "pylinter_deps",
135+
requirements = "//tools/linter:requirements.txt",
145136
)
146-
147-
load("@pylinter_deps//:requirements.bzl", "pip_install")
148-
pip_install()

core/BUILD

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,44 @@ config_setting(
44
name = "use_pre_cxx11_abi",
55
values = {
66
"define": "abi=pre_cxx11_abi",
7-
}
7+
},
88
)
99

1010
config_setting(
1111
name = "python_core",
1212
values = {
13-
"define": "target_lang=python"
14-
}
13+
"define": "target_lang=python",
14+
},
1515
)
1616

1717
cc_library(
1818
name = "core",
19-
hdrs = [
20-
"compiler.h",
21-
],
2219
srcs = [
2320
"compiler.cpp",
2421
],
22+
hdrs = [
23+
"compiler.h",
24+
],
2525
deps = [
2626
"//core/conversion",
2727
"//core/runtime",
2828
"//core/lowering",
29+
"//core/partitioning",
2930
"//core/util/logging",
30-
"@tensorrt//:nvinfer"
31+
"@tensorrt//:nvinfer",
3132
] + select({
32-
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
33-
"//conditions:default": ["@libtorch//:libtorch"],
33+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
34+
"//conditions:default": ["@libtorch//:libtorch"],
3435
}),
35-
alwayslink=True,
36+
alwayslink = True,
3637
)
3738

3839
load("@rules_pkg//:pkg.bzl", "pkg_tar")
3940

4041
pkg_tar(
4142
name = "include",
42-
package_dir = "core/",
4343
srcs = [
4444
"compiler.h",
4545
],
46+
package_dir = "core/",
4647
)

0 commit comments

Comments
 (0)