aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/tensorrt/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/tensorrt/BUILD')
-rw-r--r--tensorflow/contrib/tensorrt/BUILD100
1 files changed, 83 insertions, 17 deletions
diff --git a/tensorflow/contrib/tensorrt/BUILD b/tensorflow/contrib/tensorrt/BUILD
index adda0b758b..2fe1f2c242 100644
--- a/tensorflow/contrib/tensorrt/BUILD
+++ b/tensorflow/contrib/tensorrt/BUILD
@@ -11,7 +11,6 @@ exports_files(["LICENSE"])
load(
"//tensorflow:tensorflow.bzl",
- "py_test",
"tf_cc_test",
"tf_copts",
"tf_cuda_library",
@@ -20,6 +19,7 @@ load(
"tf_gen_op_libs",
"tf_gen_op_wrapper_py",
)
+load("//tensorflow:tensorflow.bzl", "cuda_py_tests")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")
load("//tensorflow:tensorflow.bzl", "tf_custom_op_py_library")
load("//tensorflow:tensorflow.bzl", "tf_py_wrap_cc")
@@ -33,8 +33,8 @@ tf_cuda_cc_test(
size = "small",
srcs = ["tensorrt_test.cc"],
tags = [
- "manual",
- "notap",
+ "no_windows",
+ "nomac",
],
deps = [
"//tensorflow/core:lib",
@@ -83,6 +83,7 @@ cc_library(
copts = tf_copts(),
visibility = ["//visibility:public"],
deps = [
+ ":trt_allocator",
":trt_logging",
":trt_plugins",
":trt_resources",
@@ -156,6 +157,7 @@ py_library(
],
srcs_version = "PY2AND3",
deps = [
+ ":tf_trt_integration_test_base",
":trt_convert_py",
":trt_ops_py",
"//tensorflow/python:errors",
@@ -185,6 +187,9 @@ tf_py_wrap_cc(
name = "wrap_conversion",
srcs = ["trt_conversion.i"],
copts = tf_copts(),
+ swig_includes = [
+ "//tensorflow/python:platform/base.i",
+ ],
deps = [
":trt_conversion",
":trt_engine_op_kernel",
@@ -195,17 +200,16 @@ tf_py_wrap_cc(
tf_cuda_library(
name = "trt_resources",
srcs = [
- "resources/trt_allocator.cc",
"resources/trt_int8_calibrator.cc",
"resources/trt_resource_manager.cc",
],
hdrs = [
- "resources/trt_allocator.h",
"resources/trt_int8_calibrator.h",
"resources/trt_resource_manager.h",
"resources/trt_resources.h",
],
deps = [
+ ":trt_allocator",
":trt_logging",
":utils",
"//tensorflow/core:framework_headers_lib",
@@ -216,6 +220,34 @@ tf_cuda_library(
]),
)
+tf_cuda_library(
+ name = "trt_allocator",
+ srcs = ["resources/trt_allocator.cc"],
+ hdrs = ["resources/trt_allocator.h"],
+ deps = [
+ "//tensorflow/core:framework_headers_lib",
+ "//tensorflow/core:framework_lite",
+ "//tensorflow/core:lib_proto_parsing",
+ ] + if_tensorrt([
+ "@local_config_tensorrt//:nv_infer",
+ ]),
+)
+
+tf_cc_test(
+ name = "trt_allocator_test",
+ size = "small",
+ srcs = ["resources/trt_allocator_test.cc"],
+ tags = [
+ "no_windows",
+ "nomac",
+ ],
+ deps = [
+ ":trt_allocator",
+ "//tensorflow/core:test",
+ "//tensorflow/core:test_main",
+ ],
+)
+
# Library for the node-level conversion portion of TensorRT operation creation
tf_cuda_library(
name = "trt_conversion",
@@ -231,6 +263,7 @@ tf_cuda_library(
],
deps = [
":segment",
+ ":trt_allocator",
":trt_plugins",
":trt_logging",
":trt_resources",
@@ -275,13 +308,21 @@ tf_cc_test(
name = "segment_test",
size = "small",
srcs = ["segment/segment_test.cc"],
+ tags = [
+ "no_windows",
+ "nomac",
+ ],
deps = [
":segment",
- "//tensorflow/c:c_api",
+ "//tensorflow/cc:cc_ops",
+ "//tensorflow/cc:scope",
+ "//tensorflow/core:core_cpu",
"//tensorflow/core:lib",
+ "//tensorflow/core:ops",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
+ "//tensorflow/core:testlib",
],
)
@@ -311,8 +352,9 @@ tf_cuda_cc_test(
size = "small",
srcs = ["plugin/trt_plugin_factory_test.cc"],
tags = [
- "manual",
- "notap",
+ "no_cuda_on_cpu_tap",
+ "no_windows",
+ "nomac",
],
deps = [
":trt_plugins",
@@ -325,23 +367,47 @@ tf_cuda_cc_test(
]),
)
-py_test(
+py_library(
+ name = "tf_trt_integration_test_base",
+ srcs = ["test/tf_trt_integration_test_base.py"],
+ deps = [
+ ":trt_convert_py",
+ ":trt_ops_py",
+ "//tensorflow/python:client_testlib",
+ "//tensorflow/python:framework_test_lib",
+ ],
+)
+
+cuda_py_tests(
name = "tf_trt_integration_test",
- srcs = ["test/tf_trt_integration_test.py"],
- main = "test/tf_trt_integration_test.py",
- srcs_version = "PY2AND3",
- tags = [
- "manual",
- "notap",
+ srcs = [
+ "test/base_test.py",
+ # "test/batch_matmul_test.py",
+ # "test/biasadd_matmul_test.py",
+ "test/binary_tensor_weight_broadcast_test.py",
+ "test/concatenation_test.py",
+ "test/const_broadcast_test.py",
+ "test/multi_connection_neighbor_engine_test.py",
+ "test/neighboring_engine_test.py",
+ "test/unary_test.py",
+ # "test/vgg_block_nchw_test.py",
+ # "test/vgg_block_test.py",
],
- deps = [
- ":init_py",
+ additional_deps = [
+ ":tf_trt_integration_test_base",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_test_lib",
],
+ tags = [
+ "no_cuda_on_cpu_tap",
+ "no_windows",
+ "nomac",
+ ],
)
cc_library(
name = "utils",
+ srcs = ["convert/utils.cc"],
hdrs = ["convert/utils.h"],
+ copts = tf_copts(),
)