From 8dd701593eb201b1722baeff5b97f339323b6fd7 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Fri, 7 Mar 2025 21:34:20 +0100 Subject: [PATCH 1/5] Build v2.12.0 with patch for stack unwind --- tensorflow-sources.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow-sources.spec b/tensorflow-sources.spec index 296a6707e2d..0dc949eee45 100644 --- a/tensorflow-sources.spec +++ b/tensorflow-sources.spec @@ -1,5 +1,5 @@ ### RPM external tensorflow-sources 2.12.0 -%define tag 4a22f3b460370aa5b1c60579104cd103e8f0d6bb +%define tag b3a44f2c0282af6b27cf1f5baaa02b7278522a15 %define branch cms/v%{realversion} %define github_user cms-externals %define python_cmd python3 From c0e90bb8bed666236c2e9dea311d72763cb15617 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Mon, 10 Mar 2025 16:55:28 +0100 Subject: [PATCH 2/5] Use commit that only enables memory debug --- tensorflow-sources.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow-sources.spec b/tensorflow-sources.spec index 0dc949eee45..37f321eb43b 100644 --- a/tensorflow-sources.spec +++ b/tensorflow-sources.spec @@ -1,5 +1,5 @@ ### RPM external tensorflow-sources 2.12.0 -%define tag b3a44f2c0282af6b27cf1f5baaa02b7278522a15 +%define tag 8ea181ff8b5bb56ae5de02c7ac1837cc8afee049 %define branch cms/v%{realversion} %define github_user cms-externals %define python_cmd python3 From c52ac0cad01e671fb13272588e21e4bc37c522a8 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Fri, 14 Mar 2025 21:58:23 +0100 Subject: [PATCH 3/5] Add -fno-omit-frame-pointer to Tensorflow OneDNN compilation --- tensorflow-sources.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow-sources.spec b/tensorflow-sources.spec index 296a6707e2d..15d3f6268a8 100644 --- a/tensorflow-sources.spec +++ b/tensorflow-sources.spec @@ -1,5 +1,5 @@ ### RPM external tensorflow-sources 2.12.0 -%define tag 4a22f3b460370aa5b1c60579104cd103e8f0d6bb +%define tag 0ee0c43537a4a2f48a0b77822ffbdf7f67606c19 %define branch cms/v%{realversion} %define github_user cms-externals %define python_cmd python3 From 864a0d3ec77ff1994778f73d2b7c26266f6ae5ae Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Tue, 18 Mar 2025 20:18:24 +0100 Subject: [PATCH 4/5] Build with ZenDNN instead of OneDNN --- tensorflow-sources.file | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tensorflow-sources.file b/tensorflow-sources.file index 1856139bdfa..36bc14c66d4 100644 --- a/tensorflow-sources.file +++ b/tensorflow-sources.file @@ -65,6 +65,7 @@ BAZEL_OPTS="$BAZEL_OPTS --config=noaws --config=nogcp --config=nohdfs --config=n %if "%{enable_tf_mkldnn}" == "0" BAZEL_OPTS="$BAZEL_OPTS --define tensorflow_mkldnn_contraction_kernel=0" %endif +BAZEL_OPTS="$BAZEL_OPTS --config=mkl" %ifarch ppc64le BAZEL_OPTS="$BAZEL_OPTS --define=tflite_with_xnnpack=false --define tflite_kernel_use_xnnpack=false" %endif @@ -86,7 +87,7 @@ export TF_NEED_GCP=0 export TF_ENABLE_XLA=1 export TF_NEED_OPENCL=0 export TF_NEED_VERBS=0 -export TF_NEED_MKL=0 +export TF_NEED_MKL=1 export TF_NEED_MPI=0 export TF_NEED_S3=0 export TF_NEED_GDR=0 @@ -219,6 +220,7 @@ copy_headers "$PWD" tensorflow/compiler copy_headers "$PWD" tensorflow/core/profiler/internal copy_headers "$PWD" tensorflow/core/profiler/lib copy_headers "$PWD" tensorflow/core/util/tensor_bundle +cp $PWD/bazel-out/*-%{build_type}/bin/external/llvm_openmp/libiomp*.so ${libdir}/ # do not copy the protobuf headers as we use the version in cmsdist # copy_headers "$PWD/tensorflow/contrib/makefile/downloads/protobuf/src" google From 21f66838eba871cb5e9b1c6514a5e7cbc7b656d4 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Wed, 19 Mar 2025 18:21:04 +0100 Subject: [PATCH 5/5] set tensorflow_mkldnn_contraction_kernel=0 --- tensorflow-sources.file | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow-sources.file b/tensorflow-sources.file index 36bc14c66d4..1347a851503 100644 --- a/tensorflow-sources.file +++ b/tensorflow-sources.file @@ -62,9 +62,9 @@ BAZEL_OPTS="$BAZEL_OPTS $(echo %{arch_build_flags} | tr ' ' '\n' | grep -v '^$' %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" +#%if "%{enable_tf_mkldnn}" == "0" BAZEL_OPTS="$BAZEL_OPTS --define tensorflow_mkldnn_contraction_kernel=0" -%endif +#%endif BAZEL_OPTS="$BAZEL_OPTS --config=mkl" %ifarch ppc64le BAZEL_OPTS="$BAZEL_OPTS --define=tflite_with_xnnpack=false --define tflite_kernel_use_xnnpack=false"