Clean up _pywrap_tfe deps. pywrap_tfe is a separate shared library and should not include tensorflow sources that are included in the main shared library.

PiperOrigin-RevId: 337546286
Change-Id: I0841c250637dc7bf43c30ddab825cca38bb05722
This commit is contained in:
Anna R 2020-10-16 11:36:08 -07:00 committed by TensorFlower Gardener
parent 1eb833a909
commit f5af1da4f8
4 changed files with 51 additions and 18 deletions

View File

@ -10,6 +10,9 @@ load(
"tf_cuda_library",
)
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "cc_header_only_library")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "filegroup")
@ -638,6 +641,19 @@ cc_library(
],
)
cc_header_only_library(
name = "tfe_tensorhandle_internal_hdrs_only",
extra_deps = [
"@com_google_absl//absl/strings",
],
visibility = [
"//tensorflow:internal",
],
deps = [
":tfe_tensorhandle_internal",
],
)
tf_cuda_library(
name = "c_api_test_util",
testonly = 1,

View File

@ -7,6 +7,9 @@ load("//tensorflow:tensorflow.bzl", "cc_header_only_library", "if_mlir", "tf_cc_
load("//tensorflow:tensorflow.bzl", "if_libtpu", "tf_copts")
load("//tensorflow/stream_executor:build_defs.bzl", "if_cuda_or_rocm")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "cc_header_only_library")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "filegroup")
@ -292,7 +295,7 @@ cc_library(
# Header-only version of "flags" library, for linking from the shared object
# without ODR violations.
cc_library(
name = "flags_headers_only",
name = "flags_headers",
hdrs = ["flags.h"],
visibility = [":friends"],
deps = [
@ -303,6 +306,11 @@ cc_library(
],
)
cc_header_only_library(
name = "flags_headers_only",
deps = [":flags_headers"],
)
cc_library(
name = "common",
srcs = [
@ -448,8 +456,8 @@ cc_library(
# Header-only version of "flags" library, for linking from the shared object
# without ODR violations.
cc_library(
name = "get_compiler_ir_hdrs_only",
hdrs = ["get_compiler_ir.h"],
name = "get_compiler_ir_hdrs",
textual_hdrs = ["get_compiler_ir.h"],
visibility = [
":internal",
"//learning/brain/contrib/tpu_modeling/exp/tpu_inference_converter:__pkg__",
@ -464,6 +472,23 @@ cc_library(
],
)
cc_header_only_library(
name = "get_compiler_ir_hdrs_only",
deps = [":get_compiler_ir_hdrs"],
)
# This target can be used by XLA device plugins to prevent circular dependencies, and provides access to all of the required headers for building a device library.
cc_header_only_library(
name = "xla_jit_headers_lib",
visibility = ["//visibility:public"],
deps = [
":xla_cpu_device",
":xla_cpu_jit",
":xla_gpu_device",
":xla_gpu_jit",
],
)
cc_library(
name = "xla_kernel_creator",
srcs = [
@ -1076,15 +1101,3 @@ cc_library(
],
alwayslink = 1,
)
# This target can be used by XLA device plugins to prevent circular dependencies, and provides access to all of the required headers for building a device library.
cc_header_only_library(
name = "xla_jit_headers_lib",
visibility = ["//visibility:public"],
deps = [
":xla_cpu_device",
":xla_cpu_jit",
":xla_gpu_device",
":xla_gpu_jit",
],
)

View File

@ -710,7 +710,6 @@ tf_python_pybind_extension(
"@pybind11",
"//third_party/python_runtime:headers",
"//tensorflow/core:protos_all_cc",
"//tensorflow/c/experimental/saved_model/core:pywrap_required_hdrs",
"//tensorflow/core:framework_headers_lib",
"//tensorflow/core/common_runtime:core_cpu_headers_lib",
"//tensorflow/core:lib_headers_for_pybind",
@ -7614,6 +7613,9 @@ tf_python_pybind_extension(
"//tensorflow/python/eager:pywrap_required_hdrs",
],
module_name = "_pywrap_tfe",
# Only include TensorFlow header-only targets here.
# If a cc_library needs to depend on TensorFlow .cc files through srcs or
# deps, then you can use cc_header_only_library to keep only headers.
deps = [
":safe_pyobject_ptr",
":pybind11_lib",
@ -7624,14 +7626,14 @@ tf_python_pybind_extension(
"@com_google_absl//absl/hash",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:optional",
"//tensorflow/c:pywrap_required_hdrs",
"@pybind11",
"//third_party/python_runtime:headers",
"//tensorflow/c/experimental/saved_model/core:pywrap_required_hdrs",
"//tensorflow/compiler/jit:flags_headers_only",
"//tensorflow/compiler/jit:get_compiler_ir_hdrs_only",
"//tensorflow/c/eager:tfe_tensorhandle_internal",
"//tensorflow/c/eager:tfe_tensorhandle_internal_hdrs_only",
"//tensorflow/core/common_runtime:core_cpu_headers_lib",
"//tensorflow/core:framework_headers_lib",
"//tensorflow/core:lib_headers_for_pybind",

View File

@ -393,6 +393,8 @@ tensorflow::tensor_float_32_execution_enabled
[get_compiler_ir] # tfe
tensorflow::GetCompilerIr
stream_executor::port::internal_statusor::Helper::Crash
[tensor_handle] # tfe
tensorflow::TensorHandle::Tensor