Refactor core/BUILD dependencies to avoid circular dependency with grappler.
Remove grappler from android_srcs. PiperOrigin-RevId: 156062586
This commit is contained in:
parent
6d43171b41
commit
28b732d618
@ -854,7 +854,6 @@ filegroup(
|
|||||||
"//tensorflow/core/platform/default/build_config:android_srcs",
|
"//tensorflow/core/platform/default/build_config:android_srcs",
|
||||||
"//tensorflow/core/util/ctc:android_srcs",
|
"//tensorflow/core/util/ctc:android_srcs",
|
||||||
"//tensorflow/core/util/tensor_bundle:android_srcs",
|
"//tensorflow/core/util/tensor_bundle:android_srcs",
|
||||||
"//tensorflow/core/grappler:android_srcs",
|
|
||||||
"common_runtime/gpu/gpu_tracer.cc",
|
"common_runtime/gpu/gpu_tracer.cc",
|
||||||
"common_runtime/gpu/gpu_tracer.h",
|
"common_runtime/gpu/gpu_tracer.h",
|
||||||
] + glob(
|
] + glob(
|
||||||
@ -1492,42 +1491,153 @@ cc_library(
|
|||||||
deps = ["//tensorflow/core/platform/default/build_config:protos_cc"],
|
deps = ["//tensorflow/core/platform/default/build_config:protos_cc"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
CORE_CPU_BASE_HDRS = [
|
||||||
|
"common_runtime/device.h",
|
||||||
|
"common_runtime/graph_runner.h",
|
||||||
|
"common_runtime/shape_refiner.h",
|
||||||
|
"framework/versions.h",
|
||||||
|
"graph/algorithm.h",
|
||||||
|
"graph/colors.h",
|
||||||
|
"graph/control_flow.h",
|
||||||
|
"graph/costmodel.h",
|
||||||
|
"graph/default_device.h",
|
||||||
|
"graph/edgeset.h",
|
||||||
|
"graph/graph.h",
|
||||||
|
"graph/graph_constructor.h",
|
||||||
|
"graph/graph_def_builder.h",
|
||||||
|
"graph/graph_partition.h",
|
||||||
|
"graph/mkl_layout_pass.h",
|
||||||
|
"graph/mkl_tfconversion_pass.h",
|
||||||
|
"graph/node_builder.h",
|
||||||
|
"graph/optimizer_cse.h",
|
||||||
|
"graph/subgraph.h",
|
||||||
|
"graph/tensor_id.h",
|
||||||
|
"graph/testlib.h",
|
||||||
|
"graph/types.h",
|
||||||
|
"graph/validate.h",
|
||||||
|
]
|
||||||
|
|
||||||
tf_cuda_library(
|
tf_cuda_library(
|
||||||
name = "core_cpu_internal",
|
name = "core_cpu_base",
|
||||||
srcs = glob(
|
srcs = [
|
||||||
[
|
"common_runtime/shape_refiner.cc",
|
||||||
"client/**/*.cc",
|
"common_runtime/shape_refiner.h",
|
||||||
"common_runtime/*.h",
|
"framework/versions.h",
|
||||||
"common_runtime/*.cc",
|
"graph/algorithm.cc",
|
||||||
"framework/versions.h",
|
"graph/colors.cc",
|
||||||
"graph/**/*.h",
|
"graph/control_flow.cc",
|
||||||
"graph/**/*.cc",
|
"graph/costmodel.cc",
|
||||||
"public/session.h",
|
"graph/edgeset.cc",
|
||||||
"public/session_options.h",
|
"graph/graph.cc",
|
||||||
"public/version.h",
|
"graph/graph_constructor.cc",
|
||||||
],
|
"graph/graph_def_builder.cc",
|
||||||
exclude = [
|
"graph/graph_partition.cc",
|
||||||
"**/*test*",
|
"graph/mkl_layout_pass.cc",
|
||||||
"**/*main.cc",
|
"graph/mkl_tfconversion_pass.cc",
|
||||||
"common_runtime/direct_session.cc",
|
"graph/node_builder.cc",
|
||||||
"common_runtime/direct_session.h",
|
"graph/optimizer_cse.cc",
|
||||||
"common_runtime/gpu_device_context.h",
|
"graph/subgraph.cc",
|
||||||
],
|
"graph/tensor_id.cc",
|
||||||
),
|
"graph/validate.cc",
|
||||||
hdrs = glob(
|
"public/session.h",
|
||||||
[
|
"public/session_options.h",
|
||||||
"common_runtime/*.h",
|
"public/version.h",
|
||||||
"framework/versions.h",
|
],
|
||||||
"graph/**/*.h",
|
hdrs = CORE_CPU_BASE_HDRS,
|
||||||
],
|
|
||||||
exclude = [
|
|
||||||
"**/*test*",
|
|
||||||
"common_runtime/direct_session.h",
|
|
||||||
"common_runtime/gpu_device_context.h",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
copts = tf_copts(),
|
copts = tf_copts(),
|
||||||
deps = [
|
deps = [
|
||||||
|
":framework",
|
||||||
|
":framework_internal",
|
||||||
|
":lib",
|
||||||
|
":lib_internal",
|
||||||
|
":proto_text",
|
||||||
|
":protos_all_cc",
|
||||||
|
"//tensorflow/core/kernels:required",
|
||||||
|
"//third_party/eigen3",
|
||||||
|
],
|
||||||
|
alwayslink = 1,
|
||||||
|
)
|
||||||
|
|
||||||
|
tf_cuda_library(
|
||||||
|
name = "core_cpu_internal",
|
||||||
|
srcs = [
|
||||||
|
"common_runtime/allocator_retry.cc",
|
||||||
|
"common_runtime/bfc_allocator.cc",
|
||||||
|
"common_runtime/build_graph_options.cc",
|
||||||
|
"common_runtime/constant_folding.cc",
|
||||||
|
"common_runtime/copy_tensor.cc",
|
||||||
|
"common_runtime/costmodel_manager.cc",
|
||||||
|
"common_runtime/debugger_state_interface.cc",
|
||||||
|
"common_runtime/device.cc",
|
||||||
|
"common_runtime/device_factory.cc",
|
||||||
|
"common_runtime/device_mgr.cc",
|
||||||
|
"common_runtime/device_set.cc",
|
||||||
|
"common_runtime/executor.cc",
|
||||||
|
"common_runtime/function.cc",
|
||||||
|
"common_runtime/graph_optimizer.cc",
|
||||||
|
"common_runtime/graph_runner.cc",
|
||||||
|
"common_runtime/local_device.cc",
|
||||||
|
"common_runtime/memory_types.cc",
|
||||||
|
"common_runtime/optimization_registry.cc",
|
||||||
|
"common_runtime/parallel_concat_optimizer.cc",
|
||||||
|
"common_runtime/process_util.cc",
|
||||||
|
"common_runtime/renamed_device.cc",
|
||||||
|
"common_runtime/rendezvous_mgr.cc",
|
||||||
|
"common_runtime/resource_variable_read_optimizer.cc",
|
||||||
|
"common_runtime/session.cc",
|
||||||
|
"common_runtime/session_factory.cc",
|
||||||
|
"common_runtime/session_options.cc",
|
||||||
|
"common_runtime/session_state.cc",
|
||||||
|
"common_runtime/simple_graph_execution_state.cc",
|
||||||
|
"common_runtime/simple_placer.cc",
|
||||||
|
"common_runtime/stats_publisher_interface.cc",
|
||||||
|
"common_runtime/step_stats_collector.cc",
|
||||||
|
"common_runtime/threadpool_device.cc",
|
||||||
|
"common_runtime/threadpool_device_factory.cc",
|
||||||
|
"graph/gradients.cc",
|
||||||
|
"graph/quantize_training.cc",
|
||||||
|
"public/session.h",
|
||||||
|
"public/session_options.h",
|
||||||
|
"public/version.h",
|
||||||
|
],
|
||||||
|
hdrs = CORE_CPU_BASE_HDRS + [
|
||||||
|
"common_runtime/allocator_retry.h",
|
||||||
|
"common_runtime/bfc_allocator.h",
|
||||||
|
"common_runtime/build_graph_options.h",
|
||||||
|
"common_runtime/constant_folding.h",
|
||||||
|
"common_runtime/copy_tensor.h",
|
||||||
|
"common_runtime/costmodel_manager.h",
|
||||||
|
"common_runtime/debugger_state_interface.h",
|
||||||
|
"common_runtime/device_factory.h",
|
||||||
|
"common_runtime/device_mgr.h",
|
||||||
|
"common_runtime/device_set.h",
|
||||||
|
"common_runtime/dma_helper.h",
|
||||||
|
"common_runtime/eigen_thread_pool.h",
|
||||||
|
"common_runtime/executor.h",
|
||||||
|
"common_runtime/function.h",
|
||||||
|
"common_runtime/graph_optimizer.h",
|
||||||
|
"common_runtime/local_device.h",
|
||||||
|
"common_runtime/memory_types.h",
|
||||||
|
"common_runtime/mkl_cpu_allocator.h",
|
||||||
|
"common_runtime/optimization_registry.h",
|
||||||
|
"common_runtime/pending_counts.h",
|
||||||
|
"common_runtime/process_util.h",
|
||||||
|
"common_runtime/profile_handler.h",
|
||||||
|
"common_runtime/renamed_device.h",
|
||||||
|
"common_runtime/rendezvous_mgr.h",
|
||||||
|
"common_runtime/session_factory.h",
|
||||||
|
"common_runtime/simple_graph_execution_state.h",
|
||||||
|
"common_runtime/simple_placer.h",
|
||||||
|
"common_runtime/stats_publisher_interface.h",
|
||||||
|
"common_runtime/step_stats_collector.h",
|
||||||
|
"common_runtime/threadpool_device.h",
|
||||||
|
"common_runtime/visitable_allocator.h",
|
||||||
|
"graph/gradients.h",
|
||||||
|
"graph/quantize_training.h",
|
||||||
|
],
|
||||||
|
copts = tf_copts(),
|
||||||
|
deps = [
|
||||||
|
":core_cpu_base",
|
||||||
":framework",
|
":framework",
|
||||||
":framework_internal",
|
":framework_internal",
|
||||||
":function_ops_op_lib",
|
":function_ops_op_lib",
|
||||||
|
@ -29,10 +29,6 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/graph/graph_constructor.h"
|
#include "tensorflow/core/graph/graph_constructor.h"
|
||||||
#include "tensorflow/core/graph/subgraph.h"
|
#include "tensorflow/core/graph/subgraph.h"
|
||||||
#include "tensorflow/core/graph/validate.h"
|
#include "tensorflow/core/graph/validate.h"
|
||||||
#include "tensorflow/core/grappler/clusters/utils.h"
|
|
||||||
#include "tensorflow/core/grappler/clusters/virtual_cluster.h"
|
|
||||||
#include "tensorflow/core/grappler/grappler_item.h"
|
|
||||||
#include "tensorflow/core/grappler/optimizers/meta_optimizer.h"
|
|
||||||
#include "tensorflow/core/lib/core/errors.h"
|
#include "tensorflow/core/lib/core/errors.h"
|
||||||
#include "tensorflow/core/lib/core/status.h"
|
#include "tensorflow/core/lib/core/status.h"
|
||||||
#include "tensorflow/core/lib/strings/stringprintf.h"
|
#include "tensorflow/core/lib/strings/stringprintf.h"
|
||||||
@ -41,6 +37,13 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/platform/types.h"
|
#include "tensorflow/core/platform/types.h"
|
||||||
#include "tensorflow/core/util/util.h"
|
#include "tensorflow/core/util/util.h"
|
||||||
|
|
||||||
|
#ifndef IS_MOBILE_PLATFORM
|
||||||
|
#include "tensorflow/core/grappler/clusters/utils.h"
|
||||||
|
#include "tensorflow/core/grappler/clusters/virtual_cluster.h"
|
||||||
|
#include "tensorflow/core/grappler/grappler_item.h"
|
||||||
|
#include "tensorflow/core/grappler/optimizers/meta_optimizer.h"
|
||||||
|
#endif // IS_MOBILE_PLATFORM
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
|
|
||||||
SimpleGraphExecutionState::SimpleGraphExecutionState(
|
SimpleGraphExecutionState::SimpleGraphExecutionState(
|
||||||
@ -236,6 +239,8 @@ Status SimpleGraphExecutionState::InitBaseGraph(
|
|||||||
GraphDef optimized_graph;
|
GraphDef optimized_graph;
|
||||||
const RewriterConfig& rewrite_options =
|
const RewriterConfig& rewrite_options =
|
||||||
session_options_->config.graph_options().rewrite_options();
|
session_options_->config.graph_options().rewrite_options();
|
||||||
|
|
||||||
|
#ifndef IS_MOBILE_PLATFORM
|
||||||
if (grappler::MetaOptimizerEnabled(rewrite_options)) {
|
if (grappler::MetaOptimizerEnabled(rewrite_options)) {
|
||||||
// Adding this functionalty in steps. The first step is to make sure
|
// Adding this functionalty in steps. The first step is to make sure
|
||||||
// we don't break dependencies. The second step will be to turn the
|
// we don't break dependencies. The second step will be to turn the
|
||||||
@ -282,6 +287,7 @@ Status SimpleGraphExecutionState::InitBaseGraph(
|
|||||||
graph_def = &optimized_graph;
|
graph_def = &optimized_graph;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // IS_MOBILE_PLATFORM
|
||||||
|
|
||||||
std::unique_ptr<Graph> new_graph(new Graph(OpRegistry::Global()));
|
std::unique_ptr<Graph> new_graph(new Graph(OpRegistry::Global()));
|
||||||
GraphConstructorOptions opts;
|
GraphConstructorOptions opts;
|
||||||
|
@ -14,31 +14,6 @@ filegroup(
|
|||||||
visibility = ["//tensorflow:__subpackages__"],
|
visibility = ["//tensorflow:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "mobile_srcs",
|
|
||||||
srcs = [
|
|
||||||
"devices.cc",
|
|
||||||
"devices.h",
|
|
||||||
"grappler_item.cc",
|
|
||||||
"grappler_item.h",
|
|
||||||
"op_types.cc",
|
|
||||||
"op_types.h",
|
|
||||||
"utils.cc",
|
|
||||||
"utils.h",
|
|
||||||
"//tensorflow/core/grappler/clusters:android_srcs",
|
|
||||||
"//tensorflow/core/grappler/inputs:android_srcs",
|
|
||||||
"//tensorflow/core/grappler/optimizers:android_srcs",
|
|
||||||
"//tensorflow/core/grappler/utils:android_srcs",
|
|
||||||
],
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
alias(
|
|
||||||
name = "android_srcs",
|
|
||||||
actual = ":mobile_srcs",
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "op_types",
|
name = "op_types",
|
||||||
srcs = ["op_types.cc"],
|
srcs = ["op_types.cc"],
|
||||||
|
@ -12,24 +12,6 @@ filegroup(
|
|||||||
visibility = ["//tensorflow:__subpackages__"],
|
visibility = ["//tensorflow:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "mobile_srcs",
|
|
||||||
srcs = glob(
|
|
||||||
[
|
|
||||||
"cluster.*",
|
|
||||||
"utils.*",
|
|
||||||
"virtual_cluster.*",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
alias(
|
|
||||||
name = "android_srcs",
|
|
||||||
actual = ":mobile_srcs",
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "xsmm",
|
name = "xsmm",
|
||||||
licenses = ["notice"],
|
licenses = ["notice"],
|
||||||
|
@ -39,7 +39,7 @@ cc_library(
|
|||||||
deps = [
|
deps = [
|
||||||
":op_performance_data_cc",
|
":op_performance_data_cc",
|
||||||
":utils",
|
":utils",
|
||||||
"//tensorflow/core:core_cpu",
|
"//tensorflow/core:core_cpu_base",
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core/grappler:grappler_item",
|
"//tensorflow/core/grappler:grappler_item",
|
||||||
"//tensorflow/core/grappler/clusters:cluster",
|
"//tensorflow/core/grappler/clusters:cluster",
|
||||||
@ -119,7 +119,7 @@ cc_library(
|
|||||||
":op_performance_data_cc",
|
":op_performance_data_cc",
|
||||||
"//third_party/eigen3",
|
"//third_party/eigen3",
|
||||||
"//tensorflow/core/grappler/clusters:utils",
|
"//tensorflow/core/grappler/clusters:utils",
|
||||||
"//tensorflow/core:core_cpu_internal",
|
"//tensorflow/core:core_cpu_base",
|
||||||
"//tensorflow/core:framework",
|
"//tensorflow/core:framework",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
@ -227,7 +227,7 @@ cc_library(
|
|||||||
":virtual_placer",
|
":virtual_placer",
|
||||||
":virtual_scheduler",
|
":virtual_scheduler",
|
||||||
"//tensorflow/core:core_cpu",
|
"//tensorflow/core:core_cpu",
|
||||||
"//tensorflow/core:core_cpu_internal",
|
"//tensorflow/core:core_cpu_base",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core/grappler:grappler_item",
|
"//tensorflow/core/grappler:grappler_item",
|
||||||
|
@ -12,22 +12,6 @@ filegroup(
|
|||||||
visibility = ["//tensorflow:__subpackages__"],
|
visibility = ["//tensorflow:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "mobile_srcs",
|
|
||||||
srcs = glob(
|
|
||||||
[
|
|
||||||
"utils.*",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
alias(
|
|
||||||
name = "android_srcs",
|
|
||||||
actual = ":mobile_srcs",
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "utils",
|
name = "utils",
|
||||||
srcs = [
|
srcs = [
|
||||||
|
@ -12,26 +12,6 @@ filegroup(
|
|||||||
visibility = ["//tensorflow:__subpackages__"],
|
visibility = ["//tensorflow:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "mobile_srcs",
|
|
||||||
srcs = glob(
|
|
||||||
[
|
|
||||||
"*_optimizer.*",
|
|
||||||
"auto_parallel.*",
|
|
||||||
"constant_folding.*",
|
|
||||||
"model_pruner.*",
|
|
||||||
"graph_rewriter.*",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
alias(
|
|
||||||
name = "android_srcs",
|
|
||||||
actual = ":mobile_srcs",
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "static_schedule",
|
name = "static_schedule",
|
||||||
srcs = ["static_schedule.cc"],
|
srcs = ["static_schedule.cc"],
|
||||||
@ -207,9 +187,12 @@ cc_library(
|
|||||||
deps = [
|
deps = [
|
||||||
":graph_optimizer",
|
":graph_optimizer",
|
||||||
":graph_rewriter",
|
":graph_rewriter",
|
||||||
|
":static_schedule",
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core/grappler:grappler_item",
|
"//tensorflow/core/grappler:grappler_item",
|
||||||
"//tensorflow/core/grappler:utils",
|
"//tensorflow/core/grappler:utils",
|
||||||
|
"//tensorflow/core/grappler/costs:graph_properties",
|
||||||
|
"//tensorflow/core/grappler/utils:scc",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -219,12 +202,13 @@ cc_test(
|
|||||||
deps = [
|
deps = [
|
||||||
":memory_optimizer",
|
":memory_optimizer",
|
||||||
"//tensorflow/cc:cc_ops",
|
"//tensorflow/cc:cc_ops",
|
||||||
|
"//tensorflow/core:ops",
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core:test",
|
"//tensorflow/core:test",
|
||||||
"//tensorflow/core:test_main",
|
"//tensorflow/core:test_main",
|
||||||
"//tensorflow/core/grappler:grappler_item",
|
"//tensorflow/core/grappler:grappler_item",
|
||||||
"//tensorflow/core/grappler:utils",
|
"//tensorflow/core/grappler:utils",
|
||||||
"//tensorflow/core/grappler/inputs:trivial_test_graph_input_yielder",
|
"//tensorflow/core/grappler/clusters:virtual_cluster",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,21 +12,6 @@ filegroup(
|
|||||||
visibility = ["//tensorflow:__subpackages__"],
|
visibility = ["//tensorflow:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "mobile_srcs",
|
|
||||||
srcs = [
|
|
||||||
"scc.cc",
|
|
||||||
"scc.h",
|
|
||||||
],
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
alias(
|
|
||||||
name = "android_srcs",
|
|
||||||
actual = ":mobile_srcs",
|
|
||||||
visibility = ["//tensorflow:__subpackages__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "scc",
|
name = "scc",
|
||||||
srcs = ["scc.cc"],
|
srcs = ["scc.cc"],
|
||||||
|
Loading…
Reference in New Issue
Block a user