Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Temporary change: always link to MKL binary blob
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Dubtsov committed Jan 28, 2019
1 parent d444d23 commit 1ade9ff
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 24 deletions.
9 changes: 4 additions & 5 deletions tensorflow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,10 @@ load(

filegroup(
name = "intel_binary_blob",
data = if_mkl_ml(
[
"//third_party/mkl:intel_binary_blob",
],
),
# XXX: always link to MKL binary blob
data = [
"//third_party/mkl:intel_binary_blob",
],
)

cc_library(
Expand Down
5 changes: 3 additions & 2 deletions tensorflow/core/kernels/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3288,9 +3288,10 @@ tf_kernel_library(
# <prefix>*impl.h are excluded by default from the CPU build, add explicitly.
hdrs = ["batch_matmul_op_impl.h"],
prefix = "batch_matmul_op",
deps = MATH_DEPS + [":eigen_contraction_kernel"] + if_mkl_ml([
deps = MATH_DEPS + [":eigen_contraction_kernel"] + [
# XXX: always link to MKL binary blob
"//third_party/mkl:intel_binary_blob",
]),
]
)

tf_kernel_library(
Expand Down
9 changes: 4 additions & 5 deletions tensorflow/core/platform/default/build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,7 @@ def tf_additional_binary_deps():
# core).
"//tensorflow/core/kernels:lookup_util",
"//tensorflow/core/util/tensor_bundle",
] + if_mkl_ml(
[
"//third_party/mkl:intel_binary_blob",
],
)
] + [
# XXX: always link to MKL binary blob
"//third_party/mkl:intel_binary_blob",
]
16 changes: 6 additions & 10 deletions tensorflow/tensorflow.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,9 @@ def tf_cc_binary(
name = name,
copts = copts,
srcs = srcs + tf_binary_additional_srcs(),
deps = deps + tf_binary_dynamic_kernel_deps(kernels) + if_mkl_ml(
[
clean_dep("//third_party/mkl:intel_binary_blob"),
],
),
deps = deps + tf_binary_dynamic_kernel_deps(kernels) +
# XXX: always link to MKL binary blob
[clean_dep("//third_party/mkl:intel_binary_blob")],
data = data + tf_binary_dynamic_kernel_dsos(kernels),
linkopts = linkopts + _rpath_linkopts(name),
**kwargs
Expand Down Expand Up @@ -780,11 +778,9 @@ def tf_cc_test(
"-lm",
],
}) + linkopts + _rpath_linkopts(name),
deps = deps + tf_binary_dynamic_kernel_deps(kernels) + if_mkl_ml(
[
clean_dep("//third_party/mkl:intel_binary_blob"),
],
),
deps = deps + tf_binary_dynamic_kernel_deps(kernels) +
# XXX: always link to MKL binary blob
[clean_dep("//third_party/mkl:intel_binary_blob")],
data = data + tf_binary_dynamic_kernel_dsos(kernels),
exec_compatible_with = tf_exec_compatible_with(kwargs),
# Nested select() statements seem not to be supported when passed to
Expand Down
4 changes: 3 additions & 1 deletion tensorflow/tools/pip_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ sh_binary(
"//conditions:default": [
":simple_console",
],
}) + if_mkl_ml(["//third_party/mkl:intel_binary_blob"]),
}) +
# XXX: always link to MKL binary blob
[ "//third_party/mkl:intel_binary_blob"],
)

# A genrule for generating a marker file for the pip package on Windows
Expand Down
9 changes: 8 additions & 1 deletion third_party/mkl/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ def mkl_deps():
inclusion in the deps attribute of rules.
"""
return select({
str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): ["@mkl_dnn"],
# XXX: Temporary change: link to binary MKL unless TF threading is
# enabled. Rationale: the binary blob contains libiomp5 -- the Intel
# Compiler OpenMP runtime -- that can be used in place of libgomp
# which is slow.
str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): [
"//third_party/mkl:intel_binary_blob",
"@mkl_dnn",
],
str(Label("//third_party/mkl:build_with_mkl_ml_only")): ["//third_party/mkl:intel_binary_blob"],
str(Label("//third_party/mkl:build_with_mkl")): [
"//third_party/mkl:intel_binary_blob",
Expand Down

0 comments on commit 1ade9ff

Please sign in to comment.