Skip to content

Commit

Permalink
uwe's patches
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed Nov 19, 2024
1 parent 10d7755 commit 70fb4d9
Show file tree
Hide file tree
Showing 27 changed files with 114 additions and 172 deletions.
33 changes: 25 additions & 8 deletions recipe/patches/0001-loosen-requirements.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
From 8f4944fbf9840b311ce90ec3645f13a83e0bfb15 Mon Sep 17 00:00:00 2001
From e38b64198fe3f683895817c3685f9da939aadfd3 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Thu, 30 Dec 2021 06:57:09 +0200
Subject: [PATCH 01/27] loosen requirements

* Remove unused libclang requirement
* Remove unecessary tensorflow-io-gcs-filesystem
* unpin numpy

Co-authored-by: Mark Harfouche <[email protected]>
Co-authored-by: ngam
Co-authored-by: Uwe L. Korn <[email protected]>
---
tensorflow/tools/pip_package/setup.py | 2 --
1 file changed, 2 deletions(-)
tensorflow/tools/pip_package/setup.py | 6 ------
1 file changed, 6 deletions(-)

diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py
index 746adba6911..a08ea45d5a2 100644
index fb37ef9b..61f6ce1f 100644
--- a/tensorflow/tools/pip_package/setup.py
+++ b/tensorflow/tools/pip_package/setup.py
@@ -94,8 +94,6 @@ REQUIRED_PACKAGES = [
@@ -81,7 +81,6 @@ REQUIRED_PACKAGES = [
'flatbuffers >= 24.3.25',
'gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2',
'google_pasta >= 0.1.1',
- 'libclang >= 13.0.0',
'opt_einsum >= 2.3.2',
'packaging',
# pylint:disable=line-too-long
@@ -94,8 +93,6 @@ REQUIRED_PACKAGES = [
'termcolor >= 1.1.0',
'typing_extensions >= 3.6.6',
'wrapt >= 1.11.0',
Expand All @@ -25,6 +35,13 @@ index 746adba6911..a08ea45d5a2 100644
# grpcio does not build correctly on big-endian machines due to lack of
# BoringSSL support.
# See https://github.com/tensorflow/tensorflow/issues/17882.
--
2.47.0

@@ -111,9 +108,6 @@ REQUIRED_PACKAGES = [
# 'keras >= 2.14.0rc0, < 2.15' on the release branch after the branch cut.
'tensorboard >= 2.18, < 2.19',
'keras >= 3.5.0',
- # TODO(b/367877753): Update the upper bound to <2.2.0 once the compatibility
- # issues with numpy 2.1.0 is fixed.
- 'numpy >= 1.26.0, < 2.1.0',
'h5py >= 3.11.0',
'ml_dtypes >= 0.4.0, < 0.5.0',
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 104660cc81f2f4ef382b564670d26e098a2498cf Mon Sep 17 00:00:00 2001
From f80db539ec99bf062c5e7b935d0e2391225627fc Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Fri, 30 Jun 2023 08:39:32 +0000
Subject: [PATCH 02/27] Add additional absl_synchronization linkage to gRPC
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 02/27] Add additional absl_synchronization linkage to gRPC
1 file changed, 3 insertions(+)

diff --git a/third_party/systemlibs/grpc.BUILD b/third_party/systemlibs/grpc.BUILD
index 8b703f11556..417baf5d342 100644
index 8b703f11..417baf5d 100644
--- a/third_party/systemlibs/grpc.BUILD
+++ b/third_party/systemlibs/grpc.BUILD
@@ -10,6 +10,7 @@ cc_library(
Expand All @@ -35,6 +35,3 @@ index 8b703f11556..417baf5d342 100644
],
visibility = ["//visibility:public"],
)
--
2.47.0

7 changes: 2 additions & 5 deletions recipe/patches/0003-Fix-missing-abseil-linkages.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9662c813ce22d5899a06f4c59e9eb8d5eaf3b54a Mon Sep 17 00:00:00 2001
From 9452e8ed5d2f79b06a205807687c492e3524ade5 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Mon, 3 Jul 2023 04:45:46 +0000
Subject: [PATCH 03/27] Fix missing abseil linkages
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 03/27] Fix missing abseil linkages
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/third_party/absl/system.absl.strings.BUILD b/third_party/absl/system.absl.strings.BUILD
index fa9a7a84f67..d04776c98bf 100644
index fa9a7a84..d04776c9 100644
--- a/third_party/absl/system.absl.strings.BUILD
+++ b/third_party/absl/system.absl.strings.BUILD
@@ -26,7 +26,7 @@ cc_library(
Expand All @@ -20,6 +20,3 @@ index fa9a7a84f67..d04776c98bf 100644
deps = [
":str_format",
"//absl/container:compressed_tuple",
--
2.47.0

11 changes: 4 additions & 7 deletions recipe/patches/0004-Fix-protobuf_python-for-systemlibs.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 5f5c511cf6f269856e1c97fd8388764b6033da61 Mon Sep 17 00:00:00 2001
From 53fce719a6f0c64954b48d4b59b3be046b709493 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Wed, 30 Aug 2023 16:58:41 +0200
Subject: [PATCH 04/27] Fix protobuf_python for systemlibs
Expand All @@ -12,7 +12,7 @@ Subject: [PATCH 04/27] Fix protobuf_python for systemlibs
create mode 100644 third_party/systemlibs/protobuf_python.bzl

diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
index be83c971749..5320aa187fd 100644
index be83c971..5320aa18 100644
--- a/tensorflow/workspace2.bzl
+++ b/tensorflow/workspace2.bzl
@@ -390,6 +390,7 @@ def _tf_repositories():
Expand Down Expand Up @@ -40,7 +40,7 @@ index be83c971749..5320aa187fd 100644
tf_http_archive(
diff --git a/third_party/pybind11_protobuf/0001-Add-Python-include-path.patch b/third_party/pybind11_protobuf/0001-Add-Python-include-path.patch
new file mode 100644
index 00000000000..18a1ddf84f3
index 00000000..18a1ddf8
--- /dev/null
+++ b/third_party/pybind11_protobuf/0001-Add-Python-include-path.patch
@@ -0,0 +1,26 @@
Expand Down Expand Up @@ -72,7 +72,7 @@ index 00000000000..18a1ddf84f3
+
diff --git a/third_party/systemlibs/protobuf_python.bzl b/third_party/systemlibs/protobuf_python.bzl
new file mode 100644
index 00000000000..982617a765c
index 00000000..982617a7
--- /dev/null
+++ b/third_party/systemlibs/protobuf_python.bzl
@@ -0,0 +1,5 @@
Expand All @@ -81,6 +81,3 @@ index 00000000000..982617a765c
+ # hdrs = ["google/protobuf/proto_api.h"],
+ visibility = ["//visibility:public"],
+)
--
2.47.0

9 changes: 3 additions & 6 deletions recipe/patches/0005-Add-absl_log-systemlib.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From bdf51237e8fa9db086f9cfcc1a9badec3df86461 Mon Sep 17 00:00:00 2001
From bb623beeb54b94c22a2b019a935e684cc1dff2c8 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Wed, 30 Aug 2023 16:59:28 +0200
Subject: [PATCH 05/27] Add absl_log systemlib
Expand All @@ -11,7 +11,7 @@ Subject: [PATCH 05/27] Add absl_log systemlib

diff --git a/third_party/absl/system.absl.log.BUILD b/third_party/absl/system.absl.log.BUILD
new file mode 100644
index 00000000000..0248bda0f52
index 00000000..0248bda0
--- /dev/null
+++ b/third_party/absl/system.absl.log.BUILD
@@ -0,0 +1,22 @@
Expand All @@ -38,7 +38,7 @@ index 00000000000..0248bda0f52
+ ],
+)
diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl
index 9565a82c331..addb2410abd 100644
index 9565a82c..addb2410 100644
--- a/third_party/absl/workspace.bzl
+++ b/third_party/absl/workspace.bzl
@@ -20,6 +20,7 @@ def repo():
Expand All @@ -49,6 +49,3 @@ index 9565a82c331..addb2410abd 100644
"memory",
"meta",
"numeric",
--
2.47.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From be37f93d76fea61793f3d4e4e133a1c2e74662db Mon Sep 17 00:00:00 2001
From a33625860c147ebd81b99a06830dfc3f70a27e98 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Fri, 15 Sep 2023 11:06:27 +0200
Subject: [PATCH 06/27] Omit linking to layout_proto_cc if protobuf linkage is
Expand All @@ -9,7 +9,7 @@ Subject: [PATCH 06/27] Omit linking to layout_proto_cc if protobuf linkage is
1 file changed, 1 deletion(-)

diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index 0ad8e84b889..43843f32910 100644
index 0ad8e84b..43843f32 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -1363,7 +1363,6 @@ tf_python_pybind_extension(
Expand All @@ -20,6 +20,3 @@ index 0ad8e84b889..43843f32910 100644
"//tensorflow/python/lib/core:pybind11_lib",
"//tensorflow/python/lib/core:pybind11_status_headers",
"//third_party/python_runtime:headers", # buildcleaner: keep
--
2.47.0

7 changes: 2 additions & 5 deletions recipe/patches/0007-Fix-further-abseil-linkage.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From be174a9eab78a07aac031a68de1355f51889f04e Mon Sep 17 00:00:00 2001
From 206c175e081b4cedf15d2aa07c8fd2b21a5272ee Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Mon, 18 Sep 2023 14:47:08 +0000
Subject: [PATCH 07/27] Fix further abseil linkage
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 07/27] Fix further abseil linkage
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/third_party/absl/system.absl.base.BUILD b/third_party/absl/system.absl.base.BUILD
index d6bf8748dee..b3e42f4dd8b 100644
index d6bf8748..b3e42f4d 100644
--- a/third_party/absl/system.absl.base.BUILD
+++ b/third_party/absl/system.absl.base.BUILD
@@ -17,12 +17,22 @@ package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -36,6 +36,3 @@ index d6bf8748dee..b3e42f4dd8b 100644
visibility = [
"//absl:__subpackages__",
],
--
2.47.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From e935cf3f557e99bcdb2f6cfa55a53e448d07c3f0 Mon Sep 17 00:00:00 2001
From 6cc878513d44e08cd39b8f55f39f52b3c13893c8 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Fri, 27 Oct 2023 11:20:12 +0200
Subject: [PATCH 08/27] Add constraint to pybind11 systemlib
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 08/27] Add constraint to pybind11 systemlib
1 file changed, 6 insertions(+)

diff --git a/third_party/systemlibs/pybind11.BUILD b/third_party/systemlibs/pybind11.BUILD
index 44e7496fc25..21ec073b7a4 100644
index 44e7496f..21ec073b 100644
--- a/third_party/systemlibs/pybind11.BUILD
+++ b/third_party/systemlibs/pybind11.BUILD
@@ -6,3 +6,9 @@ cc_library(
Expand All @@ -21,6 +21,3 @@ index 44e7496fc25..21ec073b7a4 100644
+ name = "osx",
+ constraint_values = ["@platforms//os:osx"],
+)
--
2.47.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From e06239813185b1575a21c7d8ce8b14bd720ae1c6 Mon Sep 17 00:00:00 2001
From f7c3d89c2339cdf2517621e42666553d5ffd36da Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Fri, 27 Oct 2023 11:21:11 +0200
Subject: [PATCH 09/27] Different file ending for flatbuffers LICENSE
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 09/27] Different file ending for flatbuffers LICENSE
1 file changed, 5 insertions(+)

diff --git a/third_party/flatbuffers/BUILD.system b/third_party/flatbuffers/BUILD.system
index 8fe4d7a5907..297f8baf0c0 100644
index 8fe4d7a5..297f8baf 100644
--- a/third_party/flatbuffers/BUILD.system
+++ b/third_party/flatbuffers/BUILD.system
@@ -5,6 +5,11 @@ filegroup(
Expand All @@ -23,6 +23,3 @@ index 8fe4d7a5907..297f8baf0c0 100644
# Public flatc library to compile flatbuffer files at runtime.
cc_library(
name = "flatbuffers",
--
2.47.0

9 changes: 3 additions & 6 deletions recipe/patches/0010-Use-correct-hermetic-python.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From cf6cfb2ccb6f6449e88e84a4fa2d757b13f3ce86 Mon Sep 17 00:00:00 2001
From 7b162495d8efdc0fd6e0aad8f598cdeed3774af4 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Fri, 27 Oct 2023 11:21:38 +0200
Subject: [PATCH 10/27] Use correct, hermetic python
Expand All @@ -9,7 +9,7 @@ Subject: [PATCH 10/27] Use correct, hermetic python
2 files changed, 7 insertions(+)

diff --git a/tensorflow/compiler/mlir/quantization/tensorflow/gen_quantized_function_library.py b/tensorflow/compiler/mlir/quantization/tensorflow/gen_quantized_function_library.py
index 8352b974996..7eed8b4e373 100644
index 8352b974..7eed8b4e 100644
--- a/tensorflow/compiler/mlir/quantization/tensorflow/gen_quantized_function_library.py
+++ b/tensorflow/compiler/mlir/quantization/tensorflow/gen_quantized_function_library.py
@@ -14,6 +14,11 @@
Expand All @@ -25,7 +25,7 @@ index 8352b974996..7eed8b4e373 100644
import re
import string
diff --git a/tensorflow/python/tools/api/generator/create_python_api.py b/tensorflow/python/tools/api/generator/create_python_api.py
index cd76ae73f77..c12533c9b57 100644
index cd76ae73..c12533c9 100644
--- a/tensorflow/python/tools/api/generator/create_python_api.py
+++ b/tensorflow/python/tools/api/generator/create_python_api.py
@@ -18,6 +18,8 @@ import collections
Expand All @@ -37,6 +37,3 @@ index cd76ae73f77..c12533c9b57 100644

from tensorflow.python.tools.api.generator import doc_srcs
from tensorflow.python.util import tf_decorator
--
2.47.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 57f1c15968f28b4f0eaeaf731a50045693b984da Mon Sep 17 00:00:00 2001
From 1e33a03dfdaac70dbee540b901a1fee950b814a6 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Wed, 15 Nov 2023 09:18:28 +0100
Subject: [PATCH 11/27] Add well_known_types_py_pb2 to protobuf systemlib
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 11/27] Add well_known_types_py_pb2 to protobuf systemlib
1 file changed, 7 insertions(+)

diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
index c7d940605f9..504bc81af0d 100644
index c7d94060..504bc81a 100644
--- a/third_party/systemlibs/protobuf.BUILD
+++ b/third_party/systemlibs/protobuf.BUILD
@@ -111,3 +111,10 @@ py_library(
Expand All @@ -22,6 +22,3 @@ index c7d940605f9..504bc81af0d 100644
+ srcs = [proto[1][0] for proto in WELL_KNOWN_PROTO_MAP.items()],
+ visibility = ["//visibility:public"],
+)
--
2.47.0

7 changes: 2 additions & 5 deletions recipe/patches/0012-Add-protobuf-toolchain.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 36b3f8835ad3cd1bb3b6cd3ea42be59b0f830921 Mon Sep 17 00:00:00 2001
From 70bda39b9de02070156308d9e4070c9d0e651c38 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Wed, 15 Nov 2023 10:32:41 +0000
Subject: [PATCH 12/27] Add protobuf toolchain
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 12/27] Add protobuf toolchain
1 file changed, 14 insertions(+)

diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
index 504bc81af0d..4f105d33f84 100644
index 504bc81a..4f105d33 100644
--- a/third_party/systemlibs/protobuf.BUILD
+++ b/third_party/systemlibs/protobuf.BUILD
@@ -65,12 +65,26 @@ cc_library(
Expand Down Expand Up @@ -38,6 +38,3 @@ index 504bc81af0d..4f105d33f84 100644
cc_library(
name = "protoc_lib",
linkopts = ["-lprotoc"],
--
2.47.0

7 changes: 2 additions & 5 deletions recipe/patches/0013-fix-genproto.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 929da4b59e8119551d5b1c2c558a48f1ce4c54e6 Mon Sep 17 00:00:00 2001
From a6a1ee1af7e7829adc68a8f05b2ad8a9273982fb Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Thu, 16 Nov 2023 06:38:27 +0000
Subject: [PATCH 13/27] fix genproto
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 13/27] fix genproto
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/third_party/xla/third_party/tsl/tsl/platform/default/build_config.bzl b/third_party/xla/third_party/tsl/tsl/platform/default/build_config.bzl
index 726f54634c5..62837c84837 100644
index 726f5463..62837c84 100644
--- a/third_party/xla/third_party/tsl/tsl/platform/default/build_config.bzl
+++ b/third_party/xla/third_party/tsl/tsl/platform/default/build_config.bzl
@@ -400,10 +400,7 @@ def py_proto_library(
Expand All @@ -23,6 +23,3 @@ index 726f54634c5..62837c84837 100644

proto_gen(
name = name + "_genproto",
--
2.47.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From c88ca31929abb6fa46bbd7baadd2ee2055e18c3b Mon Sep 17 00:00:00 2001
From 0472aaf3932e1ea815cfd45582c001e159fc1052 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Thu, 23 Nov 2023 09:05:37 +0000
Subject: [PATCH 14/27] Remove some usage of absl::str_format in CUDA
Expand All @@ -13,7 +13,7 @@ yield the same results without the usage of absl.
3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tensorflow/core/framework/resource_base.h b/tensorflow/core/framework/resource_base.h
index 46a76ea094c..2f8d0a21878 100644
index 46a76ea0..2f8d0a21 100644
--- a/tensorflow/core/framework/resource_base.h
+++ b/tensorflow/core/framework/resource_base.h
@@ -18,8 +18,9 @@ limitations under the License.
Expand Down Expand Up @@ -42,7 +42,7 @@ index 46a76ea094c..2f8d0a21878 100644

// Returns memory used by this resource.
diff --git a/tensorflow/core/framework/resource_var.cc b/tensorflow/core/framework/resource_var.cc
index c441a8e2648..7e1f1fdf0ea 100644
index c441a8e2..7e1f1fdf 100644
--- a/tensorflow/core/framework/resource_var.cc
+++ b/tensorflow/core/framework/resource_var.cc
@@ -18,6 +18,8 @@ limitations under the License.
Expand All @@ -55,7 +55,7 @@ index c441a8e2648..7e1f1fdf0ea 100644

Status Var::AsGraphDef(GraphDefBuilder* builder, Node** out) const {
diff --git a/tensorflow/core/kernels/conv_ops_gpu.h b/tensorflow/core/kernels/conv_ops_gpu.h
index 627450ef2d6..d0c97527284 100644
index 627450ef..d0c97527 100644
--- a/tensorflow/core/kernels/conv_ops_gpu.h
+++ b/tensorflow/core/kernels/conv_ops_gpu.h
@@ -22,7 +22,7 @@ limitations under the License.
Expand All @@ -67,6 +67,3 @@ index 627450ef2d6..d0c97527284 100644
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/kernels/gpu_utils.h"
#include "tensorflow/core/lib/gtl/inlined_vector.h"
--
2.47.0

Loading

0 comments on commit 70fb4d9

Please sign in to comment.