Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF: make tensorflow_mkldnn_contraction_kernel configurable #8972

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion etc/build_options.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def get_build_options(options, *args):
opts = {}
boolean_opts = ["vecgeom", "lto", "warnings"]
boolean_opts = ["vecgeom", "lto", "warnings", "tf_mkldnn"]
for opt in boolean_opts:
opts[opt] = ["enable_%s=1" % opt]
opts["no-"+opt] = ["enable_%s=0" % opt]
Expand Down
10 changes: 10 additions & 0 deletions tensorflow-sources.file
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ BuildRequires: bazel java-env git
## INCLUDE tensorflow-requires
## INCLUDE compilation_flags

#Set tensorflow_mkldnn_contraction_kernel option
#https://github.com/tensorflow/tensorflow/blob/v2.12.1/tensorflow/core/kernels/BUILD#L79-L89
%if "%{?enable_tf_mkldnn:set}" != "set"
%define enable_tf_mkldnn 1
%endif


#Set cms_cxx_standard to 17 as LLVM downloaded by TF does not build with c++20
%if "%{cms_cxx_standard}" == "20"
%undefine cms_cxx_standard
Expand Down Expand Up @@ -46,6 +53,9 @@ BAZEL_OPTS="$BAZEL_OPTS --copt=-mcpu=native --copt=-mtune=native"
%endif
BAZEL_OPTS="$BAZEL_OPTS --config=%{build_type} --cxxopt=-std=c++%{cms_cxx_standard} --host_cxxopt=-std=c++%{cms_cxx_standard} %{makeprocesses}"
BAZEL_OPTS="$BAZEL_OPTS --config=noaws --config=nogcp --config=nohdfs --config=nonccl"
%if "%{enable_tf_mkldnn}" == "0"
BAZEL_OPTS="$BAZEL_OPTS --define tensorflow_mkldnn_contraction_kernel=0"
%endif
%ifarch ppc64le
BAZEL_OPTS="$BAZEL_OPTS --define=tflite_with_xnnpack=false --define tflite_kernel_use_xnnpack=false"
%endif
Expand Down