From efe44dd3260d2b43e40d8523d5974940161ea04a Mon Sep 17 00:00:00 2001 From: "quanbo.liu" Date: Tue, 9 Jul 2024 15:04:16 +0800 Subject: [PATCH] [tf-frontend] fix for gcc8.5 --- .../patches/tensorflow/for_gcc_8_5.patch | 30 +++++++++++++++++++ .../external/patches/tensorflow/tf_mkl.patch | 25 ++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 frontends/tf-frontend/external/patches/tensorflow/tf_mkl.patch diff --git a/frontends/tf-frontend/external/patches/tensorflow/for_gcc_8_5.patch b/frontends/tf-frontend/external/patches/tensorflow/for_gcc_8_5.patch index 4158ab036..26be26124 100644 --- a/frontends/tf-frontend/external/patches/tensorflow/for_gcc_8_5.patch +++ b/frontends/tf-frontend/external/patches/tensorflow/for_gcc_8_5.patch @@ -16,3 +16,33 @@ index 606be04a0f7..a3936717de4 100644 auto shape_constant = rewriter.create( batch_matmul.getLoc(), GetI32ElementsAttr(new_shape, &rewriter)); auto reshaped_input = rewriter.create( +diff --git a/tensorflow/core/common_runtime/optimized_function_graph_info.h b/tensorflow/core/common_runtime/optimized_function_graph_info.h +index dd05b026ebf..b2bd9af5bb1 100644 +--- a/tensorflow/core/common_runtime/optimized_function_graph_info.h ++++ b/tensorflow/core/common_runtime/optimized_function_graph_info.h +@@ -71,10 +71,9 @@ struct OptimizedFunctionGraphInfo { + OptimizedFunctionGraphInfo(OptimizedFunctionGraphInfo& info) = delete; + OptimizedFunctionGraphInfo& operator=(OptimizedFunctionGraphInfo& info) = + delete; +- OptimizedFunctionGraphInfo(OptimizedFunctionGraphInfo&& info) noexcept = ++ OptimizedFunctionGraphInfo(OptimizedFunctionGraphInfo&& info) = default; ++ OptimizedFunctionGraphInfo& operator=(OptimizedFunctionGraphInfo&& info) = + default; +- OptimizedFunctionGraphInfo& operator=( +- OptimizedFunctionGraphInfo&& info) noexcept = default; + + // Converts from the struct to OptimizedFunctionGraph proto. + static OptimizedFunctionGraph ToProto(const OptimizedFunctionGraphInfo& info); +diff --git a/third_party/xla/xla/primitive_util.h b/third_party/xla/xla/primitive_util.h +index 1f400fc7a89..0ecc9475165 100644 +--- a/third_party/xla/xla/primitive_util.h ++++ b/third_party/xla/xla/primitive_util.h +@@ -559,7 +559,7 @@ inline constexpr int WidthForType(PrimitiveType type) { + if (ABSL_PREDICT_TRUE(IsArrayType(type))) { + return kWidths[type]; + } +- LOG(FATAL) << "Unhandled primitive type " << type; ++ // LOG(FATAL) << "Unhandled primitive type " << type; + } + } // namespace internal + diff --git a/frontends/tf-frontend/external/patches/tensorflow/tf_mkl.patch b/frontends/tf-frontend/external/patches/tensorflow/tf_mkl.patch new file mode 100644 index 000000000..0213cbd2c --- /dev/null +++ b/frontends/tf-frontend/external/patches/tensorflow/tf_mkl.patch @@ -0,0 +1,25 @@ +From ffac7c50e93177f8c0ab46e19d4de902f8098917 Mon Sep 17 00:00:00 2001 +From: "quanbo.liu" +Date: Tue, 9 Jul 2024 14:41:02 +0800 +Subject: [PATCH] tf_mkl + +--- + tensorflow/core/BUILD | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD +index e2adb15245c..7962fc9e574 100644 +--- a/tensorflow/core/BUILD ++++ b/tensorflow/core/BUILD +@@ -644,7 +644,7 @@ cc_library( + "//tensorflow/core/kernels/mkl:mkl_batch_matmul_op", + "//tensorflow/core/kernels/mkl:mkl_einsum_op", + "//tensorflow/core/kernels/mkl:mkl_matmul_op", +- "//tensorflow/core/kernels/mkl:mkl_sparse_matrix_matmul_op", ++ #"//tensorflow/core/kernels/mkl:mkl_sparse_matrix_matmul_op", + "//tensorflow/core/kernels/mkl:mkl_tmp_ops", + ]) + if_cuda_or_rocm([ + "//tensorflow/core/kernels:cudnn_rnn_kernels", +-- +2.30.2 +