aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow
diff options
context:
space:
mode:
authorGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-21 11:02:27 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-21 11:02:41 -0700
commitc72c36145b01ba71b88731843fc36914f721a0e8 (patch)
treee1f6fd4048ff5dc7c0b3330cf80a17283e57c42a /tensorflow
parenta2119c81894e99160978a444f2e8d9431d0f7abb (diff)
parentbc6be507c71046dfc889a90e3949a903d5d1e6eb (diff)
Merge pull request #21122 from NervanaSystems:master
PiperOrigin-RevId: 209623532
Diffstat (limited to 'tensorflow')
-rw-r--r--tensorflow/BUILD14
-rw-r--r--tensorflow/core/BUILD3
-rw-r--r--tensorflow/python/BUILD8
-rw-r--r--tensorflow/tensorflow.bzl5
-rw-r--r--tensorflow/tools/pip_package/BUILD6
-rw-r--r--tensorflow/workspace.bzl33
6 files changed, 66 insertions, 3 deletions
diff --git a/tensorflow/BUILD b/tensorflow/BUILD
index 94e059b914..9cc4c4567b 100644
--- a/tensorflow/BUILD
+++ b/tensorflow/BUILD
@@ -23,6 +23,10 @@ load(
"//tensorflow/python/tools/api/generator:api_gen.bzl",
"gen_api_init_files", # @unused
)
+load(
+ "//third_party/ngraph:build_defs.bzl",
+ "if_ngraph",
+)
# Config setting used when building for products
# which requires restricted licenses to be avoided.
@@ -411,6 +415,14 @@ config_setting(
visibility = ["//visibility:public"],
)
+# This flag is set from the configure step when the user selects with nGraph option.
+# By default it should be false
+config_setting(
+ name = "with_ngraph_support",
+ values = {"define": "with_ngraph_support=true"},
+ visibility = ["//visibility:public"],
+)
+
package_group(
name = "internal",
packages = [
@@ -563,7 +575,7 @@ tf_cc_shared_object(
"//tensorflow/cc:scope",
"//tensorflow/cc/profiler",
"//tensorflow/core:tensorflow",
- ],
+ ] + if_ngraph(["@ngraph_tf//:ngraph_tf"]),
)
exports_files(
diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD
index 64430a1418..515237ff29 100644
--- a/tensorflow/core/BUILD
+++ b/tensorflow/core/BUILD
@@ -2350,6 +2350,7 @@ tf_generate_proto_text_sources(
srcs = COMMON_PROTO_SRCS,
protodeps = ERROR_CODES_PROTO_SRCS,
srcs_relative_dir = "tensorflow/core/",
+ visibility = ["//visibility:public"],
deps = [
":error_codes_proto_text",
":lib_internal",
@@ -2462,6 +2463,7 @@ cc_header_only_library(
cc_header_only_library(
name = "core_cpu_headers_lib",
+ visibility = ["//visibility:public"],
deps = [
":core_cpu_lib",
],
@@ -2585,6 +2587,7 @@ tf_cuda_library(
# TODO(josh11b): Is this needed, or can we just use ":protos_all_cc"?
cc_library(
name = "protos_cc",
+ visibility = ["//visibility:public"],
deps = ["//tensorflow/core/platform/default/build_config:protos_cc"],
)
diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index 07c74ec71d..e6d78301a5 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -44,6 +44,10 @@ load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_
load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_mpi_deps")
load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_gdr_deps")
load("//tensorflow/core:platform/default/build_config_root.bzl", "if_static")
+load(
+ "//third_party/ngraph:build_defs.bzl",
+ "if_ngraph",
+)
py_library(
name = "python",
@@ -3816,7 +3820,9 @@ tf_py_wrap_cc(
tf_additional_plugin_deps() +
tf_additional_verbs_deps() +
tf_additional_mpi_deps() +
- tf_additional_gdr_deps()),
+ tf_additional_gdr_deps()) + if_ngraph([
+ "@ngraph_tf//:ngraph_tf",
+ ]),
)
# ** Targets for Windows build (start) **
diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl
index c7766f384e..6d6e8941c5 100644
--- a/tensorflow/tensorflow.bzl
+++ b/tensorflow/tensorflow.bzl
@@ -31,6 +31,10 @@ load(
"//third_party/mkl_dnn:build_defs.bzl",
"if_mkl_open_source_only",
)
+load(
+ "//third_party/ngraph:build_defs.bzl",
+ "if_ngraph",
+)
def register_extension_info(**kwargs):
pass
@@ -233,6 +237,7 @@ def tf_copts(android_optimization_level_override = "-O2", is_external = False):
if_tensorrt(["-DGOOGLE_TENSORRT=1"]) +
if_mkl(["-DINTEL_MKL=1", "-DEIGEN_USE_VML"]) +
if_mkl_open_source_only(["-DINTEL_MKL_DNN_ONLY"]) +
+ if_ngraph(["-DINTEL_NGRAPH=1"]) +
if_mkl_lnx_x64(["-fopenmp"]) +
if_android_arm(["-mfpu=neon"]) +
if_linux_x86_64(["-msse3"]) +
diff --git a/tensorflow/tools/pip_package/BUILD b/tensorflow/tools/pip_package/BUILD
index 7839eddcf8..1a4679c8a3 100644
--- a/tensorflow/tools/pip_package/BUILD
+++ b/tensorflow/tools/pip_package/BUILD
@@ -200,7 +200,11 @@ filegroup(
"@grpc//third_party/nanopb:LICENSE.txt",
"@grpc//third_party/address_sorting:LICENSE",
],
- ) + tf_additional_license_deps(),
+ ) + if_not_windows([
+ "@ngraph//:LICENSE",
+ "@ngraph_tf//:LICENSE",
+ "@nlohmann_json_lib//:LICENSE",
+ ]) + tf_additional_license_deps(),
)
sh_binary(
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index 68c78c21cb..dfb5d8a6e1 100644
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -832,6 +832,39 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
strip_prefix = "rules_android-0.1.1",
)
+ tf_http_archive(
+ name = "ngraph",
+ urls = [
+ "https://mirror.bazel.build/github.com/NervanaSystems/ngraph/archive/v0.5.0.tar.gz",
+ "https://github.com/NervanaSystems/ngraph/archive/v0.5.0.tar.gz",
+ ],
+ sha256 = "cb35d3d98836f615408afd18371fb13e3400711247e0d822ba7f306c45e9bb2c",
+ strip_prefix = "ngraph-0.5.0",
+ build_file = clean_dep("//third_party/ngraph:ngraph.BUILD"),
+ )
+
+ tf_http_archive(
+ name = "nlohmann_json_lib",
+ urls = [
+ "https://mirror.bazel.build/github.com/nlohmann/json/archive/v3.1.1.tar.gz",
+ "https://github.com/nlohmann/json/archive/v3.1.1.tar.gz",
+ ],
+ sha256 = "9f3549824af3ca7e9707a2503959886362801fb4926b869789d6929098a79e47",
+ strip_prefix = "json-3.1.1",
+ build_file = clean_dep("//third_party/ngraph:nlohmann_json.BUILD"),
+ )
+
+ tf_http_archive(
+ name = "ngraph_tf",
+ urls = [
+ "https://mirror.bazel.build/github.com/NervanaSystems/ngraph-tf/archive/v0.3.0-rc1.tar.gz",
+ "https://github.com/NervanaSystems/ngraph-tf/archive/v0.3.0-rc1.tar.gz",
+ ],
+ sha256 = "7919332cb15120101c3e05c1b969a5e029a6411581312583c8f80b6aaaa83072",
+ strip_prefix = "ngraph-tf-0.3.0-rc1",
+ build_file = clean_dep("//third_party/ngraph:ngraph_tf.BUILD"),
+ )
+
##############################################################################
# BIND DEFINITIONS
#