aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2018-05-22 13:14:18 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-22 13:16:53 -0700
commit4d134bad0403ebb5722144d8f859a04a5f21efc2 (patch)
tree188f2aa9f9702f8106a2c8e5d24027a09c833bcb
parentbf6644f9d274f549707d3f2a80c77e5eda163ebb (diff)
Move executor_test.cc to tensorflow/core/common_runtime/.
PiperOrigin-RevId: 197611583
-rw-r--r--tensorflow/core/BUILD38
-rw-r--r--tensorflow/core/common_runtime/executor_test.cc (renamed from tensorflow/core/distributed_runtime/executor_test.cc)0
-rw-r--r--tensorflow/core/common_runtime/testlib_ops.cc (renamed from tensorflow/core/distributed_runtime/rpc/grpc_testlib_ops.cc)20
-rw-r--r--tensorflow/core/distributed_runtime/BUILD19
-rw-r--r--tensorflow/core/distributed_runtime/master_test.cc2
-rw-r--r--tensorflow/core/distributed_runtime/rpc/BUILD16
6 files changed, 67 insertions, 28 deletions
diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD
index 5d63cd68ae..05b8423e15 100644
--- a/tensorflow/core/BUILD
+++ b/tensorflow/core/BUILD
@@ -1108,6 +1108,7 @@ cc_library(
":shape_inference_testutil",
":tensor_testutil",
":test",
+ ":testlib_ops",
"//tensorflow/cc:scope",
"//tensorflow/core/kernels:constant_op",
"//tensorflow/core/kernels:ops_testutil",
@@ -1115,6 +1116,18 @@ cc_library(
],
)
+cc_library(
+ name = "testlib_ops",
+ testonly = 1,
+ srcs = ["common_runtime/testlib_ops.cc"],
+ linkstatic = 1, # Seems to be needed since alwayslink is broken in bazel
+ deps = [
+ "//tensorflow/core:framework",
+ "//tensorflow/core:lib",
+ ],
+ alwayslink = 1,
+)
+
# This is a link-only library to provide a DirectSession
# implementation of the Session interface.
tf_cuda_library(
@@ -3749,6 +3762,31 @@ tf_cc_test(
)
tf_cc_test(
+ name = "common_runtime_executor_test",
+ size = "small",
+ srcs = ["common_runtime/executor_test.cc"],
+ linkstatic = tf_kernel_tests_linkstatic(),
+ deps = [
+ ":core",
+ ":core_cpu",
+ ":core_cpu_internal",
+ ":framework",
+ ":framework_internal",
+ ":lib",
+ ":lib_internal",
+ ":protos_all_cc",
+ ":test",
+ ":test_main",
+ ":testlib",
+ "//tensorflow/core/kernels:array",
+ "//tensorflow/core/kernels:control_flow_ops",
+ "//tensorflow/core/kernels:math",
+ "//tensorflow/core/kernels:random_ops",
+ "//tensorflow/core/kernels:state",
+ ],
+)
+
+tf_cc_test(
name = "common_runtime_function_test",
size = "small",
srcs = ["common_runtime/function_test.cc"],
diff --git a/tensorflow/core/distributed_runtime/executor_test.cc b/tensorflow/core/common_runtime/executor_test.cc
index e34224205b..e34224205b 100644
--- a/tensorflow/core/distributed_runtime/executor_test.cc
+++ b/tensorflow/core/common_runtime/executor_test.cc
diff --git a/tensorflow/core/distributed_runtime/rpc/grpc_testlib_ops.cc b/tensorflow/core/common_runtime/testlib_ops.cc
index 5597ee7a76..a0139c3ee5 100644
--- a/tensorflow/core/distributed_runtime/rpc/grpc_testlib_ops.cc
+++ b/tensorflow/core/common_runtime/testlib_ops.cc
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
+#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/platform/macros.h"
@@ -21,8 +22,12 @@ namespace tensorflow {
namespace test {
// ErrorOp::Compute returns an error.
-REGISTER_OP("Error").Input("in: T").Output("out: T").Attr("T: type").Attr(
- "message: string");
+REGISTER_OP("Error")
+ .Input("in: T")
+ .Output("out: T")
+ .Attr("T: type")
+ .Attr("message: string")
+ .SetShapeFn(shape_inference::UnknownShape);
class ErrorOp : public OpKernel {
public:
explicit ErrorOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
@@ -41,7 +46,8 @@ REGISTER_KERNEL_BUILDER(Name("Error").Device(DEVICE_CPU), ErrorOp);
REGISTER_OP("InvalidRefType")
.Output("out: Ref(TIn)")
.Attr("TIn: type")
- .Attr("TOut: type");
+ .Attr("TOut: type")
+ .SetShapeFn(shape_inference::UnknownShape);
class InvalidRefType : public OpKernel {
public:
explicit InvalidRefType(OpKernelConstruction* ctx) : OpKernel(ctx) {
@@ -63,8 +69,12 @@ REGISTER_KERNEL_BUILDER(Name("InvalidRefType").Device(DEVICE_CPU),
// DelayOp::AsyncCompute sleeps for "micros"-econd and then returns
// its input.
-REGISTER_OP("Delay").Input("in: T").Output("out: T").Attr("T: type").Attr(
- "micros: int");
+REGISTER_OP("Delay")
+ .Input("in: T")
+ .Output("out: T")
+ .Attr("T: type")
+ .Attr("micros: int")
+ .SetShapeFn(shape_inference::UnchangedShape);
class DelayOp : public AsyncOpKernel {
public:
explicit DelayOp(OpKernelConstruction* ctx) : AsyncOpKernel(ctx) {
diff --git a/tensorflow/core/distributed_runtime/BUILD b/tensorflow/core/distributed_runtime/BUILD
index 18b7069dbe..ead698d787 100644
--- a/tensorflow/core/distributed_runtime/BUILD
+++ b/tensorflow/core/distributed_runtime/BUILD
@@ -561,17 +561,19 @@ tf_cc_test(
],
)
-# TODO(mrry): Move executor_test.cc to ../common_runtime when once it no longer depends
-# on grpc_testlib.
-tf_cuda_cc_tests(
- name = "executor_tests",
+tf_cuda_cc_test(
+ name = "master_test",
size = "medium",
srcs = [
- "executor_test.cc",
- #"master_test.cc", # TODO(b/27683709): Re-enable when not flaky.
+ "master_test.cc",
],
linkstatic = tf_kernel_tests_linkstatic(),
- tags = tf_cuda_tests_tags(),
+ tags = tf_cuda_tests_tags() + [
+ "manual", # TODO(b/27683709): Re-enable when not flaky.
+ "notap", # TODO(b/27683709): Re-enable when not flaky.
+ "noguitar", # TODO(b/27683709): Re-enable when not flaky.
+ "nooss", # TODO(b/27683709): Re-enable when not flaky.
+ ],
deps = [
":master",
":remote_device",
@@ -588,6 +590,7 @@ tf_cuda_cc_tests(
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core/distributed_runtime/rpc:grpc_channel",
+ "//tensorflow/core/distributed_runtime/rpc:grpc_master_service_impl",
"//tensorflow/core/distributed_runtime/rpc:grpc_testlib",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/distributed_runtime/rpc:grpc_worker_cache",
@@ -648,10 +651,10 @@ tf_cuda_cc_test(
"//tensorflow/core:tensorflow",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
+ "//tensorflow/core:testlib",
"//tensorflow/core/distributed_runtime:server_lib",
"//tensorflow/core/distributed_runtime/rpc:grpc_server_lib",
"//tensorflow/core/distributed_runtime/rpc:grpc_session",
- "//tensorflow/core/distributed_runtime/rpc:grpc_testlib_ops",
"//tensorflow/core/kernels:aggregate_ops",
"//tensorflow/core/kernels:array",
],
diff --git a/tensorflow/core/distributed_runtime/master_test.cc b/tensorflow/core/distributed_runtime/master_test.cc
index f2c1f3489c..0826a90860 100644
--- a/tensorflow/core/distributed_runtime/master_test.cc
+++ b/tensorflow/core/distributed_runtime/master_test.cc
@@ -21,6 +21,7 @@ limitations under the License.
#include "grpc++/grpc++.h"
#include "tensorflow/core/distributed_runtime/rpc/grpc_channel.h"
+#include "tensorflow/core/distributed_runtime/rpc/grpc_master_service_impl.h"
#include "tensorflow/core/distributed_runtime/rpc/grpc_testlib.h"
#include "tensorflow/core/distributed_runtime/rpc/grpc_util.h"
#include "tensorflow/core/framework/allocator.h"
@@ -37,7 +38,6 @@ limitations under the License.
#include "tensorflow/core/platform/test.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/protobuf/master.pb.h"
-#include "tensorflow/core/protobuf/master_service.grpc.pb.h"
namespace tensorflow {
diff --git a/tensorflow/core/distributed_runtime/rpc/BUILD b/tensorflow/core/distributed_runtime/rpc/BUILD
index 40028ee241..4b2747f26d 100644
--- a/tensorflow/core/distributed_runtime/rpc/BUILD
+++ b/tensorflow/core/distributed_runtime/rpc/BUILD
@@ -314,18 +314,6 @@ tf_cc_binary(
],
)
-tf_cuda_library(
- name = "grpc_testlib_ops",
- testonly = 1,
- srcs = ["grpc_testlib_ops.cc"],
- linkstatic = 1, # Seems to be needed since alwayslink is broken in bazel
- deps = [
- "//tensorflow/core:framework",
- "//tensorflow/core:lib",
- ],
- alwayslink = 1,
-)
-
tf_cc_binary(
name = "grpc_testlib_server",
testonly = 1,
@@ -334,11 +322,11 @@ tf_cc_binary(
],
deps = [
":grpc_server_lib",
- ":grpc_testlib_ops",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
+ "//tensorflow/core:testlib",
"//tensorflow/core/distributed_runtime:server_lib",
"//tensorflow/core/kernels:constant_op",
"//tensorflow/core/kernels:cwise_op",
@@ -362,12 +350,12 @@ tf_cuda_library(
visibility = ["//tensorflow:__subpackages__"],
deps = [
":grpc_session",
- ":grpc_testlib_ops",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
+ "//tensorflow/core:testlib",
],
alwayslink = 1,
)