[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
This commit is contained in:
Derek Murray 2020-04-28 09:49:04 -07:00 committed by TensorFlower Gardener
parent fb1b76c7e3
commit 8ba3108452
42 changed files with 229 additions and 144 deletions

View File

@ -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",

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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,

View File

@ -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",
],
)

View File

@ -17,8 +17,8 @@ limitations under the License.
#include <unordered_map>
#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"

View File

@ -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"

View File

@ -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 <deque>
#include <vector>
#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"

View File

@ -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<NodeOut> y_node_outputs,
} // namespace tensorflow
#endif // TENSORFLOW_CORE_GRAPH_GRADIENTS_H_
#endif // TENSORFLOW_CORE_COMMON_RUNTIME_GRADIENTS_H_

View File

@ -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 {

View File

@ -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_

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 <algorithm>
#include <functional>

View File

@ -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<Graph>* g);
#endif
#endif // TENSORFLOW_CORE_GRAPH_MKL_LAYOUT_PASS_H_
#endif // TENSORFLOW_CORE_COMMON_RUNTIME_MKL_LAYOUT_PASS_H_

View File

@ -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 <algorithm>
#include <vector>
#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"

View File

@ -15,6 +15,8 @@ limitations under the License.
#ifdef INTEL_MKL
#include "tensorflow/core/common_runtime/mkl_tfconversion_pass.h"
#include <memory>
#include <queue>
#include <set>
@ -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 {

View File

@ -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<Graph>* g);
#endif
#endif // TENSORFLOW_CORE_GRAPH_MKL_TFCONVERSION_PASS_H_
#endif // TENSORFLOW_CORE_COMMON_RUNTIME_MKL_TFCONVERSION_PASS_H_

View File

@ -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 <algorithm>
#include <vector>
#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"

View File

@ -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"

View File

@ -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"

View File

@ -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 <algorithm>
#include <atomic>
#include <set>
#include <unordered_map>
#include <vector>
#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"

View File

@ -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_

View File

@ -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 <map>
#include <string>
#include <unordered_map>
#include <vector>
#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"

View File

@ -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",

View File

@ -18,11 +18,11 @@ limitations under the License.
#include <string>
#include <vector>
#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"

View File

@ -15,9 +15,9 @@ limitations under the License.
#include "tensorflow/core/graph/collective_order.h"
#include <gmock/gmock.h>
#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"

View File

@ -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"

View File

@ -18,12 +18,12 @@ limitations under the License.
#include <string>
#include <vector>
#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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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