Skip to content

Commit b5d4055

Browse files
committed
Rebase to master
Signed-off-by: Dheeraj Peri <[email protected]>
2 parents edf6e60 + d7eda0d commit b5d4055

File tree

49 files changed

+546
-549
lines changed

Some content is hidden

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

49 files changed

+546
-549
lines changed

BUILD

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,24 @@ pkg_tar(
1919
"//core/conversion/tensorcontainer:include",
2020
"//core/conversion/evaluators:include",
2121
"//core/plugins:include",
22-
"//core/runtime: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": [
@@ -47,26 +46,25 @@ pkg_tar(
4746
],
4847
}),
4948
mode = "0755",
49+
package_dir = "lib/",
5050
)
5151

52-
5352
pkg_tar(
5453
name = "bin",
55-
package_dir = "bin/",
5654
srcs = [
57-
"//cpp/trtorchc:trtorchc",
55+
"//cpp/trtorchc",
5856
],
5957
mode = "0755",
58+
package_dir = "bin/",
6059
)
6160

62-
6361
pkg_tar(
6462
name = "libtrtorch",
65-
extension = "tar.gz",
66-
package_dir = "trtorch",
6763
srcs = [
68-
"//:LICENSE"
64+
"//:LICENSE",
6965
],
66+
extension = "tar.gz",
67+
package_dir = "trtorch",
7068
deps = [
7169
":lib",
7270
":include",

WORKSPACE

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,38 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
55

66
http_archive(
7-
name = "rules_python",
8-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
9-
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
10-
)
7+
name = "rules_python",
8+
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
9+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
10+
)
1111

1212
load("@rules_python//python:pip.bzl", "pip_install")
1313

1414
http_archive(
1515
name = "rules_pkg",
16+
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
1617
urls = [
17-
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
18-
"https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
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",
1920
],
20-
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
2121
)
2222

2323
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
24+
2425
rules_pkg_dependencies()
2526

2627
git_repository(
2728
name = "googletest",
28-
remote = "https://github.com/google/googletest",
2929
commit = "703bd9caab50b139428cea1aaff9974ebee5742e",
30-
shallow_since = "1570114335 -0400"
30+
remote = "https://github.com/google/googletest",
31+
shallow_since = "1570114335 -0400",
3132
)
3233

3334
# CUDA should be installed on the system locally
3435
new_local_repository(
3536
name = "cuda",
36-
path = "/usr/local/cuda-11.1/",
3737
build_file = "@//third_party/cuda:BUILD",
38+
path = "/usr/local/cuda-11.1/",
3839
)
3940

4041
#############################################################################################################
@@ -44,16 +45,16 @@ new_local_repository(
4445
http_archive(
4546
name = "libtorch",
4647
build_file = "@//third_party/libtorch:BUILD",
47-
strip_prefix = "libtorch",
4848
sha256 = "1f8aec376f9343538bd7c2fd3abb81ed3af11f575efe3aa72777c4d62044b832",
49+
strip_prefix = "libtorch",
4950
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu111.zip"],
5051
)
5152

5253
http_archive(
5354
name = "libtorch_pre_cxx11_abi",
5455
build_file = "@//third_party/libtorch:BUILD",
55-
strip_prefix = "libtorch",
5656
sha256 = "3a6e0dc11859111e75caa640c8ce9bf904fbb6e9992b4345e444ed5410e4d77e",
57+
strip_prefix = "libtorch",
5758
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-shared-with-deps-1.8.1%2Bcu111.zip"],
5859
)
5960

@@ -63,22 +64,22 @@ http_archive(
6364

6465
http_archive(
6566
name = "cudnn",
67+
build_file = "@//third_party/cudnn/archive:BUILD",
68+
sha256 = "98a8784e92862f20018d20c281b30d4a0cd951f93694f6433ccf4ae9c502ba6a",
69+
strip_prefix = "cuda",
6670
urls = [
6771
"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",
6872
],
69-
build_file = "@//third_party/cudnn/archive:BUILD",
70-
sha256 = "98a8784e92862f20018d20c281b30d4a0cd951f93694f6433ccf4ae9c502ba6a",
71-
strip_prefix = "cuda"
7273
)
7374

7475
http_archive(
7576
name = "tensorrt",
77+
build_file = "@//third_party/tensorrt/archive:BUILD",
78+
sha256 = "d3a1f478e304b48878604fac70ce7920fece71f9cac62f925c9c59c197f5d087",
79+
strip_prefix = "TensorRT-7.2.3.4",
7680
urls = [
7781
"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",
7882
],
79-
build_file = "@//third_party/tensorrt/archive:BUILD",
80-
strip_prefix = "TensorRT-7.2.3.4",
81-
sha256 = "d3a1f478e304b48878604fac70ce7920fece71f9cac62f925c9c59c197f5d087"
8283
)
8384

8485
####################################################################################

core/BUILD

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,43 @@ 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",
2929
"//core/util/logging",
30-
"@tensorrt//:nvinfer"
30+
"@tensorrt//:nvinfer",
3131
] + select({
32-
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
33-
"//conditions:default": ["@libtorch//:libtorch"],
32+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
33+
"//conditions:default": ["@libtorch//:libtorch"],
3434
}),
35-
alwayslink=True,
35+
alwayslink = True,
3636
)
3737

3838
load("@rules_pkg//:pkg.bzl", "pkg_tar")
3939

4040
pkg_tar(
4141
name = "include",
42-
package_dir = "core/",
4342
srcs = [
4443
"compiler.h",
4544
],
45+
package_dir = "core/",
4646
)

core/conversion/BUILD

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

1010
cc_library(
1111
name = "conversion",
12-
hdrs = [
13-
"conversion.h",
14-
],
1512
srcs = [
13+
"InterfaceTypes.cpp",
1614
"conversion.cpp",
1715
"conversion_ignorelist.cpp",
18-
"InterfaceTypes.cpp"
16+
],
17+
hdrs = [
18+
"conversion.h",
1919
],
2020
deps = [
2121
"@tensorrt//:nvinfer",
2222
"//core/conversion/var",
2323
"//core/conversion/conversionctx",
2424
"//core/conversion/converters",
2525
"//core/conversion/evaluators",
26-
"//core/util:prelude"
26+
"//core/util:prelude",
2727
] + select({
28-
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
29-
"//conditions:default": ["@libtorch//:libtorch"],
28+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
29+
"//conditions:default": ["@libtorch//:libtorch"],
3030
}),
3131
)
3232

3333
load("@rules_pkg//:pkg.bzl", "pkg_tar")
3434

3535
pkg_tar(
3636
name = "include",
37-
package_dir = "core/conversion/",
3837
srcs = ["conversion.h"],
38+
package_dir = "core/conversion/",
3939
)

core/conversion/conversionctx/BUILD

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

1010
cc_library(
1111
name = "conversionctx",
12-
hdrs = [
13-
"ConversionCtx.h",
14-
],
1512
srcs = [
1613
"ConversionCtx.cpp",
1714
],
15+
hdrs = [
16+
"ConversionCtx.h",
17+
],
1818
deps = [
1919
"@tensorrt//:nvinfer",
2020
"//core/util:prelude",
2121
] + select({
22-
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
23-
"//conditions:default": ["@libtorch//:libtorch"],
22+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
23+
"//conditions:default": ["@libtorch//:libtorch"],
2424
}),
2525
)
2626

2727
load("@rules_pkg//:pkg.bzl", "pkg_tar")
2828

2929
pkg_tar(
3030
name = "include",
31-
package_dir = "core/conversion/conversionctx/",
3231
srcs = ["ConversionCtx.h"],
32+
package_dir = "core/conversion/conversionctx/",
3333
)

core/conversion/converters/BUILD

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

1010
cc_library(
1111
name = "weights",
12-
hdrs = [
13-
"Weights.h"
14-
],
1512
srcs = [
16-
"Weights.cpp"
13+
"Weights.cpp",
14+
],
15+
hdrs = [
16+
"Weights.h",
1717
],
1818
deps = [
1919
"@tensorrt//:nvinfer",
2020
"//core/util:prelude",
21-
"//core/conversion/conversionctx"
21+
"//core/conversion/conversionctx",
2222
] + select({
23-
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
24-
"//conditions:default": ["@libtorch//:libtorch"],
23+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
24+
"//conditions:default": ["@libtorch//:libtorch"],
2525
}),
2626
alwayslink = True,
2727
)
2828

2929
cc_library(
3030
name = "converters",
31-
hdrs = [
32-
"converters.h",
33-
"converter_util.h",
34-
],
3531
srcs = [
3632
"NodeConverterRegistry.cpp",
37-
"converter_util.cpp",
33+
"converter_util.cpp",
3834
"impl/activation.cpp",
3935
"impl/batch_norm.cpp",
4036
"impl/concat.cpp",
4137
"impl/constant.cpp",
4238
"impl/conv_deconv.cpp",
4339
"impl/element_wise.cpp",
4440
"impl/expand.cpp",
41+
"impl/interpolate.cpp",
4542
"impl/linear.cpp",
43+
"impl/lstm_cell.cpp",
4644
"impl/matrix_multiply.cpp",
4745
"impl/normalize.cpp",
4846
"impl/pooling.cpp",
4947
"impl/reduce.cpp",
5048
"impl/replication_pad.cpp",
49+
"impl/select.cpp",
5150
"impl/shuffle.cpp",
5251
"impl/softmax.cpp",
53-
"impl/unary.cpp",
54-
"impl/interpolate.cpp",
55-
"impl/select.cpp",
5652
"impl/squeeze.cpp",
5753
"impl/stack.cpp",
58-
"impl/lstm_cell.cpp",
59-
"impl/unsqueeze.cpp",
6054
"impl/topk.cpp",
55+
"impl/unary.cpp",
56+
"impl/unsqueeze.cpp",
57+
],
58+
hdrs = [
59+
"converter_util.h",
60+
"converters.h",
6161
],
6262
deps = [
6363
"@tensorrt//:nvinfer",
@@ -67,8 +67,8 @@ cc_library(
6767
"//core/conversion/conversionctx",
6868
"//core/plugins:trtorch_plugins",
6969
] + select({
70-
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
71-
"//conditions:default": ["@libtorch//:libtorch"],
70+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
71+
"//conditions:default": ["@libtorch//:libtorch"],
7272
}),
7373
alwayslink = True,
7474
)
@@ -77,9 +77,9 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")
7777

7878
pkg_tar(
7979
name = "include",
80-
package_dir = "core/conversion/converters/",
8180
srcs = [
81+
"Weights.h",
8282
"converters.h",
83-
"Weights.h"
8483
],
84+
package_dir = "core/conversion/converters/",
8585
)

0 commit comments

Comments
 (0)