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 Jun 25, 2019
1 parent 3699977 commit c3150f4
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 @@ -444,11 +444,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 @@ -3514,9 +3514,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 @@ -784,11 +784,10 @@ 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",
]

def tf_additional_numa_deps():
return select({
Expand Down
16 changes: 6 additions & 10 deletions tensorflow/tensorflow.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,9 @@ def tf_cc_binary(
name = name_os,
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 = depset(data + added_data_deps),
linkopts = linkopts + _rpath_linkopts(name_os),
visibility = visibility,
Expand Down Expand Up @@ -956,11 +954,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() +
tf_binary_additional_srcs(),
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 @@ -271,7 +271,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 c3150f4

Please sign in to comment.