Skip to content

Commit

Permalink
Automated rollback of commit 4cf22fe
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 273597009
  • Loading branch information
bmzhao authored and tensorflower-gardener committed Oct 8, 2019
1 parent 6db50d1 commit 3d0978f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 109 deletions.
77 changes: 32 additions & 45 deletions tensorflow/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,10 @@ load(
"tf_additional_all_protos",
"tf_additional_core_deps",
"tf_additional_human_readable_json_deps",
"tf_additional_lib_defines",
"tf_additional_lib_deps",
"tf_additional_libdevice_data",
"tf_additional_libdevice_deps",
"tf_additional_monitoring_hdrs",
"tf_additional_numa_copts",
"tf_additional_numa_deps",
"tf_additional_numa_lib_defines",
"tf_additional_test_deps",
"tf_grpc_service_all",
"tf_jspb_proto_library",
Expand Down Expand Up @@ -534,7 +530,7 @@ cc_library(
"@com_google_absl//absl/strings",
"@double_conversion//:double-conversion",
"//tensorflow/core/lib/bfloat16",
"//tensorflow/core/platform:cpu_info",
"//tensorflow/core/platform:platform_port",
"//tensorflow/core/platform:logging",
"//tensorflow/core/platform:macros",
"//tensorflow/core/platform:platform",
Expand Down Expand Up @@ -943,6 +939,7 @@ cc_library(
"//third_party/eigen3",
"//tensorflow/core/lib/bfloat16",
"//tensorflow/core/platform:dynamic_annotations",
"//tensorflow/core/platform:platform_port",
"//tensorflow/core/platform:thread_annotations",
"//tensorflow/core/platform:mutex",
"//tensorflow/core/platform/default/build_config:minimal",
Expand Down Expand Up @@ -2244,19 +2241,11 @@ LIB_INTERNAL_PUBLIC_HEADERS = [
"util/env_var.h",
]

# Replicated for lib_internal and lib_internal_impl.
LIB_INTERNAL_DEFINES = (
tf_additional_lib_defines() + [
"TF_USE_SNAPPY",
] + tf_additional_numa_lib_defines()
)

cc_library(
name = "lib_internal",
srcs = LIB_INTERNAL_PRIVATE_HEADERS,
hdrs = LIB_INTERNAL_PUBLIC_HEADERS,
copts = tf_copts(),
defines = LIB_INTERNAL_DEFINES,
linkopts = select({
"//tensorflow:freebsd": [],
"//tensorflow:windows": [],
Expand Down Expand Up @@ -2302,39 +2291,37 @@ cc_library(
],
hdrs = LIB_INTERNAL_PUBLIC_HEADERS,
copts = tf_copts(),
defines = LIB_INTERNAL_DEFINES,
deps = tf_additional_lib_deps() + [
":core_stringpiece",
":lib_hash_crc32c_accelerate_internal",
":lib_proto_parsing",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"//third_party/eigen3",
"//tensorflow/core/lib/bfloat16",
"//tensorflow/core/lib/math:math_util",
"//tensorflow/core/platform:abi",
"//tensorflow/core/platform:annotation",
"//tensorflow/core/platform:cpu_info",
"//tensorflow/core/platform:denormal",
"//tensorflow/core/platform:dynamic_annotations",
"//tensorflow/core/platform:mutex",
"//tensorflow/core/platform:notification",
"//tensorflow/core/platform:numbers",
"//tensorflow/core/platform:platform_strings",
"//tensorflow/core/platform:scanner",
"//tensorflow/core/platform:setround",
"//tensorflow/core/platform:strong_hash",
"//tensorflow/core/platform:strcat",
"//tensorflow/core/platform:stringprintf",
"//tensorflow/core/platform:str_util",
"//tensorflow/core/platform:thread_annotations",
"//tensorflow/core/platform/default/build_config:platformlib",
"@snappy",
"@zlib_archive//:zlib",
"@double_conversion//:double-conversion",
"@com_google_protobuf//:protobuf",
] + tf_protos_all_impl() + tf_protos_grappler_impl() +
tf_additional_numa_deps(),
":core_stringpiece",
":lib_hash_crc32c_accelerate_internal",
":lib_proto_parsing",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"//third_party/eigen3",
"//tensorflow/core/lib/bfloat16",
"//tensorflow/core/lib/math:math_util",
"//tensorflow/core/platform:abi",
"//tensorflow/core/platform:annotation",
"//tensorflow/core/platform:denormal",
"//tensorflow/core/platform:dynamic_annotations",
"//tensorflow/core/platform:mutex",
"//tensorflow/core/platform:notification",
"//tensorflow/core/platform:numbers",
"//tensorflow/core/platform:platform_port",
"//tensorflow/core/platform:platform_strings",
"//tensorflow/core/platform:scanner",
"//tensorflow/core/platform:setround",
"//tensorflow/core/platform:strong_hash",
"//tensorflow/core/platform:strcat",
"//tensorflow/core/platform:stringprintf",
"//tensorflow/core/platform:str_util",
"//tensorflow/core/platform:thread_annotations",
"//tensorflow/core/platform/default/build_config:platformlib",
"@snappy",
"@zlib_archive//:zlib",
"@double_conversion//:double-conversion",
"@com_google_protobuf//:protobuf",
] + tf_protos_all_impl() + tf_protos_grappler_impl(),
alwayslink = 1,
)

Expand Down
29 changes: 5 additions & 24 deletions tensorflow/core/platform/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,8 @@ cc_library(
hdrs = ["cpu_feature_guard.h"],
deps = [
":byte_order",
":cpu_info",
":logging",
],
)

cc_library(
name = "cpu_info",
srcs = ["cpu_info.cc"],
hdrs = ["cpu_info.h"],
copts = tf_copts(),
deps = [
":byte_order",
":logging",
":platform",
":types",
":platform_port",
],
)

Expand All @@ -168,10 +155,10 @@ cc_library(
hdrs = ["denormal.h"],
deps = [
":byte_order",
":cpu_info",
":logging",
":macros",
":platform",
":platform_port",
],
)

Expand Down Expand Up @@ -333,10 +320,6 @@ cc_library(

cc_library(
name = "platform_port",
srcs = [
"cpu_info.cc",
],
copts = tf_copts(),
textual_hdrs = [
"cpu_info.h",
"demangle.h",
Expand All @@ -346,11 +329,7 @@ cc_library(
"numa.h",
"snappy.h",
],
deps = [
":logging",
":platform",
":types",
] + tf_platform_helper_deps("platform_port_impl"),
deps = tf_platform_helper_deps("platform_port_impl"),
)

cc_library(
Expand Down Expand Up @@ -638,6 +617,7 @@ filegroup(
"**/logger.cc",
"**/mutex.cc",
"**/logging.cc",
"**/port.cc",
"**/human_readable_json.cc",
"**/rocm.h",
"**/rocm_rocdl_path.cc",
Expand Down Expand Up @@ -741,6 +721,7 @@ filegroup(
"**/logger.cc",
"**/mutex.cc",
"**/logging.cc",
"**/port.cc",
"**/human_readable_json.cc",
"**/rocm_rocdl_path.cc",
"abi.cc",
Expand Down
33 changes: 0 additions & 33 deletions tensorflow/core/platform/default/build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,6 @@ def tf_additional_test_srcs():
def tf_kernel_tests_linkstatic():
return 0

def tf_additional_lib_defines():
"""Additional defines needed to build TF libraries."""
return []

def tf_additional_lib_deps():
"""Additional dependencies needed to build TF libraries."""
return [
Expand Down Expand Up @@ -667,12 +663,6 @@ def tf_lib_proto_compiler_deps():
"@com_google_protobuf//:protoc_lib",
]

def tf_additional_numa_lib_defines():
return select({
"//tensorflow:with_numa_support": ["TENSORFLOW_USE_NUMA"],
"//conditions:default": [],
})

def tf_py_clif_cc(name, visibility = None, **kwargs):
pass

Expand Down Expand Up @@ -706,29 +696,6 @@ def tf_additional_binary_deps():
],
)

def tf_additional_numa_deps():
return select({
"//tensorflow:android": [],
"//tensorflow:ios": [],
"//tensorflow:windows": [],
"//tensorflow:macos": [],
"//conditions:default": [
"@hwloc",
],
})

def tf_additional_numa_copts():
return select({
"//tensorflow:android": [],
"//tensorflow:ios": [],
"//tensorflow:windows": [],
"//tensorflow:macos": [],
"//conditions:default": [
"-Ithird_party/hwloc/hwloc-master/include",
"-DTENSORFLOW_USE_NUMA",
],
})

def tf_additional_rpc_deps():
return []

Expand Down
25 changes: 18 additions & 7 deletions tensorflow/core/platform/default/build_refactor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ Build targets for default implementations of tf/core/platform libraries.
# and add real BUILD files under tensorflow/core/platform/default and
# tensorflow/core/platform/windows after the refactoring is complete.

load(
"//tensorflow/core/platform:default/build_config.bzl",
"tf_additional_numa_copts",
"tf_additional_numa_deps",
)
load(
"//tensorflow:tensorflow.bzl",
"tf_copts",
Expand Down Expand Up @@ -539,6 +534,7 @@ def tf_instantiate_platform_libraries(names = []):
native.cc_library(
name = "platform_port_impl",
srcs = [
"//tensorflow/core/platform:cpu_info.cc",
"//tensorflow/core/platform:default/port.cc",
],
hdrs = [
Expand All @@ -550,7 +546,12 @@ def tf_instantiate_platform_libraries(names = []):
"//tensorflow/core/platform:numa.h",
"//tensorflow/core/platform:snappy.h",
],
copts = tf_copts() + tf_additional_numa_copts(),
defines = ["TF_USE_SNAPPY"] + select({
# TF Additional NUMA defines
"//tensorflow:with_numa_support": ["TENSORFLOW_USE_NUMA"],
"//conditions:default": [],
}),
copts = tf_copts(),
deps = [
"@com_google_absl//absl/base",
"//tensorflow/core/platform:byte_order",
Expand All @@ -559,13 +560,22 @@ def tf_instantiate_platform_libraries(names = []):
"//tensorflow/core/platform:types",
"//tensorflow/core/platform",
"@snappy",
] + tf_additional_numa_deps(),
] + select({
# TF Additional NUMA dependencies
"//tensorflow:android": [],
"//tensorflow:ios": [],
"//tensorflow:macos": [],
"//conditions:default": [
"@hwloc",
],
}),
visibility = ["//visibility:private"],
tags = ["no_oss", "manual"],
)
native.cc_library(
name = "windows_platform_port_impl",
srcs = [
"//tensorflow/core/platform:cpu_info.cc",
"//tensorflow/core/platform:windows/port.cc",
],
hdrs = [
Expand All @@ -577,6 +587,7 @@ def tf_instantiate_platform_libraries(names = []):
"//tensorflow/core/platform:numa.h",
"//tensorflow/core/platform:snappy.h",
],
defines = ["TF_USE_SNAPPY"],
copts = tf_copts(),
deps = [
"//tensorflow/core/platform",
Expand Down

0 comments on commit 3d0978f

Please sign in to comment.