From 8ba31084528f63e623fb5f58d9ee09b148088c6d Mon Sep 17 00:00:00 2001 From: Derek Murray Date: Tue, 28 Apr 2020 09:49:04 -0700 Subject: [PATCH] [Build cleanup] Split "core_cpu_impl" into fine-grained targets (4/n). This changes moves the remaining modules in "core/graph/..." that depend on modules in "core/common_runtime/..." to "core/common_runtime/", and creates separate fine-grained targets for each of them: * "gradients.{h.cc}" * "graph_def_builder_util.{h,cc}" * "mkl_{layout,tfconversion}_pass.{h,cc}" * "quantize_training.{h,cc}" PiperOrigin-RevId: 308841156 Change-Id: I7774e2498f465290e7addd331625bd91d90acbac --- tensorflow/cc/BUILD | 1 + .../compiler/jit/cluster_scoping_pass_test.cc | 2 +- .../jit/compilability_check_util_test.cc | 2 +- .../compiler/jit/deadness_analysis_test.cc | 1 - .../jit/mark_for_compilation_pass_test.cc | 5 +- .../jit/partially_decluster_pass_test.cc | 2 +- ...resource_operation_safety_analysis_test.cc | 3 +- tensorflow/core/BUILD | 1 - tensorflow/core/common_runtime/BUILD | 178 +++++++++++++++++- .../eager/mkl_eager_op_rewrite.cc | 2 +- tensorflow/core/common_runtime/function.cc | 2 +- .../{graph => common_runtime}/gradients.cc | 5 +- .../{graph => common_runtime}/gradients.h | 6 +- .../graph_def_builder_util.cc | 4 +- .../graph_def_builder_util.h | 6 +- ...lacer_inspection_required_ops_pass_test.cc | 1 - .../core/common_runtime/lower_case_op_test.cc | 1 - .../lower_function_call_op_test.cc | 1 - .../lower_functional_ops_test.cc | 1 - .../core/common_runtime/lower_if_op_test.cc | 1 - .../common_runtime/lower_while_op_test.cc | 1 - .../mkl_layout_pass.cc | 2 +- .../mkl_layout_pass.h | 6 +- .../mkl_layout_pass_test.cc | 4 +- .../mkl_tfconversion_pass.cc | 5 +- .../mkl_tfconversion_pass.h | 6 +- .../mkl_tfconversion_pass_test.cc | 6 +- ...acer_inspection_required_ops_utils_test.cc | 1 - tensorflow/core/common_runtime/placer_test.cc | 2 +- .../quantize_training.cc | 6 +- .../quantize_training.h | 6 +- .../quantize_training_test.cc | 4 +- tensorflow/core/graph/BUILD | 78 +------- tensorflow/core/graph/algorithm_test.cc | 2 +- .../core/graph/collective_order_test.cc | 2 +- .../core/graph/graph_def_builder_test.cc | 2 +- tensorflow/core/graph/subgraph_test.cc | 2 +- tensorflow/core/kernels/function_ops.cc | 2 +- .../quantized_resize_bilinear_op_test.cc | 2 +- tensorflow/python/BUILD | 5 +- .../training/quantize_training_wrapper.cc | 2 +- .../tools/def_file_filter/symbols_pybind.txt | 2 +- 42 files changed, 229 insertions(+), 144 deletions(-) rename tensorflow/core/{graph => common_runtime}/gradients.cc (99%) rename tensorflow/core/{graph => common_runtime}/gradients.h (93%) rename tensorflow/core/{graph => common_runtime}/graph_def_builder_util.cc (88%) rename tensorflow/core/{graph => common_runtime}/graph_def_builder_util.h (86%) rename tensorflow/core/{graph => common_runtime}/mkl_layout_pass.cc (99%) rename tensorflow/core/{graph => common_runtime}/mkl_layout_pass.h (85%) rename tensorflow/core/{graph => common_runtime}/mkl_layout_pass_test.cc (99%) rename tensorflow/core/{graph => common_runtime}/mkl_tfconversion_pass.cc (99%) rename tensorflow/core/{graph => common_runtime}/mkl_tfconversion_pass.h (85%) rename tensorflow/core/{graph => common_runtime}/mkl_tfconversion_pass_test.cc (98%) rename tensorflow/core/{graph => common_runtime}/quantize_training.cc (99%) rename tensorflow/core/{graph => common_runtime}/quantize_training.h (92%) rename tensorflow/core/{graph => common_runtime}/quantize_training_test.cc (99%) diff --git a/tensorflow/cc/BUILD b/tensorflow/cc/BUILD index 19976cdada6..e8cb40f153b 100644 --- a/tensorflow/cc/BUILD +++ b/tensorflow/cc/BUILD @@ -182,6 +182,7 @@ cc_library_with_android_deps( deps = [ "//tensorflow/core:core_cpu", "//tensorflow/core:framework", + "//tensorflow/core:graph", "//tensorflow/core:lib", "//tensorflow/core:lib_internal", "//tensorflow/core:ops", diff --git a/tensorflow/compiler/jit/cluster_scoping_pass_test.cc b/tensorflow/compiler/jit/cluster_scoping_pass_test.cc index 5798d519bd7..be7a233d782 100644 --- a/tensorflow/compiler/jit/cluster_scoping_pass_test.cc +++ b/tensorflow/compiler/jit/cluster_scoping_pass_test.cc @@ -18,12 +18,12 @@ limitations under the License. #include "absl/container/flat_hash_map.h" #include "tensorflow/compiler/jit/defs.h" #include "tensorflow/compiler/jit/test_util.h" +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/public/session_options.h" diff --git a/tensorflow/compiler/jit/compilability_check_util_test.cc b/tensorflow/compiler/jit/compilability_check_util_test.cc index e6e49ae7957..3ea38e69ad9 100644 --- a/tensorflow/compiler/jit/compilability_check_util_test.cc +++ b/tensorflow/compiler/jit/compilability_check_util_test.cc @@ -21,12 +21,12 @@ limitations under the License. #include "tensorflow/cc/ops/standard_ops.h" #include "tensorflow/compiler/tf2xla/xla_op_kernel.h" #include "tensorflow/compiler/tf2xla/xla_op_registry.h" +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/framework/attr_value.pb.h" #include "tensorflow/core/framework/function.h" #include "tensorflow/core/framework/graph_to_functiondef.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/compiler/jit/deadness_analysis_test.cc b/tensorflow/compiler/jit/deadness_analysis_test.cc index 17438935af5..ad836835418 100644 --- a/tensorflow/compiler/jit/deadness_analysis_test.cc +++ b/tensorflow/compiler/jit/deadness_analysis_test.cc @@ -30,7 +30,6 @@ limitations under the License. #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/compiler/jit/mark_for_compilation_pass_test.cc b/tensorflow/compiler/jit/mark_for_compilation_pass_test.cc index c670f2e54f1..0ad29bcf620 100644 --- a/tensorflow/compiler/jit/mark_for_compilation_pass_test.cc +++ b/tensorflow/compiler/jit/mark_for_compilation_pass_test.cc @@ -13,8 +13,6 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/compiler/jit/mark_for_compilation_pass_test_helper.h" - #include "absl/container/flat_hash_map.h" #include "absl/memory/memory.h" #include "absl/strings/match.h" @@ -28,15 +26,16 @@ limitations under the License. #include "tensorflow/cc/ops/sendrecv_ops.h" #include "tensorflow/cc/ops/standard_ops.h" #include "tensorflow/compiler/jit/defs.h" +#include "tensorflow/compiler/jit/mark_for_compilation_pass_test_helper.h" #include "tensorflow/compiler/jit/node_matchers.h" #include "tensorflow/compiler/tf2xla/xla_op_kernel.h" #include "tensorflow/compiler/tf2xla/xla_op_registry.h" +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/compiler/jit/partially_decluster_pass_test.cc b/tensorflow/compiler/jit/partially_decluster_pass_test.cc index d352ec8977b..193bec58550 100644 --- a/tensorflow/compiler/jit/partially_decluster_pass_test.cc +++ b/tensorflow/compiler/jit/partially_decluster_pass_test.cc @@ -28,6 +28,7 @@ limitations under the License. #include "tensorflow/compiler/tf2xla/cc/ops/xla_ops.h" #include "tensorflow/compiler/tf2xla/xla_op_kernel.h" #include "tensorflow/compiler/tf2xla/xla_op_registry.h" +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/framework/function.h" #include "tensorflow/core/framework/function.pb.h" #include "tensorflow/core/framework/node_def_util.h" @@ -35,7 +36,6 @@ limitations under the License. #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/compiler/jit/resource_operation_safety_analysis_test.cc b/tensorflow/compiler/jit/resource_operation_safety_analysis_test.cc index 67304412fd3..5529a7cbc72 100644 --- a/tensorflow/compiler/jit/resource_operation_safety_analysis_test.cc +++ b/tensorflow/compiler/jit/resource_operation_safety_analysis_test.cc @@ -26,12 +26,11 @@ limitations under the License. #include "tensorflow/compiler/jit/defs.h" #include "tensorflow/compiler/tf2xla/xla_op_kernel.h" #include "tensorflow/compiler/tf2xla/xla_op_registry.h" +#include "tensorflow/core/common_runtime/graph_constructor.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/algorithm.h" -#include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD index add73c4a41f..19097fb8922 100644 --- a/tensorflow/core/BUILD +++ b/tensorflow/core/BUILD @@ -2796,7 +2796,6 @@ tf_cc_test_mkl( name = "mkl_related_tests", size = "small", srcs = [ - "//tensorflow/core/graph:mkl_related_tests", "//tensorflow/core/util:mkl_util_test_srcs", ], linkstatic = 1, diff --git a/tensorflow/core/common_runtime/BUILD b/tensorflow/core/common_runtime/BUILD index 2edeb1fbff2..8a4f80ba3bc 100644 --- a/tensorflow/core/common_runtime/BUILD +++ b/tensorflow/core/common_runtime/BUILD @@ -58,7 +58,9 @@ tf_cuda_library( "device_factory.h", "function.h", "function_optimization_registry.h", + "gradients.h", "graph_constructor.h", + "graph_def_builder_util.h", "optimization_registry.h", "shape_refiner.h", "//tensorflow/core/graph:core_cpu_headers", @@ -157,6 +159,7 @@ filegroup( "function_body.h", "function_utils.h", "graph_constructor.h", + "graph_def_builder_util.h", "graph_optimizer.h", "graph_runner.h", "inline_function_utils.h", @@ -173,7 +176,6 @@ filegroup( tf_cuda_library( name = "core_cpu_base_no_ops", srcs = [ - "//tensorflow/core/graph:core_cpu_base_no_ops_srcs", "//tensorflow/core/public:session_options.h", "//tensorflow/core/public:version.h", ], @@ -194,6 +196,7 @@ tf_cuda_library( "//third_party/eigen3", ] + if_static([ ":graph_constructor", + ":graph_def_builder_util", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/strings", ]), @@ -225,6 +228,8 @@ filegroup( "executor.h", "executor_factory.h", "function_optimization_registry.h", + "graph_optimizer.h", + "gradients.h", "input_colocation_exemption_registry.h", "isolate_placer_inspection_required_ops_pass.h", "local_device.h", @@ -236,12 +241,14 @@ filegroup( "lower_while_op.h", "memory_types.h", "mkl_cpu_allocator.h", + "mkl_layout_pass.h", "optimization_registry.h", "partitioning_utils.h", "placer.h", "process_util.h", "inspecting_placer.h", "profile_handler.h", + "quantize_training.h", "renamed_device.h", "rendezvous_mgr.h", "rendezvous_util.h", @@ -256,7 +263,6 @@ filegroup( "threadpool_device.h", "process_state.h", "pool_allocator.h", - "//tensorflow/core/graph:core_cpu_lib_headers", ] + if_mkl(["//tensorflow/core/graph:mkl_graph_util_header"]), ) @@ -606,6 +612,23 @@ cc_library( ], ) +cc_library( + name = "gradients", + srcs = ["gradients.cc"], + hdrs = ["gradients.h"], + deps = [ + ":device", + ":executor", + ":graph_constructor", + ":graph_optimizer", + "//tensorflow/core:framework", + "//tensorflow/core:graph", + "//tensorflow/core:lib", + "//tensorflow/core:lib_internal", + "//tensorflow/core:protos_all_cc", + ], +) + # This library also includes "eval_const_tensor", "graph_runner", and # "shape_refiner", because there are circular dependencies between these # modules. @@ -646,6 +669,18 @@ cc_library( ], ) +cc_library( + name = "graph_def_builder_util", + srcs = ["graph_def_builder_util.cc"], + hdrs = ["graph_def_builder_util.h"], + copts = tf_copts(), + deps = [ + ":graph_constructor", + "//tensorflow/core:graph", + "//tensorflow/core:lib", + ], +) + cc_library( name = "graph_optimizer", srcs = ["graph_optimizer.cc"], @@ -793,6 +828,36 @@ cc_library( ] + mkl_deps(), ) +cc_library( + name = "mkl_layout_pass", + srcs = ["mkl_layout_pass.cc"], + hdrs = ["mkl_layout_pass.h"], + copts = tf_copts(), + deps = [ + ":optimization_registry", + "//tensorflow/core:framework", + "//tensorflow/core:framework_internal", + "//tensorflow/core:graph", + "//tensorflow/core:lib", + ] + mkl_deps(), + alwayslink = 1, +) + +cc_library( + name = "mkl_tfconversion_pass", + srcs = ["mkl_tfconversion_pass.cc"], + hdrs = ["mkl_tfconversion_pass.h"], + copts = tf_copts(), + deps = [ + ":optimization_registry", + "//tensorflow/core:framework", + "//tensorflow/core:framework_internal", + "//tensorflow/core:graph", + "//tensorflow/core:lib", + ] + mkl_deps(), + alwayslink = 1, +) + cc_library( name = "optimization_registry", srcs = ["optimization_registry.cc"], @@ -923,6 +988,32 @@ cc_library( ], ) +filegroup( + name = "quantize_training_hdrs", + srcs = [ + "quantize_training.h", + ], + visibility = [ + "//tensorflow/python:__pkg__", + ], +) + +cc_library( + name = "quantize_training", + srcs = ["quantize_training.cc"], + hdrs = [":quantize_training_hdrs"], + copts = tf_copts(), + deps = [ + ":executor", + ":graph_constructor", + ":memory_types", + ":session_options", + "//tensorflow/core:framework", + "//tensorflow/core:graph", + "//tensorflow/core:lib", + ], +) + cc_library( name = "renamed_device", srcs = ["renamed_device.cc"], @@ -1215,7 +1306,6 @@ tf_cuda_library( "placer_inspection_required_ops_utils.cc", "placer_inspection_required_ops_utils.h", "process_function_library_runtime.cc", - "//tensorflow/core/graph:core_cpu_impl_srcs", ], hdrs = [":core_cpu_lib_headers"], copts = tf_copts(), @@ -1226,6 +1316,7 @@ tf_cuda_library( ":executor_factory", ":function_body", ":function_optimization_registry", + ":gradients", ":graph_constructor", ":graph_optimizer", ":graph_view", @@ -1285,12 +1376,15 @@ tf_cuda_library( ":device_resolver_local", ":device_set", ":entry", + ":graph_def_builder_util", ":graph_view", ":hierarchical_tree_broadcaster", ":input_colocation_exemption_registry", ":local_device", ":memory_types", ":mkl_cpu_allocator", + ":mkl_layout_pass", + ":mkl_tfconversion_pass", ":optimization_registry", ":parallel_concat_optimizer", ":partitioning_utils", @@ -1299,6 +1393,7 @@ tf_cuda_library( ":process_state", ":process_util", ":profile_handler", + ":quantize_training", ":renamed_device", ":rendezvous_mgr", ":rendezvous_util", @@ -2268,3 +2363,80 @@ tf_cc_test( "//tensorflow/core:testlib", ], ) + +tf_cc_test_mkl( + name = "mkl_related_tests", + size = "small", + srcs = [ + "mkl_layout_pass_test.cc", + "mkl_tfconversion_pass_test.cc", + ], + linkstatic = 1, + deps = [ + ":core", + ":core_cpu", + ":core_cpu_internal", + ":direct_session_internal", + "//tensorflow/core:framework", + "//tensorflow/core:framework_internal", + "//tensorflow/core:lib", + "//tensorflow/core:lib_internal", + "//tensorflow/core:ops", + "//tensorflow/core:protos_all_cc", + "//tensorflow/core:test", + "//tensorflow/core:test_main", + "//tensorflow/core:testlib", + "//tensorflow/cc:cc_ops", + "//tensorflow/cc:scope", + "//tensorflow/cc:sendrecv_ops", + "//tensorflow/core/kernels:ops_util", + "//third_party/eigen3", + ] + if_mkl([ + "//tensorflow/core/kernels:mkl_aggregate_ops", + "//tensorflow/core/kernels:mkl_batch_matmul_op", + "//tensorflow/core/kernels:mkl_concat_op", + "//tensorflow/core/kernels:mkl_conv_op", + "//tensorflow/core/kernels:mkl_cwise_ops_common", + "//tensorflow/core/kernels:mkl_dequantize_op", + "//tensorflow/core/kernels:mkl_fused_batch_norm_op", + "//tensorflow/core/kernels:mkl_identity_op", + "//tensorflow/core/kernels:mkl_input_conversion_op", + "//tensorflow/core/kernels:mkl_lrn_op", + "//tensorflow/core/kernels:mkl_matmul_op", + "//tensorflow/core/kernels:mkl_pooling_ops", + "//tensorflow/core/kernels:mkl_qmatmul_op", + "//tensorflow/core/kernels:mkl_quantize_op", + "//tensorflow/core/kernels:mkl_relu_op", + "//tensorflow/core/kernels:mkl_reshape_op", + "//tensorflow/core/kernels:mkl_slice_op", + "//tensorflow/core/kernels:mkl_softmax_op", + "//tensorflow/core/kernels:mkl_tfconv_op", + "//tensorflow/core/kernels:mkl_transpose_op", + "//tensorflow/core/kernels:mkl_tmp_bf16_ops", + ]), +) + +# TODO(bmzhao): Refactor this target to use granular dependencies +# after stage 4 of the TF build refactor is complete: +# https://github.com/tensorflow/community/pull/179 +tf_cc_test( + name = "quantize_training_test", + srcs = ["quantize_training_test.cc"], + deps = [ + ":core_cpu", + ":core_cpu_internal", + ":direct_session_internal", + "//tensorflow/core", + "//tensorflow/core:all_kernels", + "//tensorflow/core:framework", + "//tensorflow/core:framework_internal", + "//tensorflow/core:lib", + "//tensorflow/core:lib_internal", + "//tensorflow/core:ops", + "//tensorflow/core:protos_all_cc", + "//tensorflow/core:test", + "//tensorflow/core:test_main", + "//tensorflow/core:testlib", + "//tensorflow/core/util:protos_test_cc", + ], +) diff --git a/tensorflow/core/common_runtime/eager/mkl_eager_op_rewrite.cc b/tensorflow/core/common_runtime/eager/mkl_eager_op_rewrite.cc index c32cf0e8464..2d4ae338144 100644 --- a/tensorflow/core/common_runtime/eager/mkl_eager_op_rewrite.cc +++ b/tensorflow/core/common_runtime/eager/mkl_eager_op_rewrite.cc @@ -17,8 +17,8 @@ limitations under the License. #include #include "tensorflow/core/common_runtime/eager/eager_op_rewrite_registry.h" +#include "tensorflow/core/common_runyime/mkl_layout_pass.h" #include "tensorflow/core/graph/mkl_graph_util.h" -#include "tensorflow/core/graph/mkl_layout_pass.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/util/mkl_util.h" #include "tensorflow/core/util/util.h" diff --git a/tensorflow/core/common_runtime/function.cc b/tensorflow/core/common_runtime/function.cc index a9e12d2385b..167ff9b97e3 100644 --- a/tensorflow/core/common_runtime/function.cc +++ b/tensorflow/core/common_runtime/function.cc @@ -24,6 +24,7 @@ limitations under the License. #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/executor.h" #include "tensorflow/core/common_runtime/executor_factory.h" +#include "tensorflow/core/common_runtime/gradients.h" #include "tensorflow/core/common_runtime/graph_constructor.h" #include "tensorflow/core/common_runtime/graph_optimizer.h" #include "tensorflow/core/common_runtime/inline_function_utils.h" @@ -38,7 +39,6 @@ limitations under the License. #include "tensorflow/core/framework/versions.pb.h" #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/graph/control_flow.h" -#include "tensorflow/core/graph/gradients.h" #include "tensorflow/core/graph/node_builder.h" #include "tensorflow/core/graph/optimizer_cse.h" #include "tensorflow/core/lib/core/threadpool.h" diff --git a/tensorflow/core/graph/gradients.cc b/tensorflow/core/common_runtime/gradients.cc similarity index 99% rename from tensorflow/core/graph/gradients.cc rename to tensorflow/core/common_runtime/gradients.cc index ac4fcb7c4bf..5230f354df9 100644 --- a/tensorflow/core/graph/gradients.cc +++ b/tensorflow/core/common_runtime/gradients.cc @@ -13,11 +13,14 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include "tensorflow/core/common_runtime/gradients.h" + #include #include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/executor.h" +#include "tensorflow/core/common_runtime/graph_constructor.h" #include "tensorflow/core/common_runtime/graph_optimizer.h" #include "tensorflow/core/framework/function.h" #include "tensorflow/core/framework/node_def.pb.h" @@ -25,8 +28,6 @@ limitations under the License. #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/graph/algorithm.h" -#include "tensorflow/core/graph/gradients.h" -#include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/optimizer_cse.h" #include "tensorflow/core/lib/gtl/map_util.h" #include "tensorflow/core/platform/macros.h" diff --git a/tensorflow/core/graph/gradients.h b/tensorflow/core/common_runtime/gradients.h similarity index 93% rename from tensorflow/core/graph/gradients.h rename to tensorflow/core/common_runtime/gradients.h index ddfed084b09..1f86af5298d 100644 --- a/tensorflow/core/graph/gradients.h +++ b/tensorflow/core/common_runtime/gradients.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_CORE_GRAPH_GRADIENTS_H_ -#define TENSORFLOW_CORE_GRAPH_GRADIENTS_H_ +#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_GRADIENTS_H_ +#define TENSORFLOW_CORE_COMMON_RUNTIME_GRADIENTS_H_ #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/lib/core/status.h" @@ -55,4 +55,4 @@ Status AddSymbolicGradients(gtl::ArraySlice y_node_outputs, } // namespace tensorflow -#endif // TENSORFLOW_CORE_GRAPH_GRADIENTS_H_ +#endif // TENSORFLOW_CORE_COMMON_RUNTIME_GRADIENTS_H_ diff --git a/tensorflow/core/graph/graph_def_builder_util.cc b/tensorflow/core/common_runtime/graph_def_builder_util.cc similarity index 88% rename from tensorflow/core/graph/graph_def_builder_util.cc rename to tensorflow/core/common_runtime/graph_def_builder_util.cc index 3ca9f8a21ff..4062fe2a4a8 100644 --- a/tensorflow/core/graph/graph_def_builder_util.cc +++ b/tensorflow/core/common_runtime/graph_def_builder_util.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/core/graph/graph_def_builder_util.h" +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" -#include "tensorflow/core/graph/graph_constructor.h" +#include "tensorflow/core/common_runtime/graph_constructor.h" namespace tensorflow { diff --git a/tensorflow/core/graph/graph_def_builder_util.h b/tensorflow/core/common_runtime/graph_def_builder_util.h similarity index 86% rename from tensorflow/core/graph/graph_def_builder_util.h rename to tensorflow/core/common_runtime/graph_def_builder_util.h index 4a157e5b71d..01f3d710460 100644 --- a/tensorflow/core/graph/graph_def_builder_util.h +++ b/tensorflow/core/common_runtime/graph_def_builder_util.h @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_CORE_GRAPH_GRAPH_DEF_BUILDER_UTIL_H_ -#define TENSORFLOW_CORE_GRAPH_GRAPH_DEF_BUILDER_UTIL_H_ +#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_GRAPH_DEF_BUILDER_UTIL_H_ +#define TENSORFLOW_CORE_COMMON_RUNTIME_GRAPH_DEF_BUILDER_UTIL_H_ #include "tensorflow/core/graph/graph_def_builder.h" #include "tensorflow/core/lib/core/status.h" @@ -32,4 +32,4 @@ Status GraphDefBuilderToGraph(const GraphDefBuilder& builder, Graph* graph); } // namespace tensorflow -#endif // TENSORFLOW_CORE_GRAPH_GRAPH_DEF_BUILDER_UTIL_H_ +#endif // TENSORFLOW_CORE_COMMON_RUNTIME_GRAPH_DEF_BUILDER_UTIL_H_ diff --git a/tensorflow/core/common_runtime/isolate_placer_inspection_required_ops_pass_test.cc b/tensorflow/core/common_runtime/isolate_placer_inspection_required_ops_pass_test.cc index c5e61dbefbb..13ed50f264f 100644 --- a/tensorflow/core/common_runtime/isolate_placer_inspection_required_ops_pass_test.cc +++ b/tensorflow/core/common_runtime/isolate_placer_inspection_required_ops_pass_test.cc @@ -27,7 +27,6 @@ limitations under the License. #include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/util/equal_graph_def.h" diff --git a/tensorflow/core/common_runtime/lower_case_op_test.cc b/tensorflow/core/common_runtime/lower_case_op_test.cc index 0ed46fb25ed..185d7b9d502 100644 --- a/tensorflow/core/common_runtime/lower_case_op_test.cc +++ b/tensorflow/core/common_runtime/lower_case_op_test.cc @@ -28,7 +28,6 @@ limitations under the License. #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/common_runtime/lower_function_call_op_test.cc b/tensorflow/core/common_runtime/lower_function_call_op_test.cc index 1a88f93737f..600c422c8f5 100644 --- a/tensorflow/core/common_runtime/lower_function_call_op_test.cc +++ b/tensorflow/core/common_runtime/lower_function_call_op_test.cc @@ -28,7 +28,6 @@ limitations under the License. #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/common_runtime/lower_functional_ops_test.cc b/tensorflow/core/common_runtime/lower_functional_ops_test.cc index a2c530e7429..34faf7f80f1 100644 --- a/tensorflow/core/common_runtime/lower_functional_ops_test.cc +++ b/tensorflow/core/common_runtime/lower_functional_ops_test.cc @@ -28,7 +28,6 @@ limitations under the License. #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/common_runtime/lower_if_op_test.cc b/tensorflow/core/common_runtime/lower_if_op_test.cc index 1990480f079..cf7d35409bb 100644 --- a/tensorflow/core/common_runtime/lower_if_op_test.cc +++ b/tensorflow/core/common_runtime/lower_if_op_test.cc @@ -28,7 +28,6 @@ limitations under the License. #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/common_runtime/lower_while_op_test.cc b/tensorflow/core/common_runtime/lower_while_op_test.cc index a1ae5924718..0fc005cfb6f 100644 --- a/tensorflow/core/common_runtime/lower_while_op_test.cc +++ b/tensorflow/core/common_runtime/lower_while_op_test.cc @@ -26,7 +26,6 @@ limitations under the License. #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/graph/mkl_layout_pass.cc b/tensorflow/core/common_runtime/mkl_layout_pass.cc similarity index 99% rename from tensorflow/core/graph/mkl_layout_pass.cc rename to tensorflow/core/common_runtime/mkl_layout_pass.cc index 9c838656a54..2941845a604 100644 --- a/tensorflow/core/graph/mkl_layout_pass.cc +++ b/tensorflow/core/common_runtime/mkl_layout_pass.cc @@ -17,7 +17,7 @@ limitations under the License. // all over the place, we should log an error and execute the original graph. #ifdef INTEL_MKL -#include "tensorflow/core/graph/mkl_layout_pass.h" +#include "tensorflow/core/common_runtime/mkl_layout_pass.h" #include #include diff --git a/tensorflow/core/graph/mkl_layout_pass.h b/tensorflow/core/common_runtime/mkl_layout_pass.h similarity index 85% rename from tensorflow/core/graph/mkl_layout_pass.h rename to tensorflow/core/common_runtime/mkl_layout_pass.h index e7175149df8..6b5c586ceab 100644 --- a/tensorflow/core/graph/mkl_layout_pass.h +++ b/tensorflow/core/common_runtime/mkl_layout_pass.h @@ -15,8 +15,8 @@ limitations under the License. // A graph pass that rewrites graph for propagating MKL layout as a tensor -#ifndef TENSORFLOW_CORE_GRAPH_MKL_LAYOUT_PASS_H_ -#define TENSORFLOW_CORE_GRAPH_MKL_LAYOUT_PASS_H_ +#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_MKL_LAYOUT_PASS_H_ +#define TENSORFLOW_CORE_COMMON_RUNTIME_MKL_LAYOUT_PASS_H_ #ifdef INTEL_MKL @@ -33,4 +33,4 @@ extern bool RunMklLayoutRewritePass(std::unique_ptr* g); #endif -#endif // TENSORFLOW_CORE_GRAPH_MKL_LAYOUT_PASS_H_ +#endif // TENSORFLOW_CORE_COMMON_RUNTIME_MKL_LAYOUT_PASS_H_ diff --git a/tensorflow/core/graph/mkl_layout_pass_test.cc b/tensorflow/core/common_runtime/mkl_layout_pass_test.cc similarity index 99% rename from tensorflow/core/graph/mkl_layout_pass_test.cc rename to tensorflow/core/common_runtime/mkl_layout_pass_test.cc index d81a21d9d62..c6d5331852e 100644 --- a/tensorflow/core/graph/mkl_layout_pass_test.cc +++ b/tensorflow/core/common_runtime/mkl_layout_pass_test.cc @@ -15,15 +15,15 @@ limitations under the License. #if defined(INTEL_MKL) && defined(ENABLE_MKL) -#include "tensorflow/core/graph/mkl_layout_pass.h" +#include "tensorflow/core/common_runtime/mkl_layout_pass.h" #include #include +#include "tensorflow/core/common_runtime/graph_constructor.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/graph/graph.h" -#include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/mkl_graph_util.h" #include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/kernels/ops_util.h" diff --git a/tensorflow/core/graph/mkl_tfconversion_pass.cc b/tensorflow/core/common_runtime/mkl_tfconversion_pass.cc similarity index 99% rename from tensorflow/core/graph/mkl_tfconversion_pass.cc rename to tensorflow/core/common_runtime/mkl_tfconversion_pass.cc index 95de6883da3..6f22c9c62ae 100644 --- a/tensorflow/core/graph/mkl_tfconversion_pass.cc +++ b/tensorflow/core/common_runtime/mkl_tfconversion_pass.cc @@ -15,6 +15,8 @@ limitations under the License. #ifdef INTEL_MKL +#include "tensorflow/core/common_runtime/mkl_tfconversion_pass.h" + #include #include #include @@ -26,6 +28,7 @@ limitations under the License. #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/graph/graph.h" +#include "tensorflow/core/graph/mkl_graph_util.h" #include "tensorflow/core/graph/node_builder.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/gtl/map_util.h" @@ -33,8 +36,6 @@ limitations under the License. #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/util/util.h" -#include "tensorflow/core/graph/mkl_graph_util.h" -#include "tensorflow/core/graph/mkl_tfconversion_pass.h" namespace tensorflow { diff --git a/tensorflow/core/graph/mkl_tfconversion_pass.h b/tensorflow/core/common_runtime/mkl_tfconversion_pass.h similarity index 85% rename from tensorflow/core/graph/mkl_tfconversion_pass.h rename to tensorflow/core/common_runtime/mkl_tfconversion_pass.h index 84e50ee6e0d..899da21881a 100644 --- a/tensorflow/core/graph/mkl_tfconversion_pass.h +++ b/tensorflow/core/common_runtime/mkl_tfconversion_pass.h @@ -15,8 +15,8 @@ limitations under the License. // An optimization pass that inserts MklToTf conversion nodes in the graph -#ifndef TENSORFLOW_CORE_GRAPH_MKL_TFCONVERSION_PASS_H_ -#define TENSORFLOW_CORE_GRAPH_MKL_TFCONVERSION_PASS_H_ +#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_MKL_TFCONVERSION_PASS_H_ +#define TENSORFLOW_CORE_COMMON_RUNTIME_MKL_TFCONVERSION_PASS_H_ #ifdef INTEL_MKL @@ -37,4 +37,4 @@ extern bool InsertMklToTfConversionNodes(std::unique_ptr* g); #endif -#endif // TENSORFLOW_CORE_GRAPH_MKL_TFCONVERSION_PASS_H_ +#endif // TENSORFLOW_CORE_COMMON_RUNTIME_MKL_TFCONVERSION_PASS_H_ diff --git a/tensorflow/core/graph/mkl_tfconversion_pass_test.cc b/tensorflow/core/common_runtime/mkl_tfconversion_pass_test.cc similarity index 98% rename from tensorflow/core/graph/mkl_tfconversion_pass_test.cc rename to tensorflow/core/common_runtime/mkl_tfconversion_pass_test.cc index b8235e5140e..25737838fba 100644 --- a/tensorflow/core/graph/mkl_tfconversion_pass_test.cc +++ b/tensorflow/core/common_runtime/mkl_tfconversion_pass_test.cc @@ -15,16 +15,16 @@ limitations under the License. #if defined(INTEL_MKL) && defined(ENABLE_MKL) -#include "tensorflow/core/graph/mkl_tfconversion_pass.h" -#include "tensorflow/core/graph/mkl_graph_util.h" +#include "tensorflow/core/common_runtime/mkl_tfconversion_pass.h" #include #include +#include "tensorflow/core/common_runtime/graph_constructor.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/graph/graph.h" -#include "tensorflow/core/graph/graph_constructor.h" +#include "tensorflow/core/graph/mkl_graph_util.h" #include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/random/simple_philox.h" diff --git a/tensorflow/core/common_runtime/placer_inspection_required_ops_utils_test.cc b/tensorflow/core/common_runtime/placer_inspection_required_ops_utils_test.cc index aa619cbd105..b04f3ece2e6 100644 --- a/tensorflow/core/common_runtime/placer_inspection_required_ops_utils_test.cc +++ b/tensorflow/core/common_runtime/placer_inspection_required_ops_utils_test.cc @@ -24,7 +24,6 @@ limitations under the License. #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/common_runtime/placer_test.cc b/tensorflow/core/common_runtime/placer_test.cc index 0a12714ba7c..e0e887e7d66 100644 --- a/tensorflow/core/common_runtime/placer_test.cc +++ b/tensorflow/core/common_runtime/placer_test.cc @@ -25,6 +25,7 @@ limitations under the License. #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/common_runtime/device_set.h" #include "tensorflow/core/common_runtime/graph_constructor.h" +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/common_runtime/optimization_registry.h" #include "tensorflow/core/framework/device_attributes.pb.h" #include "tensorflow/core/framework/function.h" @@ -36,7 +37,6 @@ limitations under the License. #include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" diff --git a/tensorflow/core/graph/quantize_training.cc b/tensorflow/core/common_runtime/quantize_training.cc similarity index 99% rename from tensorflow/core/graph/quantize_training.cc rename to tensorflow/core/common_runtime/quantize_training.cc index 4670e7a543c..3060090c1e1 100644 --- a/tensorflow/core/graph/quantize_training.cc +++ b/tensorflow/core/common_runtime/quantize_training.cc @@ -13,16 +13,14 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include "tensorflow/core/common_runtime/quantize_training.h" + #include #include #include #include #include -#include "tensorflow/core/graph/quantize_training.h" - -#include "tensorflow/core/common_runtime/executor.h" -#include "tensorflow/core/common_runtime/function.h" #include "tensorflow/core/common_runtime/memory_types.h" #include "tensorflow/core/framework/log_memory.h" #include "tensorflow/core/framework/op_kernel.h" diff --git a/tensorflow/core/graph/quantize_training.h b/tensorflow/core/common_runtime/quantize_training.h similarity index 92% rename from tensorflow/core/graph/quantize_training.h rename to tensorflow/core/common_runtime/quantize_training.h index dc3d7e3b1f2..7822ac498c3 100644 --- a/tensorflow/core/graph/quantize_training.h +++ b/tensorflow/core/common_runtime/quantize_training.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_CORE_GRAPH_QUANTIZE_TRAINING_H_ -#define TENSORFLOW_CORE_GRAPH_QUANTIZE_TRAINING_H_ +#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_QUANTIZE_TRAINING_H_ +#define TENSORFLOW_CORE_COMMON_RUNTIME_QUANTIZE_TRAINING_H_ #include "tensorflow/core/graph/graph.h" @@ -53,4 +53,4 @@ Status DoQuantizeTrainingOnGraphDef(const GraphDef& input_graphdef, } // namespace tensorflow -#endif // TENSORFLOW_CORE_GRAPH_QUANTIZE_TRAINING_H_ +#endif // TENSORFLOW_CORE_COMMON_RUNTIME_QUANTIZE_TRAINING_H_ diff --git a/tensorflow/core/graph/quantize_training_test.cc b/tensorflow/core/common_runtime/quantize_training_test.cc similarity index 99% rename from tensorflow/core/graph/quantize_training_test.cc rename to tensorflow/core/common_runtime/quantize_training_test.cc index 0e55a1ae3b8..88ceb06996e 100644 --- a/tensorflow/core/graph/quantize_training_test.cc +++ b/tensorflow/core/common_runtime/quantize_training_test.cc @@ -13,13 +13,13 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include "tensorflow/core/common_runtime/quantize_training.h" + #include #include #include #include -#include "tensorflow/core/graph/quantize_training.h" - #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/common_runtime/device_mgr.h" #include "tensorflow/core/framework/node_def_util.h" diff --git a/tensorflow/core/graph/BUILD b/tensorflow/core/graph/BUILD index 36fae822623..65e4175793b 100644 --- a/tensorflow/core/graph/BUILD +++ b/tensorflow/core/graph/BUILD @@ -18,31 +18,6 @@ cc_library( hdrs = ["mkl_graph_util.h"], ) -# TODO(bmzhao): Refactor this target to use granular dependencies -# after stage 4 of the TF build refactor is complete: -# https://github.com/tensorflow/community/pull/179 -tf_cc_test( - name = "quantize_training_test", - srcs = ["quantize_training_test.cc"], - deps = [ - "//tensorflow/core", - "//tensorflow/core:all_kernels", - "//tensorflow/core:core_cpu", - "//tensorflow/core:core_cpu_internal", - "//tensorflow/core:direct_session_internal", - "//tensorflow/core:framework", - "//tensorflow/core:framework_internal", - "//tensorflow/core:lib", - "//tensorflow/core:lib_internal", - "//tensorflow/core:ops", - "//tensorflow/core:protos_all_cc", - "//tensorflow/core:test", - "//tensorflow/core:test_main", - "//tensorflow/core:testlib", - "//tensorflow/core/util:protos_test_cc", - ], -) - tf_cc_test( name = "collective_order_test", size = "small", @@ -69,11 +44,9 @@ filegroup( srcs = [ "algorithm.h", "default_device.h", - "gradients.h", "graph.h", "graph_constructor.h", "graph_def_builder.h", - "graph_def_builder_util.h", "graph_node_util.h", "node_builder.h", "validate.h", @@ -110,7 +83,7 @@ filegroup( # Note(bmzhao): This target is a holdover from the GRAPH_HDRS array # in tensorflow/core/BUILD. This target contains all '.h' files under # tensorflow/core/graph, except for the following: -# 'benchmark_testlib.h', 'mkl_graph_util.h', 'gradients.h', 'quantize_training.h'. +# 'benchmark_testlib.h'. filegroup( name = "graph_headers", srcs = [ @@ -124,11 +97,8 @@ filegroup( "graph.h", "graph_constructor.h", # NOTE(mrry): Don't include the .cc since it depends on common_runtime. "graph_def_builder.h", - "graph_def_builder_util.h", "graph_node_util.h", "graph_partition.h", - "mkl_layout_pass.h", - "mkl_tfconversion_pass.h", "node_builder.h", "optimizer_cse.h", "subgraph.h", @@ -155,32 +125,6 @@ filegroup( ], ) -filegroup( - name = "core_cpu_lib_headers", - srcs = [ - "gradients.h", - "quantize_training.h", - ], -) - -# This file depends on common_runtime. -filegroup( - name = "core_cpu_base_no_ops_srcs", - srcs = [ - "graph_def_builder_util.cc", - ], -) - -filegroup( - name = "core_cpu_impl_srcs", - srcs = [ - "gradients.cc", - "mkl_layout_pass.cc", - "mkl_tfconversion_pass.cc", - "quantize_training.cc", - ], -) - filegroup( name = "testlib_headers", srcs = [ @@ -218,16 +162,6 @@ filegroup( ], ) -filegroup( - name = "quantize_training_hdrs", - srcs = [ - "quantize_training.h", - ], - visibility = [ - "//tensorflow/python:__pkg__", - ], -) - filegroup( name = "mobile_srcs_only_runtime", srcs = [ @@ -245,30 +179,20 @@ filegroup( "default_device.h", "edgeset.cc", "edgeset.h", - "gradients.cc", - "gradients.h", "graph.cc", "graph.h", "graph_constructor.h", "graph_def_builder.cc", "graph_def_builder.h", - "graph_def_builder_util.cc", - "graph_def_builder_util.h", "graph_node_util.cc", "graph_node_util.h", "graph_partition.cc", "graph_partition.h", "mkl_graph_util.h", - "mkl_layout_pass.cc", - "mkl_layout_pass.h", - "mkl_tfconversion_pass.cc", - "mkl_tfconversion_pass.h", "node_builder.cc", "node_builder.h", "optimizer_cse.cc", "optimizer_cse.h", - "quantize_training.cc", - "quantize_training.h", "subgraph.cc", "subgraph.h", "tensor_id.cc", diff --git a/tensorflow/core/graph/algorithm_test.cc b/tensorflow/core/graph/algorithm_test.cc index cb321ed2c02..9c0203b6b15 100644 --- a/tensorflow/core/graph/algorithm_test.cc +++ b/tensorflow/core/graph/algorithm_test.cc @@ -18,11 +18,11 @@ limitations under the License. #include #include +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/graph/benchmark_testlib.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/graph/subgraph.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status.h" diff --git a/tensorflow/core/graph/collective_order_test.cc b/tensorflow/core/graph/collective_order_test.cc index 9a158e5c3fd..0f5c424c29e 100644 --- a/tensorflow/core/graph/collective_order_test.cc +++ b/tensorflow/core/graph/collective_order_test.cc @@ -15,9 +15,9 @@ limitations under the License. #include "tensorflow/core/graph/collective_order.h" #include +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/graph/graph_def_builder_test.cc b/tensorflow/core/graph/graph_def_builder_test.cc index be3c2be8007..f701154ecc2 100644 --- a/tensorflow/core/graph/graph_def_builder_test.cc +++ b/tensorflow/core/graph/graph_def_builder_test.cc @@ -15,9 +15,9 @@ limitations under the License. #include "tensorflow/core/graph/graph_def_builder.h" +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/framework/versions.pb.h" #include "tensorflow/core/graph/graph.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/core/graph/subgraph_test.cc b/tensorflow/core/graph/subgraph_test.cc index 5877d376027..18cd189d01c 100644 --- a/tensorflow/core/graph/subgraph_test.cc +++ b/tensorflow/core/graph/subgraph_test.cc @@ -18,12 +18,12 @@ limitations under the License. #include #include +#include "tensorflow/core/common_runtime/graph_def_builder_util.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/partial_tensor_shape.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/graph_def_builder.h" -#include "tensorflow/core/graph/graph_def_builder_util.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/core/status_test_util.h" diff --git a/tensorflow/core/kernels/function_ops.cc b/tensorflow/core/kernels/function_ops.cc index 86ff9809267..12f72d846f1 100644 --- a/tensorflow/core/kernels/function_ops.cc +++ b/tensorflow/core/kernels/function_ops.cc @@ -21,11 +21,11 @@ limitations under the License. #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/executor.h" #include "tensorflow/core/common_runtime/function.h" +#include "tensorflow/core/common_runtime/gradients.h" #include "tensorflow/core/common_runtime/memory_types.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/graph/algorithm.h" -#include "tensorflow/core/graph/gradients.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/platform/tracing.h" diff --git a/tensorflow/core/kernels/quantized_resize_bilinear_op_test.cc b/tensorflow/core/kernels/quantized_resize_bilinear_op_test.cc index ae5ca6e6c1e..b88053b035e 100644 --- a/tensorflow/core/kernels/quantized_resize_bilinear_op_test.cc +++ b/tensorflow/core/kernels/quantized_resize_bilinear_op_test.cc @@ -21,11 +21,11 @@ limitations under the License. #include "tensorflow/cc/ops/array_ops.h" #include "tensorflow/cc/ops/const_op.h" #include "tensorflow/cc/ops/image_ops.h" +#include "tensorflow/core/common_runtime/gradients.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/shape_inference_testutil.h" #include "tensorflow/core/framework/tensor_testutil.h" -#include "tensorflow/core/graph/gradients.h" #include "tensorflow/core/kernels/quantization_utils.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index 015f01dd42e..622185e8ccb 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -712,7 +712,7 @@ tf_python_pybind_extension( srcs = [ "training/quantize_training_wrapper.cc", ], - hdrs = ["//tensorflow/core/graph:quantize_training_hdrs"], + hdrs = ["//tensorflow/core/common_runtime:quantize_training_hdrs"], module_name = "_pywrap_quantize_training", deps = [ ":pybind11_lib", @@ -5952,11 +5952,10 @@ filegroup( "//tensorflow/c:tf_status_helper", # tfe "//tensorflow/compiler/jit:flags", #tfe "//tensorflow/compiler/mlir/python:mlir", # mlir - "//tensorflow/core/common_runtime:core_cpu_base_no_ops", # tf_session - "//tensorflow/core/common_runtime:core_cpu_rump_impl", # quantize_training "//tensorflow/core/common_runtime:device", # device_lib, tfe, tf_session "//tensorflow/core/common_runtime:device_factory", # device_lib, tfe, tf_session "//tensorflow/core/common_runtime:graph_constructor", # tf_session + "//tensorflow/core/common_runtime:quantize_training", # quantize_training "//tensorflow/core/common_runtime:session_options", # device_lib, tfe, tf_session "//tensorflow/core/common_runtime:session_state", # tf_session "//tensorflow/core/data/service:server_lib", # server_lib diff --git a/tensorflow/python/training/quantize_training_wrapper.cc b/tensorflow/python/training/quantize_training_wrapper.cc index ec901780ba6..af5a4788d3b 100644 --- a/tensorflow/python/training/quantize_training_wrapper.cc +++ b/tensorflow/python/training/quantize_training_wrapper.cc @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ #include "pybind11/pybind11.h" -#include "tensorflow/core/graph/quantize_training.h" +#include "tensorflow/core/common_runtime/quantize_training.h" #include "tensorflow/python/lib/core/pybind11_lib.h" #include "tensorflow/python/lib/core/pybind11_status.h" diff --git a/tensorflow/tools/def_file_filter/symbols_pybind.txt b/tensorflow/tools/def_file_filter/symbols_pybind.txt index f61f6c04992..ed8747a73f0 100644 --- a/tensorflow/tools/def_file_filter/symbols_pybind.txt +++ b/tensorflow/tools/def_file_filter/symbols_pybind.txt @@ -86,7 +86,7 @@ tensorflow::DeviceFactory::ListAllPhysicalDevices [session_options] # device_lib, tfe, tf_session tensorflow::SessionOptions::SessionOptions -[core_cpu_rump_impl] # quantize_training +[quantize_training] # quantize_training tensorflow::DoQuantizeTrainingOnSerializedGraphDef [session_state] # tf_session