Skip to content
Draft
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: 0 additions & 2 deletions recipe/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ export TF_SYSTEM_LIBS="
snappy
zlib
"
sed -i -e "s/GRPCIO_VERSION/${libgrpc}/" tensorflow/tools/pip_package/setup.py
sed -i -e "s/<6.0.0dev/<7.0.0dev/g" tensorflow/tools/pip_package/setup.py

# do not build with MKL support
export TF_NEED_MKL=0
Expand Down
97 changes: 44 additions & 53 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set version = "2.19.1" %}
{% set version = "2.20.0" %}
{% set estimator_version = "2.15.0" %}
{% set build = 3 %}
{% set build = 0 %}

{% if cuda_compiler_version != "None" %}
{% set build = build + 200 %}
Expand All @@ -23,7 +23,7 @@ package:

source:
- url: https://github.com/tensorflow/tensorflow/archive/refs/tags/v{{ version.replace(".rc", "-rc") }}.tar.gz
sha256: fcfb3e88ab3eebdbab98a03c869a4d2616d52ea166c8d8021de1ef921b47be8d
sha256: a640d1f97be316a09301dfc9347e3d929ad4d9a2336e3ca23c32c93b0ff7e5d0
patches:
- patches/0001-loosen-requirements.patch
- patches/0002-Add-additional-absl_synchronization-linkage-to-gRPC.patch
Expand All @@ -37,46 +37,34 @@ source:
- patches/0010-Use-correct-hermetic-python.patch
- patches/0011-Add-well_known_types_py_pb2-to-protobuf-systemlib.patch
- patches/0012-Add-protobuf-toolchain.patch
- patches/0013-fix-genproto.patch
- patches/0014-Remove-some-usage-of-absl-str_format-in-CUDA.patch # [(cuda_compiler_version or "").startswith("11")]
- patches/0015-Adjust-relative-path-for-libdevice.patch # [(cuda_compiler_version or "").startswith("11")]
- patches/0016-Link-to-absl_log_flags-instead-of-absl_flags.patch
- patches/0017-Update-ABSL-Log-Definition-for-libabsl_vlog_config_i.patch
- patches/0018-add-absl_string_view-target.patch
- patches/0019-add-absl_nullability-target.patch
- patches/0020-add-absl_prefetch-target.patch
- patches/0021-add-absl_die_if_null-target.patch
- patches/0022-add-absl_crc32c-targets.patch
- patches/0023-add-kernel_timeout_internal-target.patch
- patches/0024-work-around-for-warning-that-clang-falsely-treats-as.patch
- patches/0025-Hardcode-BUILD_PREFIX-in-build_pip_package.patch
- patches/0026-Only-link-to-sparse_core_layout_proto_cc-headers.patch
- patches/0027-Protobuf-5-compatability.patch
# https://github.com/tensorflow/tensorflow/pull/86413
- patches/0028-Avoid-linking-with-internal-nvrtc.patch
- patches/0029-remove-dependencies-to-libcuda.patch
- patches/0013-add-absl_string_view-target.patch
- patches/0014-add-absl_nullability-target.patch
- patches/0015-add-absl_prefetch-target.patch
- patches/0016-add-absl_die_if_null-target.patch
- patches/0017-add-absl_crc32c-targets.patch
- patches/0018-add-kernel_timeout_internal-target.patch
- patches/0019-work-around-for-warning-that-clang-falsely-treats-as.patch
- patches/0020-Hardcode-BUILD_PREFIX-in-build_pip_package.patch
- patches/0021-Only-link-to-sparse_core_layout_proto_cc-headers.patch
- patches/0022-remove-dependencies-to-libcuda.patch
# adjust patch 0004 for newer absl -- hmaarrfk - 2025/07/06
- patches/0030-Fixup-pybind11_protobuf.patch
- patches/0031-Update-linkages-for-new-absl-organization.patch
# Already included in the release after 2.19.0
- patches/0032-Remove-ambiguous-inherited-constructor-in-default_qu.patch
- patches/0023-Fixup-pybind11_protobuf.patch
- patches/0024-Update-linkages-for-new-absl-organization.patch
# for our system absl
- patches/0025-add-absl_tracing_internal.patch
# for the megabuild
- patches/0026-Fix-building-different-python-wheels-from-one-python.patch
- patches/0027-Fix-matmul-unused-result-error.patch
- patches/0028-Support-cuda-12.8.patch
- patches/0029-Disable-profiler.patch
- patches/0030-cross-arch-config.patch # [aarch64 and target_platform != build_platform]
- patches/0031-Force-python-wheel-architecture-to-aarch64.patch # [aarch64 and target_platform != build_platform]
- patches/0032-Restore-system-link-files-for-absl.patch
# these came from https://git.yoctoproject.org/meta-tensorflow/tree/recipes-framework/tensorflow/files
# check every release there for patches in the future
# - patches/0033-third_party-ducc-fix-ambiguous-failure.patch
# - patches/0034-third_party-tf_runtime-fix-compile-failure.patch
# - patches/0035-support-to-build-with-gcc-15.patch
- patches/0036-third_party-eigen_archive-workaround-ice-failure-whi.patch
# for our system absl
- patches/0037-add-absl_tracing_internal.patch
# for the megabuild
- patches/0038-Fix-building-different-python-wheels-from-one-python.patch
- patches/0039-Fix-matmul-unused-result-error.patch
- patches/0040-Support-cuda-12.8.patch
- patches/0041-Disable-profiler.patch
- patches/0042-cross-arch-config.patch # [aarch64 and target_platform != build_platform]
# backport https://github.com/openxla/xla/pull/22572 into vendored xla
- patches/0044-PR-22572-Fix-build-break-in-convolution_thunk_intern.patch
- patches/0045-Force-python-wheel-architecture-to-aarch64.patch # [aarch64 and target_platform != build_platform]
- url: https://github.com/tensorflow/estimator/archive/refs/tags/v{{ estimator_version.replace(".rc", "-rc") }}.tar.gz
sha256: 2d7e100b1878084da34b5e23b49a0cbb5ee8a7add74b7dd189a82ada1cf85530
folder: tensorflow-estimator
Expand All @@ -90,6 +78,7 @@ build:
skip: true # [osx]
# TODO: debug issues with CUDA cross-compilation
skip: true # [aarch64 and cuda_compiler_version != "None"]
skip: true # [cuda_compiler_version != "None" or microarch_level != 1]

requirements:
build:
Expand Down Expand Up @@ -306,46 +295,48 @@ outputs:
# github.com/tensorflow/tensorflow/blob/v{{ version }}/tensorflow/tools/pip_package/setup.py
- absl-py >=1.0.0
- astunparse >=1.6.0
- python-flatbuffers >=24.3.25
- gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2
- google-pasta >=0.1.1
- h5py >=3.11
- ml_dtypes >={{ ml_dtypes_version }},<1.0
- numpy
- opt_einsum >=2.3.2
# simplified compared to upstream due to constraints arising through libprotobuf
- protobuf >=5.28
- python-flatbuffers >=24.3.25
- packaging
- protobuf >=5.28.0
- requests >=2.21.0,<3
- six >=1.12
- termcolor >=1.1.0
- typing_extensions >=3.6.6
- wrapt >=1.11.0
- grpcio {{ libgrpc }}.*
# TF-API needs to move in sync
- tensorboard >=2.19,<2.20
- keras >=3.5
- tensorboard >=2.20,<2.21
- keras >=3.10.0
- numpy
- h5py >=3.11.0
- ml_dtypes >={{ ml_dtypes_version }},<1.0.0
- {{ pin_subpackage("libtensorflow_framework", exact=True) }}
- {{ pin_subpackage("libtensorflow_cc", exact=True) }}
run:
- python
- packaging
- absl-py >=1.0.0
- astunparse >=1.6.0
- python-flatbuffers >=24.3.25
- gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2
- google-pasta >=0.1.1
- grpcio {{ libgrpc }}.*
- h5py >=3.11
- ml_dtypes >={{ ml_dtypes_version }},<1.0
- opt_einsum >=2.3.2
- protobuf >=5.26
- python-flatbuffers >=24.3.25
- packaging
- protobuf >=5.28.0
- requests >=2.21.0,<3
- six >=1.12
- termcolor >=1.1.0
- typing_extensions >=3.6.6
- wrapt >=1.11.0
- grpcio {{ libgrpc }}.*
# TF-API needs to move in sync
- tensorboard >=2.19,<2.20
- keras >=3.5
- tensorboard >=2.20,<2.21
- keras >=3.10.0
- numpy >=1.26.0
- h5py >=3.11.0
- ml_dtypes >={{ ml_dtypes_version }},<1.0.0
# avoid that people without GPUs needlessly download ~0.5-1GB
- __cuda # [cuda_compiler_version != "None"]
# https://github.com/conda-forge/tensorflow-feedstock/issues/296#issuecomment-1835781851
Expand Down
39 changes: 12 additions & 27 deletions recipe/patches/0001-loosen-requirements.patch
Original file line number Diff line number Diff line change
@@ -1,45 +1,30 @@
From 86b5ecb970a2893fa01360b830cb86c3c7d9fc75 Mon Sep 17 00:00:00 2001
From 2f14b99f6f10510d194cb40efad0a243690ffea2 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Thu, 30 Dec 2021 06:57:09 +0200
Subject: [PATCH 01/44] loosen requirements
Subject: [PATCH 01/31] loosen requirements

* Remove unused libclang requirement
* Remove unecessary tensorflow-io-gcs-filesystem
* unpin numpy
* numpy version was unpinned in a previous patch,
because of an upper bound. Recently it was removed

Co-authored-by: Mark Harfouche <mark.harfouche@gmail.com>
Co-authored-by: ngam
Co-authored-by: Uwe L. Korn <uwelk@xhochy.com>
Co-authored-by: Isuru Fernando <isuruf@gmail.com>
---
tensorflow/tools/pip_package/setup.py | 4 ----
1 file changed, 4 deletions(-)
tensorflow/tools/pip_package/setup.py.tpl | 1 -
1 file changed, 1 deletion(-)

diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py
index d83b45ea3cd..414b7df48b6 100644
--- a/tensorflow/tools/pip_package/setup.py
+++ b/tensorflow/tools/pip_package/setup.py
diff --git a/tensorflow/tools/pip_package/setup.py.tpl b/tensorflow/tools/pip_package/setup.py.tpl
index 949dc393c23..21d3a9330e5 100644
--- a/tensorflow/tools/pip_package/setup.py.tpl
+++ b/tensorflow/tools/pip_package/setup.py.tpl
@@ -84,7 +84,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
@@ -97,8 +96,6 @@ REQUIRED_PACKAGES = [
'termcolor >= 1.1.0',
'typing_extensions >= 3.6.6',
'wrapt >= 1.11.0',
- # TODO(b/305196096): Remove the <3.12 condition once the pkg is updated
- 'tensorflow-io-gcs-filesystem >= 0.23.1 ; python_version < "3.12"',
# grpcio does not build correctly on big-endian machines due to lack of
# BoringSSL support.
# See https://github.com/tensorflow/tensorflow/issues/17882.
@@ -114,7 +111,6 @@ REQUIRED_PACKAGES = [
# 'keras >= 2.14.0rc0, < 2.15' on the release branch after the branch cut.
'tensorboard ~= 2.19.0',
'keras >= 3.5.0',
- 'numpy >= 1.26.0, < 2.2.0',
'h5py >= 3.11.0',
'ml_dtypes >= 0.5.1, < 1.0.0',
]
'protobuf>=5.28.0',
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e5601104fd788ee7912858e97f3f67fc297463af Mon Sep 17 00:00:00 2001
From 6469c8bf17895651bc1e423020d1cf82a0f2e091 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Fri, 30 Jun 2023 08:39:32 +0000
Subject: [PATCH 02/44] Add additional absl_synchronization linkage to gRPC
Subject: [PATCH 02/31] Add additional absl_synchronization linkage to gRPC

---
third_party/systemlibs/grpc.BUILD | 3 +++
Expand Down
12 changes: 6 additions & 6 deletions recipe/patches/0003-Fix-missing-abseil-linkages.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From 5f000fa6e71b9dbaaf8fc1ac691e3884106cb852 Mon Sep 17 00:00:00 2001
From 8673f5a2ebc4665d497c9860708a659b07e77d21 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Mon, 3 Jul 2023 04:45:46 +0000
Subject: [PATCH 03/44] Fix missing abseil linkages
Subject: [PATCH 03/31] Fix missing abseil linkages

---
third_party/absl/system.absl.strings.BUILD | 2 +-
third_party/xla/third_party/absl/system.absl.strings.BUILD | 2 +-
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
diff --git a/third_party/xla/third_party/absl/system.absl.strings.BUILD b/third_party/xla/third_party/absl/system.absl.strings.BUILD
index fa9a7a84f67..d04776c98bf 100644
--- a/third_party/absl/system.absl.strings.BUILD
+++ b/third_party/absl/system.absl.strings.BUILD
--- a/third_party/xla/third_party/absl/system.absl.strings.BUILD
+++ b/third_party/xla/third_party/absl/system.absl.strings.BUILD
@@ -26,7 +26,7 @@ cc_library(

cc_library(
Expand Down
30 changes: 17 additions & 13 deletions recipe/patches/0004-Fix-protobuf_python-for-systemlibs.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
From 298c5e540ab03f75ab5ede906fbb21d54ee8dc8f Mon Sep 17 00:00:00 2001
From ad6b00e9edcd316d7009ecf749bd77c964f542b1 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Wed, 30 Aug 2023 16:58:41 +0200
Subject: [PATCH 04/44] Fix protobuf_python for systemlibs
Date: Fri, 6 Feb 2026 00:55:09 +0000
Subject: [PATCH 04/31] Fix protobuf_python for systemlibs

---
tensorflow/workspace2.bzl | 1 +
tensorflow/workspace2.bzl | 5 +++++
third_party/systemlibs/protobuf_python.bzl | 5 +++++
2 files changed, 6 insertions(+)
2 files changed, 10 insertions(+)
create mode 100644 third_party/systemlibs/protobuf_python.bzl

diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
index 5d75ffd4a6d..fe87aac9a8c 100644
index 9e49ab40b25..1f0ff1b11fd 100644
--- a/tensorflow/workspace2.bzl
+++ b/tensorflow/workspace2.bzl
@@ -401,6 +401,7 @@ def _tf_repositories():
system_link_files = {
"//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
"//third_party/systemlibs:protobuf_deps.bzl": "protobuf_deps.bzl",
@@ -396,6 +396,11 @@ def _tf_repositories():

tf_http_archive(
name = "com_google_protobuf",
+ system_link_files = {
+ "//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
+ "//third_party/systemlibs:protobuf_deps.bzl": "protobuf_deps.bzl",
+ "//third_party/systemlibs:protobuf_python.bzl": "python/BUILD",
},
urls = tf_mirror_urls("https://github.com/protocolbuffers/protobuf/archive/v3.21.9.zip"),
)
+ },
patch_file = ["@local_xla//third_party/protobuf:protobuf.patch"],
sha256 = "f645e6e42745ce922ca5388b1883ca583bafe4366cc74cf35c3c9299005136e2",
strip_prefix = "protobuf-5.28.3",
diff --git a/third_party/systemlibs/protobuf_python.bzl b/third_party/systemlibs/protobuf_python.bzl
new file mode 100644
index 00000000000..982617a765c
Expand Down
62 changes: 42 additions & 20 deletions recipe/patches/0005-Add-absl_log-systemlib.patch
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
From d49beaef49c52ea690f02de7cfbde0e6aef06490 Mon Sep 17 00:00:00 2001
From f891ca063cf333c2f52e58975fd28587ff7f7440 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Wed, 30 Aug 2023 16:59:28 +0200
Subject: [PATCH 05/44] Add absl_log systemlib
Date: Tue, 27 Feb 2024 18:01:19 -0500
Subject: [PATCH 05/31] Add absl_log systemlib

Co-authored-by: Mark Harfouche <mark.harfouche@gmail.com>
---
third_party/absl/system.absl.log.BUILD | 22 ++++++++++++++++++++++
third_party/absl/workspace.bzl | 1 +
2 files changed, 23 insertions(+)
third_party/absl/system.absl.log.BUILD | 24 +++++++++++++++++++
.../third_party/absl/system.absl.log.BUILD | 24 +++++++++++++++++++
2 files changed, 48 insertions(+)
create mode 100644 third_party/absl/system.absl.log.BUILD
create mode 100644 third_party/xla/third_party/absl/system.absl.log.BUILD

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 00000000000..1fe1e342594
--- /dev/null
+++ b/third_party/absl/system.absl.log.BUILD
@@ -0,0 +1,22 @@
@@ -0,0 +1,24 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+ name = "log",
+ linkopts = [
+ "-labsl_vlog_config_internal",
+ "-labsl_log_internal_conditions",
+ "-labsl_log_internal_check_op",
+ "-labsl_log_internal_message",
Expand All @@ -32,20 +35,39 @@ index 00000000000..0248bda0f52
+cc_library(
+ name = "check",
+ linkopts = [
+ "-labsl_vlog_config_internal",
+ "-labsl_log_internal_check_op",
+ "-labsl_log_internal_message",
+ "-labsl_log_internal_nullguard",
+ ],
+)
diff --git a/third_party/xla/third_party/absl/system.absl.log.BUILD b/third_party/xla/third_party/absl/system.absl.log.BUILD
new file mode 100644
index 00000000000..1fe1e342594
--- /dev/null
+++ b/third_party/xla/third_party/absl/system.absl.log.BUILD
@@ -0,0 +1,24 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+ name = "log",
+ linkopts = [
+ "-labsl_vlog_config_internal",
+ "-labsl_log_internal_conditions",
+ "-labsl_log_internal_check_op",
+ "-labsl_log_internal_message",
+ "-labsl_log_internal_nullguard",
+ ],
+)
+
+cc_library(
+ name = "check",
+ linkopts = [
+ "-labsl_vlog_config_internal",
+ "-labsl_log_internal_check_op",
+ "-labsl_log_internal_message",
+ "-labsl_log_internal_nullguard",
+ ],
+)
diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl
index d5973b13b39..b5197f9304b 100644
--- a/third_party/absl/workspace.bzl
+++ b/third_party/absl/workspace.bzl
@@ -20,6 +20,7 @@ def repo():
"flags",
"functional",
"hash",
+ "log",
"memory",
"meta",
"numeric",
Loading
Loading