Skip to content

Commit 2fbb290

Browse files
authored
Change default setting for tf_mkldnn to disabled
Disable tf_mkldnn by default and adjust Bazel options accordingly.
1 parent bdd33b8 commit 2fbb290

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tensorflow-sources.file

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ BuildRequires: bazel java-env git
99
#Set tensorflow_mkldnn_contraction_kernel option
1010
#https://github.com/tensorflow/tensorflow/blob/v2.12.1/tensorflow/core/kernels/BUILD#L79-L89
1111
%if "%{?enable_tf_mkldnn:set}" != "set"
12-
%define enable_tf_mkldnn 1
12+
#By default disable tf_mkldnn
13+
%define enable_tf_mkldnn 0
1314
%endif
1415

15-
1616
#Set cms_cxx_standard to 17 as LLVM downloaded by TF does not build with c++20
1717
%if "%{cms_cxx_standard}" == "20"
1818
%undefine cms_cxx_standard
@@ -66,8 +66,9 @@ BAZEL_OPTS="$BAZEL_OPTS $(echo %{arch_build_flags} | tr ' ' '\n' | grep -v '^$'
6666
%endif
6767
BAZEL_OPTS="$BAZEL_OPTS --config=%{build_type} --cxxopt=-std=c++%{cms_cxx_standard} --host_cxxopt=-std=c++%{cms_cxx_standard} %{makeprocesses}"
6868
BAZEL_OPTS="$BAZEL_OPTS --config=noaws --config=nogcp --config=nohdfs --config=nonccl"
69-
# always build tensorflow without mkldnn contraction kernel
69+
%if "%{enable_tf_mkldnn}" == "0"
7070
BAZEL_OPTS="$BAZEL_OPTS --define=zendnn=true --define=build_with_mkl_dnn_only=false --define=build_with_mkl=false --define=enable_mkl=false --define=tensorflow_mkldnn_contraction_kernel=0 --define=build_with_mkl_opensource=false"
71+
%endif
7172
%ifarch ppc64le
7273
BAZEL_OPTS="$BAZEL_OPTS --define=tflite_with_xnnpack=false --define tflite_kernel_use_xnnpack=false"
7374
%endif

0 commit comments

Comments
 (0)