From 23187362d5384f642ab829fa4a13d8682627b0a8 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 6 Feb 2026 01:16:45 +0000 Subject: [PATCH 1/2] update to 2.20.0 --- recipe/build_common.sh | 2 - recipe/meta.yaml | 96 +++--- recipe/patches/0001-loosen-requirements.patch | 39 +-- ...absl_synchronization-linkage-to-gRPC.patch | 4 +- .../0003-Fix-missing-abseil-linkages.patch | 12 +- ...4-Fix-protobuf_python-for-systemlibs.patch | 30 +- .../patches/0005-Add-absl_log-systemlib.patch | 62 ++-- ...layout_proto_cc-if-protobuf-linkage-.patch | 22 +- .../0007-Fix-further-abseil-linkage.patch | 12 +- ...Add-constraint-to-pybind11-systemlib.patch | 8 +- ...-file-ending-for-flatbuffers-LICENSE.patch | 4 +- .../0010-Use-correct-hermetic-python.patch | 4 +- ...n_types_py_pb2-to-protobuf-systemlib.patch | 4 +- .../patches/0012-Add-protobuf-toolchain.patch | 4 +- ...=> 0013-add-absl_string_view-target.patch} | 12 +- recipe/patches/0013-fix-genproto.patch | 25 -- ...ome-usage-of-absl-str_format-in-CUDA.patch | 69 ---- .../0014-add-absl_nullability-target.patch | 28 ++ ...5-Adjust-relative-path-for-libdevice.patch | 22 -- .../0015-add-absl_prefetch-target.patch | 28 ++ ...absl_log_flags-instead-of-absl_flags.patch | 36 -- ...=> 0016-add-absl_die_if_null-target.patch} | 4 +- ...Definition-for-libabsl_vlog_config_i.patch | 30 -- ...tch => 0017-add-absl_crc32c-targets.patch} | 27 +- ...-add-kernel_timeout_internal-target.patch} | 10 +- .../0019-add-absl_nullability-target.patch | 28 -- ...arning-that-clang-falsely-treats-as.patch} | 8 +- ...e-BUILD_PREFIX-in-build_pip_package.patch} | 4 +- .../0020-add-absl_prefetch-target.patch | 28 -- ...sparse_core_layout_proto_cc-headers.patch} | 8 +- .../0022-remove-dependencies-to-libcuda.patch | 22 ++ ...tch => 0023-Fixup-pybind11_protobuf.patch} | 51 ++- ...e-linkages-for-new-absl-organization.patch | 42 +++ ...h => 0025-add-absl_tracing_internal.patch} | 20 +- ...erent-python-wheels-from-one-python.patch} | 10 +- ...0027-Fix-matmul-unused-result-error.patch} | 8 +- .../0027-Protobuf-5-compatability.patch | 326 ------------------ ...28-Avoid-linking-with-internal-nvrtc.patch | 52 --- recipe/patches/0028-Support-cuda-12.8.patch | 34 ++ ...iler.patch => 0029-Disable-profiler.patch} | 4 +- .../0029-remove-dependencies-to-libcuda.patch | 36 -- ...fig.patch => 0030-cross-arch-config.patch} | 26 +- ...l-architecture-to-aarch64-When-cros.patch} | 8 +- ...e-linkages-for-new-absl-organization.patch | 76 ---- ...-inherited-constructor-in-default_qu.patch | 27 -- ...2-Restore-system-link-files-for-absl.patch | 53 +++ ...ird_party-ducc-fix-ambiguous-failure.patch | 114 ------ ...party-tf_runtime-fix-compile-failure.patch | 82 ----- .../0035-support-to-build-with-gcc-15.patch | 122 ------- ...n_archive-workaround-ice-failure-whi.patch | 107 ------ recipe/patches/0040-Support-cuda-12.8.patch | 79 ----- ...TFv2.20-to-compile-with-CUDA-v12.9.1.patch | 77 ----- ...ld-break-in-convolution_thunk_intern.patch | 75 ---- 53 files changed, 446 insertions(+), 1675 deletions(-) rename recipe/patches/{0018-add-absl_string_view-target.patch => 0013-add-absl_string_view-target.patch} (68%) delete mode 100644 recipe/patches/0013-fix-genproto.patch delete mode 100644 recipe/patches/0014-Remove-some-usage-of-absl-str_format-in-CUDA.patch create mode 100644 recipe/patches/0014-add-absl_nullability-target.patch delete mode 100644 recipe/patches/0015-Adjust-relative-path-for-libdevice.patch create mode 100644 recipe/patches/0015-add-absl_prefetch-target.patch delete mode 100644 recipe/patches/0016-Link-to-absl_log_flags-instead-of-absl_flags.patch rename recipe/patches/{0021-add-absl_die_if_null-target.patch => 0016-add-absl_die_if_null-target.patch} (88%) delete mode 100644 recipe/patches/0017-Update-ABSL-Log-Definition-for-libabsl_vlog_config_i.patch rename recipe/patches/{0022-add-absl_crc32c-targets.patch => 0017-add-absl_crc32c-targets.patch} (67%) rename recipe/patches/{0023-add-kernel_timeout_internal-target.patch => 0018-add-kernel_timeout_internal-target.patch} (68%) delete mode 100644 recipe/patches/0019-add-absl_nullability-target.patch rename recipe/patches/{0024-work-around-for-warning-that-clang-falsely-treats-as.patch => 0019-work-around-for-warning-that-clang-falsely-treats-as.patch} (68%) rename recipe/patches/{0025-Hardcode-BUILD_PREFIX-in-build_pip_package.patch => 0020-Hardcode-BUILD_PREFIX-in-build_pip_package.patch} (91%) delete mode 100644 recipe/patches/0020-add-absl_prefetch-target.patch rename recipe/patches/{0026-Only-link-to-sparse_core_layout_proto_cc-headers.patch => 0021-Only-link-to-sparse_core_layout_proto_cc-headers.patch} (78%) create mode 100644 recipe/patches/0022-remove-dependencies-to-libcuda.patch rename recipe/patches/{0030-Fixup-pybind11_protobuf.patch => 0023-Fixup-pybind11_protobuf.patch} (54%) create mode 100644 recipe/patches/0024-Update-linkages-for-new-absl-organization.patch rename recipe/patches/{0037-add-absl_tracing_internal.patch => 0025-add-absl_tracing_internal.patch} (55%) rename recipe/patches/{0038-Fix-building-different-python-wheels-from-one-python.patch => 0026-Fix-building-different-python-wheels-from-one-python.patch} (89%) rename recipe/patches/{0039-Fix-matmul-unused-result-error.patch => 0027-Fix-matmul-unused-result-error.patch} (77%) delete mode 100644 recipe/patches/0027-Protobuf-5-compatability.patch delete mode 100644 recipe/patches/0028-Avoid-linking-with-internal-nvrtc.patch create mode 100644 recipe/patches/0028-Support-cuda-12.8.patch rename recipe/patches/{0041-Disable-profiler.patch => 0029-Disable-profiler.patch} (94%) delete mode 100644 recipe/patches/0029-remove-dependencies-to-libcuda.patch rename recipe/patches/{0042-cross-arch-config.patch => 0030-cross-arch-config.patch} (62%) rename recipe/patches/{0045-Force-python-wheel-architecture-to-aarch64.patch => 0031-Force-python-wheel-architecture-to-aarch64-When-cros.patch} (83%) delete mode 100644 recipe/patches/0031-Update-linkages-for-new-absl-organization.patch delete mode 100644 recipe/patches/0032-Remove-ambiguous-inherited-constructor-in-default_qu.patch create mode 100644 recipe/patches/0032-Restore-system-link-files-for-absl.patch delete mode 100644 recipe/patches/0033-third_party-ducc-fix-ambiguous-failure.patch delete mode 100644 recipe/patches/0034-third_party-tf_runtime-fix-compile-failure.patch delete mode 100644 recipe/patches/0035-support-to-build-with-gcc-15.patch delete mode 100644 recipe/patches/0036-third_party-eigen_archive-workaround-ice-failure-whi.patch delete mode 100644 recipe/patches/0040-Support-cuda-12.8.patch delete mode 100644 recipe/patches/0043-Support-for-TFv2.20-to-compile-with-CUDA-v12.9.1.patch delete mode 100644 recipe/patches/0044-PR-22572-Fix-build-break-in-convolution_thunk_intern.patch diff --git a/recipe/build_common.sh b/recipe/build_common.sh index ca648120..f03500d8 100644 --- a/recipe/build_common.sh +++ b/recipe/build_common.sh @@ -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 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b3074c7c..1758850e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -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 %} @@ -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 @@ -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 @@ -306,46 +294,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 diff --git a/recipe/patches/0001-loosen-requirements.patch b/recipe/patches/0001-loosen-requirements.patch index 108813cd..268c6910 100644 --- a/recipe/patches/0001-loosen-requirements.patch +++ b/recipe/patches/0001-loosen-requirements.patch @@ -1,23 +1,25 @@ -From 86b5ecb970a2893fa01360b830cb86c3c7d9fc75 Mon Sep 17 00:00:00 2001 +From 2f14b99f6f10510d194cb40efad0a243690ffea2 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" 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 Co-authored-by: ngam Co-authored-by: Uwe L. Korn +Co-authored-by: Isuru Fernando --- - 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', @@ -25,21 +27,4 @@ index d83b45ea3cd..414b7df48b6 100644 - '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', diff --git a/recipe/patches/0002-Add-additional-absl_synchronization-linkage-to-gRPC.patch b/recipe/patches/0002-Add-additional-absl_synchronization-linkage-to-gRPC.patch index 57932124..a6facecd 100644 --- a/recipe/patches/0002-Add-additional-absl_synchronization-linkage-to-gRPC.patch +++ b/recipe/patches/0002-Add-additional-absl_synchronization-linkage-to-gRPC.patch @@ -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" 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 +++ diff --git a/recipe/patches/0003-Fix-missing-abseil-linkages.patch b/recipe/patches/0003-Fix-missing-abseil-linkages.patch index abb722d1..e03f9d2b 100644 --- a/recipe/patches/0003-Fix-missing-abseil-linkages.patch +++ b/recipe/patches/0003-Fix-missing-abseil-linkages.patch @@ -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" 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( diff --git a/recipe/patches/0004-Fix-protobuf_python-for-systemlibs.patch b/recipe/patches/0004-Fix-protobuf_python-for-systemlibs.patch index f084f170..036106a6 100644 --- a/recipe/patches/0004-Fix-protobuf_python-for-systemlibs.patch +++ b/recipe/patches/0004-Fix-protobuf_python-for-systemlibs.patch @@ -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" -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 diff --git a/recipe/patches/0005-Add-absl_log-systemlib.patch b/recipe/patches/0005-Add-absl_log-systemlib.patch index c846087e..289fc295 100644 --- a/recipe/patches/0005-Add-absl_log-systemlib.patch +++ b/recipe/patches/0005-Add-absl_log-systemlib.patch @@ -1,20 +1,22 @@ -From d49beaef49c52ea690f02de7cfbde0e6aef06490 Mon Sep 17 00:00:00 2001 +From f891ca063cf333c2f52e58975fd28587ff7f7440 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" -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 --- - 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"]) @@ -22,6 +24,7 @@ index 00000000000..0248bda0f52 +cc_library( + name = "log", + linkopts = [ ++ "-labsl_vlog_config_internal", + "-labsl_log_internal_conditions", + "-labsl_log_internal_check_op", + "-labsl_log_internal_message", @@ -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", diff --git a/recipe/patches/0006-Omit-linking-to-layout_proto_cc-if-protobuf-linkage-.patch b/recipe/patches/0006-Omit-linking-to-layout_proto_cc-if-protobuf-linkage-.patch index 3ddd9614..03c00b40 100644 --- a/recipe/patches/0006-Omit-linking-to-layout_proto_cc-if-protobuf-linkage-.patch +++ b/recipe/patches/0006-Omit-linking-to-layout_proto_cc-if-protobuf-linkage-.patch @@ -1,7 +1,7 @@ -From e449e51b042dac4e687fb9dd95cb472819ae0dba Mon Sep 17 00:00:00 2001 +From d202b58b74d311e89d29cc0ce303c3ac46d7e292 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" -Date: Fri, 15 Sep 2023 11:06:27 +0200 -Subject: [PATCH 06/44] Omit linking to layout_proto_cc if protobuf linkage is +Date: Fri, 6 Feb 2026 00:58:49 +0000 +Subject: [PATCH 06/31] Omit linking to layout_proto_cc if protobuf linkage is shared --- @@ -9,14 +9,14 @@ Subject: [PATCH 06/44] 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 8a781badc68..5edfb0a4846 100644 +index 8fea090dc44..d291f01b188 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD -@@ -1382,7 +1382,6 @@ tf_python_pybind_extension( - features = ["-layering_check"], - deps = [ - ":pywrap_densor_device_headers", +@@ -1402,7 +1402,6 @@ tf_pybind_cc_library_wrapper( + "//tensorflow/core:protos_all_cc", + "//tensorflow/dtensor/cc:dtensor_device_cc", + "//tensorflow/dtensor/cc:tensor_layout", - "//tensorflow/dtensor/proto:layout_proto_cc", - "//tensorflow/python/lib/core:pybind11_lib", - "//tensorflow/python/lib/core:pybind11_status_headers", - "//third_party/python_runtime:headers", # buildcleaner: keep + "//tensorflow/python/eager:pywrap_tfe_lib", + "//tensorflow/python/lib/core:safe_pyobject_ptr", + "//tensorflow/python/util:cpp_python_util", diff --git a/recipe/patches/0007-Fix-further-abseil-linkage.patch b/recipe/patches/0007-Fix-further-abseil-linkage.patch index 75d0c8fe..11336757 100644 --- a/recipe/patches/0007-Fix-further-abseil-linkage.patch +++ b/recipe/patches/0007-Fix-further-abseil-linkage.patch @@ -1,16 +1,16 @@ -From 7010ed5f6b5832cebabee3ff33cd987dc003fcdc Mon Sep 17 00:00:00 2001 +From 10637c2f7dc01f61c13abfba9c0db5724001f306 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Mon, 18 Sep 2023 14:47:08 +0000 -Subject: [PATCH 07/44] Fix further abseil linkage +Subject: [PATCH 07/31] Fix further abseil linkage --- - third_party/absl/system.absl.base.BUILD | 14 ++++++++++++-- + .../xla/third_party/absl/system.absl.base.BUILD | 14 ++++++++++++-- 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 +diff --git a/third_party/xla/third_party/absl/system.absl.base.BUILD b/third_party/xla/third_party/absl/system.absl.base.BUILD index d6bf8748dee..b3e42f4dd8b 100644 ---- a/third_party/absl/system.absl.base.BUILD -+++ b/third_party/absl/system.absl.base.BUILD +--- a/third_party/xla/third_party/absl/system.absl.base.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.base.BUILD @@ -17,12 +17,22 @@ package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/recipe/patches/0008-Add-constraint-to-pybind11-systemlib.patch b/recipe/patches/0008-Add-constraint-to-pybind11-systemlib.patch index 915430dc..312620da 100644 --- a/recipe/patches/0008-Add-constraint-to-pybind11-systemlib.patch +++ b/recipe/patches/0008-Add-constraint-to-pybind11-systemlib.patch @@ -1,18 +1,18 @@ -From 8d650f38d371a8ba2a48bf2caed5ec094a15a4c3 Mon Sep 17 00:00:00 2001 +From b376774d7eb851a7ee56f9bf4df1364bf9000956 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 27 Oct 2023 11:20:12 +0200 -Subject: [PATCH 08/44] Add constraint to pybind11 systemlib +Subject: [PATCH 08/31] Add constraint to pybind11 systemlib --- third_party/systemlibs/pybind11.BUILD | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/third_party/systemlibs/pybind11.BUILD b/third_party/systemlibs/pybind11.BUILD -index 44e7496fc25..21ec073b7a4 100644 +index 6579133497d..66fee809387 100644 --- a/third_party/systemlibs/pybind11.BUILD +++ b/third_party/systemlibs/pybind11.BUILD @@ -6,3 +6,9 @@ cc_library( - "@local_tsl//third_party/python_runtime:headers", + "@xla@local_xla//third_party/python_runtime:headers", ], ) + diff --git a/recipe/patches/0009-Different-file-ending-for-flatbuffers-LICENSE.patch b/recipe/patches/0009-Different-file-ending-for-flatbuffers-LICENSE.patch index 479df023..f6c38709 100644 --- a/recipe/patches/0009-Different-file-ending-for-flatbuffers-LICENSE.patch +++ b/recipe/patches/0009-Different-file-ending-for-flatbuffers-LICENSE.patch @@ -1,7 +1,7 @@ -From 0a2b6ff411c387419807e50b9a4dc61118068d40 Mon Sep 17 00:00:00 2001 +From dc5e8151e18c876df322b1184249dbe0f6cee309 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 27 Oct 2023 11:21:11 +0200 -Subject: [PATCH 09/44] Different file ending for flatbuffers LICENSE +Subject: [PATCH 09/31] Different file ending for flatbuffers LICENSE --- third_party/flatbuffers/BUILD.system | 5 +++++ diff --git a/recipe/patches/0010-Use-correct-hermetic-python.patch b/recipe/patches/0010-Use-correct-hermetic-python.patch index fcff78b9..569ae952 100644 --- a/recipe/patches/0010-Use-correct-hermetic-python.patch +++ b/recipe/patches/0010-Use-correct-hermetic-python.patch @@ -1,7 +1,7 @@ -From 5097302c242f7640cfe9dc9c390f74e72e16f2db Mon Sep 17 00:00:00 2001 +From 963584b5c000b7479dfb0a0bd39a65cd776e3942 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 27 Oct 2023 11:21:38 +0200 -Subject: [PATCH 10/44] Use correct, hermetic python +Subject: [PATCH 10/31] Use correct, hermetic python --- .../tensorflow/gen_quantized_function_library.py | 5 +++++ diff --git a/recipe/patches/0011-Add-well_known_types_py_pb2-to-protobuf-systemlib.patch b/recipe/patches/0011-Add-well_known_types_py_pb2-to-protobuf-systemlib.patch index 559f977e..2bace05d 100644 --- a/recipe/patches/0011-Add-well_known_types_py_pb2-to-protobuf-systemlib.patch +++ b/recipe/patches/0011-Add-well_known_types_py_pb2-to-protobuf-systemlib.patch @@ -1,7 +1,7 @@ -From 4c8a39682d2b46a28f18e8b229d28a979baf54f5 Mon Sep 17 00:00:00 2001 +From c2174cf6aa9541f75f018f798d4b08b129a88ff4 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 15 Nov 2023 09:18:28 +0100 -Subject: [PATCH 11/44] Add well_known_types_py_pb2 to protobuf systemlib +Subject: [PATCH 11/31] Add well_known_types_py_pb2 to protobuf systemlib --- third_party/systemlibs/protobuf.BUILD | 7 +++++++ diff --git a/recipe/patches/0012-Add-protobuf-toolchain.patch b/recipe/patches/0012-Add-protobuf-toolchain.patch index cc974899..dd3a50a4 100644 --- a/recipe/patches/0012-Add-protobuf-toolchain.patch +++ b/recipe/patches/0012-Add-protobuf-toolchain.patch @@ -1,7 +1,7 @@ -From f2e7bff21265718819306bb033aa6e3b2616cac0 Mon Sep 17 00:00:00 2001 +From 9a0b610a9c7c913be62df0694f5e1c4301f78098 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 15 Nov 2023 10:32:41 +0000 -Subject: [PATCH 12/44] Add protobuf toolchain +Subject: [PATCH 12/31] Add protobuf toolchain --- third_party/systemlibs/protobuf.BUILD | 14 ++++++++++++++ diff --git a/recipe/patches/0018-add-absl_string_view-target.patch b/recipe/patches/0013-add-absl_string_view-target.patch similarity index 68% rename from recipe/patches/0018-add-absl_string_view-target.patch rename to recipe/patches/0013-add-absl_string_view-target.patch index 75cdab0a..233cb289 100644 --- a/recipe/patches/0018-add-absl_string_view-target.patch +++ b/recipe/patches/0013-add-absl_string_view-target.patch @@ -1,16 +1,16 @@ -From d6340079592e35b7b6509a22380c707ba7e3a211 Mon Sep 17 00:00:00 2001 +From ef923bfc6e62de2232bc00f5b5b7196e2b759687 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 12 May 2024 18:45:03 +1100 -Subject: [PATCH 18/44] add absl_string_view target +Subject: [PATCH 13/31] add absl_string_view target --- - third_party/absl/system.absl.strings.BUILD | 14 +++++++++++++- + .../xla/third_party/absl/system.absl.strings.BUILD | 14 +++++++++++++- 1 file changed, 13 insertions(+), 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 d04776c98bf..9f537def3d7 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 @@ -2,6 +2,18 @@ load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/recipe/patches/0013-fix-genproto.patch b/recipe/patches/0013-fix-genproto.patch deleted file mode 100644 index 1f362c8e..00000000 --- a/recipe/patches/0013-fix-genproto.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e3180872dd6e3c4e43b41153e10d4972df76e0fe Mon Sep 17 00:00:00 2001 -From: "Uwe L. Korn" -Date: Thu, 16 Nov 2023 06:38:27 +0000 -Subject: [PATCH 13/44] fix genproto - ---- - third_party/xla/xla/tsl/platform/default/build_config.bzl | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/third_party/xla/xla/tsl/platform/default/build_config.bzl b/third_party/xla/xla/tsl/platform/default/build_config.bzl -index dd79a03cd8a..ec2b163f3b0 100644 ---- a/third_party/xla/xla/tsl/platform/default/build_config.bzl -+++ b/third_party/xla/xla/tsl/platform/default/build_config.bzl -@@ -423,10 +423,7 @@ def py_proto_library( - - genproto_deps = [] - for dep in deps: -- if dep != "@com_google_protobuf//:protobuf_python": -- genproto_deps.append(dep + "_genproto") -- else: -- genproto_deps.append("@com_google_protobuf//:well_known_types_py_pb2_genproto") -+ genproto_deps.append(dep + "_genproto") - - proto_gen( - name = name + "_genproto", diff --git a/recipe/patches/0014-Remove-some-usage-of-absl-str_format-in-CUDA.patch b/recipe/patches/0014-Remove-some-usage-of-absl-str_format-in-CUDA.patch deleted file mode 100644 index 781c3aae..00000000 --- a/recipe/patches/0014-Remove-some-usage-of-absl-str_format-in-CUDA.patch +++ /dev/null @@ -1,69 +0,0 @@ -From f3cd093d95bc29c6181c7c0e2d8b67cecfe41704 Mon Sep 17 00:00:00 2001 -From: "Uwe L. Korn" -Date: Thu, 23 Nov 2023 09:05:37 +0000 -Subject: [PATCH 14/44] Remove some usage of absl::str_format in CUDA - -nvcc from CUDA 11 is unable to correctly handle the new C++ features -used in this template. We use a different implementation that should -yield the same results without the usage of absl. ---- - tensorflow/core/framework/resource_base.h | 10 ++++++++-- - tensorflow/core/framework/resource_var.cc | 2 ++ - tensorflow/core/kernels/conv_ops_gpu.h | 2 +- - 3 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/tensorflow/core/framework/resource_base.h b/tensorflow/core/framework/resource_base.h -index c22adb559f1..8b218e6eb10 100644 ---- a/tensorflow/core/framework/resource_base.h -+++ b/tensorflow/core/framework/resource_base.h -@@ -18,8 +18,9 @@ limitations under the License. - - #include - #include -+#include - --#include "absl/strings/str_format.h" -+// #include "absl/strings/str_format.h" - #include "tensorflow/core/lib/core/refcount.h" - #include "tensorflow/core/lib/core/status.h" - #include "tensorflow/core/platform/errors.h" -@@ -41,7 +42,12 @@ class ResourceBase : public core::WeakRefCounted { - - // Returns a name for ref-counting handles. - virtual std::string MakeRefCountingHandleName(int64_t resource_id) const { -- return absl::StrFormat("Resource-%d-at-%p", resource_id, this); -+ std::ostringstream stringStream; -+ stringStream << "Resource-"; -+ stringStream << resource_id; -+ stringStream << "-"; -+ stringStream << reinterpret_cast(this); -+ return stringStream.str(); - } - - // Returns memory used by this resource. -diff --git a/tensorflow/core/framework/resource_var.cc b/tensorflow/core/framework/resource_var.cc -index 9cd77215af9..36dff751cdf 100644 ---- a/tensorflow/core/framework/resource_var.cc -+++ b/tensorflow/core/framework/resource_var.cc -@@ -18,6 +18,8 @@ limitations under the License. - #include "tensorflow/core/framework/resource_handle.h" - #include "tensorflow/core/graph/graph_def_builder.h" - -+#include "absl/strings/str_format.h" -+ - namespace tensorflow { - - absl::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 ---- a/tensorflow/core/kernels/conv_ops_gpu.h -+++ b/tensorflow/core/kernels/conv_ops_gpu.h -@@ -22,7 +22,7 @@ limitations under the License. - #include - - #include "absl/strings/str_cat.h" --#include "absl/strings/str_format.h" -+// #include "absl/strings/str_format.h" - #include "tensorflow/core/framework/op_kernel.h" - #include "tensorflow/core/kernels/gpu_utils.h" - #include "tensorflow/core/lib/gtl/inlined_vector.h" diff --git a/recipe/patches/0014-add-absl_nullability-target.patch b/recipe/patches/0014-add-absl_nullability-target.patch new file mode 100644 index 00000000..d0241544 --- /dev/null +++ b/recipe/patches/0014-add-absl_nullability-target.patch @@ -0,0 +1,28 @@ +From bb9a17a5a45a9b0175dd93fcb5723ca4c657e3f0 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Sun, 12 May 2024 19:30:44 +1100 +Subject: [PATCH 14/31] add absl_nullability target + +--- + third_party/xla/third_party/absl/system.absl.base.BUILD | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/third_party/xla/third_party/absl/system.absl.base.BUILD b/third_party/xla/third_party/absl/system.absl.base.BUILD +index b3e42f4dd8b..a423d5f70da 100644 +--- a/third_party/xla/third_party/absl/system.absl.base.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.base.BUILD +@@ -25,6 +25,14 @@ cc_library( + ], + ) + ++cc_library( ++ name = "nullability", ++ deps = [ ++ ":core_headers", ++ "//absl/meta:type_traits", ++ ], ++) ++ + cc_library( + name = "raw_logging_internal", + linkopts = [ diff --git a/recipe/patches/0015-Adjust-relative-path-for-libdevice.patch b/recipe/patches/0015-Adjust-relative-path-for-libdevice.patch deleted file mode 100644 index 085835d7..00000000 --- a/recipe/patches/0015-Adjust-relative-path-for-libdevice.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 1d522f6512d35302e585f330fd2a7f6dace75cef Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Sat, 27 Jan 2024 22:27:56 -0500 -Subject: [PATCH 15/44] Adjust relative path for libdevice - ---- - third_party/xla/xla/tsl/platform/default/cuda_root_path.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/third_party/xla/xla/tsl/platform/default/cuda_root_path.cc b/third_party/xla/xla/tsl/platform/default/cuda_root_path.cc -index 60c7dabf3ea..8d1f29b2e90 100644 ---- a/third_party/xla/xla/tsl/platform/default/cuda_root_path.cc -+++ b/third_party/xla/xla/tsl/platform/default/cuda_root_path.cc -@@ -70,7 +70,7 @@ std::vector CandidateCudaRoots() { - // TF lib binaries are located in both the package's root dir and within a - // 'python' subdirectory (for pywrap libs). So we check two possible paths - // relative to the current binary for the wheel-based nvcc package. -- for (auto path : {"../nvidia/cuda_nvcc", "../../nvidia/cuda_nvcc"}) -+ for (auto path : {"../nvidia/cuda_nvcc", "../../nvidia/cuda_nvcc", "../../../.."}) - roots.emplace_back(io::JoinPath(dir, path)); - - // Also add the path to the copy of libdevice.10.bc that we include within diff --git a/recipe/patches/0015-add-absl_prefetch-target.patch b/recipe/patches/0015-add-absl_prefetch-target.patch new file mode 100644 index 00000000..fe2aaffe --- /dev/null +++ b/recipe/patches/0015-add-absl_prefetch-target.patch @@ -0,0 +1,28 @@ +From 68452f5ac9365b0d7957fc4df50088119bf5181d Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Sun, 12 May 2024 22:29:25 +1100 +Subject: [PATCH 15/31] add absl_prefetch target + +--- + third_party/xla/third_party/absl/system.absl.base.BUILD | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/third_party/xla/third_party/absl/system.absl.base.BUILD b/third_party/xla/third_party/absl/system.absl.base.BUILD +index a423d5f70da..b31592d31a3 100644 +--- a/third_party/xla/third_party/absl/system.absl.base.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.base.BUILD +@@ -116,6 +116,14 @@ cc_library( + ], + ) + ++cc_library( ++ name = "prefetch", ++ deps = [ ++ ":config", ++ ":core_headers", ++ ], ++) ++ + cc_library( + name = "strerror", + linkopts = ["-labsl_strerror"], diff --git a/recipe/patches/0016-Link-to-absl_log_flags-instead-of-absl_flags.patch b/recipe/patches/0016-Link-to-absl_log_flags-instead-of-absl_flags.patch deleted file mode 100644 index 0806be35..00000000 --- a/recipe/patches/0016-Link-to-absl_log_flags-instead-of-absl_flags.patch +++ /dev/null @@ -1,36 +0,0 @@ -From a019073e0a9bdda8b43809f2b9627da43c934f01 Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Mon, 26 Feb 2024 22:30:08 -0500 -Subject: [PATCH 16/44] Link to absl_log_flags instead of absl_flags - ---- - third_party/absl/system.absl.flags.BUILD | 2 +- - .../third_party/tsl/third_party/absl/system.absl.flags.BUILD | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/third_party/absl/system.absl.flags.BUILD b/third_party/absl/system.absl.flags.BUILD -index aff653c7e5b..ee2e1bfe5e3 100644 ---- a/third_party/absl/system.absl.flags.BUILD -+++ b/third_party/absl/system.absl.flags.BUILD -@@ -97,7 +97,7 @@ cc_library( - - cc_library( - name = "flag", -- linkopts = ["-labsl_flags"], -+ linkopts = ["-labsl_log_flags"], - deps = [ - ":config", - ":flag_internal", -diff --git a/third_party/xla/third_party/tsl/third_party/absl/system.absl.flags.BUILD b/third_party/xla/third_party/tsl/third_party/absl/system.absl.flags.BUILD -index aff653c7e5b..ee2e1bfe5e3 100644 ---- a/third_party/xla/third_party/tsl/third_party/absl/system.absl.flags.BUILD -+++ b/third_party/xla/third_party/tsl/third_party/absl/system.absl.flags.BUILD -@@ -97,7 +97,7 @@ cc_library( - - cc_library( - name = "flag", -- linkopts = ["-labsl_flags"], -+ linkopts = ["-labsl_log_flags"], - deps = [ - ":config", - ":flag_internal", diff --git a/recipe/patches/0021-add-absl_die_if_null-target.patch b/recipe/patches/0016-add-absl_die_if_null-target.patch similarity index 88% rename from recipe/patches/0021-add-absl_die_if_null-target.patch rename to recipe/patches/0016-add-absl_die_if_null-target.patch index a817f344..f218ff58 100644 --- a/recipe/patches/0021-add-absl_die_if_null-target.patch +++ b/recipe/patches/0016-add-absl_die_if_null-target.patch @@ -1,7 +1,7 @@ -From 8e9d35b78cda40fedda6b689e8ce06f1d8ea9191 Mon Sep 17 00:00:00 2001 +From 8c430dd6b5c50b36ee8319f73754df0dfd625165 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 12 May 2024 22:46:04 +1100 -Subject: [PATCH 21/44] add absl_die_if_null target +Subject: [PATCH 16/31] add absl_die_if_null target --- third_party/absl/system.absl.log.BUILD | 16 ++++++++++++++++ diff --git a/recipe/patches/0017-Update-ABSL-Log-Definition-for-libabsl_vlog_config_i.patch b/recipe/patches/0017-Update-ABSL-Log-Definition-for-libabsl_vlog_config_i.patch deleted file mode 100644 index 9e2da8d2..00000000 --- a/recipe/patches/0017-Update-ABSL-Log-Definition-for-libabsl_vlog_config_i.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 7f4410d060de5477f5ef3b6d95e9045bf141a0a4 Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Tue, 27 Feb 2024 18:01:19 -0500 -Subject: [PATCH 17/44] Update ABSL Log Definition for - libabsl_vlog_config_internal.so - ---- - third_party/absl/system.absl.log.BUILD | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/absl/system.absl.log.BUILD b/third_party/absl/system.absl.log.BUILD -index 0248bda0f52..1fe1e342594 100644 ---- a/third_party/absl/system.absl.log.BUILD -+++ b/third_party/absl/system.absl.log.BUILD -@@ -5,6 +5,7 @@ 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", -@@ -15,6 +16,7 @@ cc_library( - 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/recipe/patches/0022-add-absl_crc32c-targets.patch b/recipe/patches/0017-add-absl_crc32c-targets.patch similarity index 67% rename from recipe/patches/0022-add-absl_crc32c-targets.patch rename to recipe/patches/0017-add-absl_crc32c-targets.patch index 0f737a4a..47d4f6ce 100644 --- a/recipe/patches/0022-add-absl_crc32c-targets.patch +++ b/recipe/patches/0017-add-absl_crc32c-targets.patch @@ -1,19 +1,18 @@ -From 1d94d4f352debab84e477765e739c644e77951d9 Mon Sep 17 00:00:00 2001 +From 286e158d02cf6c6c72b42ff10e7140ee131cb83a Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 13 May 2024 09:41:09 +1100 -Subject: [PATCH 22/44] add absl_crc32c targets +Subject: [PATCH 17/31] add absl_crc32c targets --- - third_party/absl/system.absl.crc.BUILD | 70 ++++++++++++++++++++++++++ - third_party/absl/workspace.bzl | 1 + - 2 files changed, 71 insertions(+) - create mode 100644 third_party/absl/system.absl.crc.BUILD + .../third_party/absl/system.absl.crc.BUILD | 70 +++++++++++++++++++ + 1 file changed, 70 insertions(+) + create mode 100644 third_party/xla/third_party/absl/system.absl.crc.BUILD -diff --git a/third_party/absl/system.absl.crc.BUILD b/third_party/absl/system.absl.crc.BUILD +diff --git a/third_party/xla/third_party/absl/system.absl.crc.BUILD b/third_party/xla/third_party/absl/system.absl.crc.BUILD new file mode 100644 index 00000000000..487c36ff45b --- /dev/null -+++ b/third_party/absl/system.absl.crc.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.crc.BUILD @@ -0,0 +1,70 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + @@ -85,15 +84,3 @@ index 00000000000..487c36ff45b + "//absl/base:config", + ], +) -diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl -index b5197f9304b..0bb3fbbf074 100644 ---- a/third_party/absl/workspace.bzl -+++ b/third_party/absl/workspace.bzl -@@ -14,6 +14,7 @@ def repo(): - SYS_DIRS = [ - "algorithm", - "base", -+ "crc", - "cleanup", - "container", - "debugging", diff --git a/recipe/patches/0023-add-kernel_timeout_internal-target.patch b/recipe/patches/0018-add-kernel_timeout_internal-target.patch similarity index 68% rename from recipe/patches/0023-add-kernel_timeout_internal-target.patch rename to recipe/patches/0018-add-kernel_timeout_internal-target.patch index 064bba4e..8a4eae48 100644 --- a/recipe/patches/0023-add-kernel_timeout_internal-target.patch +++ b/recipe/patches/0018-add-kernel_timeout_internal-target.patch @@ -1,16 +1,16 @@ -From 2ed8ab6b39dfa68f5250c73b0ae618b627b3b6d4 Mon Sep 17 00:00:00 2001 +From 1328e9194c0155d246b9f86e5d1bdfdf7c581321 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 13 May 2024 23:36:48 +1100 -Subject: [PATCH 23/44] add kernel_timeout_internal target +Subject: [PATCH 18/31] add kernel_timeout_internal target --- .../absl/system.absl.synchronization.BUILD | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -diff --git a/third_party/absl/system.absl.synchronization.BUILD b/third_party/absl/system.absl.synchronization.BUILD +diff --git a/third_party/xla/third_party/absl/system.absl.synchronization.BUILD b/third_party/xla/third_party/absl/system.absl.synchronization.BUILD index c0fa37aacd7..b47309deb39 100644 ---- a/third_party/absl/system.absl.synchronization.BUILD -+++ b/third_party/absl/system.absl.synchronization.BUILD +--- a/third_party/xla/third_party/absl/system.absl.synchronization.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.synchronization.BUILD @@ -16,14 +16,29 @@ cc_library( ], ) diff --git a/recipe/patches/0019-add-absl_nullability-target.patch b/recipe/patches/0019-add-absl_nullability-target.patch deleted file mode 100644 index fa97841a..00000000 --- a/recipe/patches/0019-add-absl_nullability-target.patch +++ /dev/null @@ -1,28 +0,0 @@ -From af586f3e99c1900f3d3682aa051e598b0dfc0655 Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Sun, 12 May 2024 19:30:44 +1100 -Subject: [PATCH 19/44] add absl_nullability target - ---- - third_party/absl/system.absl.base.BUILD | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/third_party/absl/system.absl.base.BUILD b/third_party/absl/system.absl.base.BUILD -index b3e42f4dd8b..a423d5f70da 100644 ---- a/third_party/absl/system.absl.base.BUILD -+++ b/third_party/absl/system.absl.base.BUILD -@@ -25,6 +25,14 @@ cc_library( - ], - ) - -+cc_library( -+ name = "nullability", -+ deps = [ -+ ":core_headers", -+ "//absl/meta:type_traits", -+ ], -+) -+ - cc_library( - name = "raw_logging_internal", - linkopts = [ diff --git a/recipe/patches/0024-work-around-for-warning-that-clang-falsely-treats-as.patch b/recipe/patches/0019-work-around-for-warning-that-clang-falsely-treats-as.patch similarity index 68% rename from recipe/patches/0024-work-around-for-warning-that-clang-falsely-treats-as.patch rename to recipe/patches/0019-work-around-for-warning-that-clang-falsely-treats-as.patch index 8f3b9d72..54967eb8 100644 --- a/recipe/patches/0024-work-around-for-warning-that-clang-falsely-treats-as.patch +++ b/recipe/patches/0019-work-around-for-warning-that-clang-falsely-treats-as.patch @@ -1,7 +1,7 @@ -From 9f9cee3c5d744678c571a214961dc760d7a56699 Mon Sep 17 00:00:00 2001 +From 990b1a093fe8431079002674f1f6229c12cd5966 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 19 May 2024 20:52:35 +1100 -Subject: [PATCH 24/44] work around for warning that clang falsely treats as +Subject: [PATCH 19/31] work around for warning that clang falsely treats as error see https://github.com/llvm/llvm-project/issues/92630 @@ -10,10 +10,10 @@ see https://github.com/llvm/llvm-project/issues/92630 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc -index b9f83146895..6ba3875c4de 100644 +index 46f2ee94ae3..6e4bc245e4a 100644 --- a/.bazelrc +++ b/.bazelrc -@@ -331,7 +331,7 @@ build:ios --noenable_platform_specific_config +@@ -395,7 +395,7 @@ build:ios --noenable_platform_specific_config build:android --copt=-w build:ios --copt=-w build:linux --host_copt=-w diff --git a/recipe/patches/0025-Hardcode-BUILD_PREFIX-in-build_pip_package.patch b/recipe/patches/0020-Hardcode-BUILD_PREFIX-in-build_pip_package.patch similarity index 91% rename from recipe/patches/0025-Hardcode-BUILD_PREFIX-in-build_pip_package.patch rename to recipe/patches/0020-Hardcode-BUILD_PREFIX-in-build_pip_package.patch index 3431e7aa..1866e0b0 100644 --- a/recipe/patches/0025-Hardcode-BUILD_PREFIX-in-build_pip_package.patch +++ b/recipe/patches/0020-Hardcode-BUILD_PREFIX-in-build_pip_package.patch @@ -1,7 +1,7 @@ -From e6939ac299265f14f14e1c52b02bfcf410ff7860 Mon Sep 17 00:00:00 2001 +From df931f2deb7fb165a0642d80041cdabd4a2b7ff0 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 12 Jul 2024 12:52:38 +0000 -Subject: [PATCH 25/44] Hardcode BUILD_PREFIX in build_pip_package +Subject: [PATCH 20/31] Hardcode BUILD_PREFIX in build_pip_package --- tensorflow/tools/pip_package/build_pip_package.py | 6 +++--- diff --git a/recipe/patches/0020-add-absl_prefetch-target.patch b/recipe/patches/0020-add-absl_prefetch-target.patch deleted file mode 100644 index 59534427..00000000 --- a/recipe/patches/0020-add-absl_prefetch-target.patch +++ /dev/null @@ -1,28 +0,0 @@ -From efac5df326a3bbeb1c6d531186495720c95f93d7 Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Sun, 12 May 2024 22:29:25 +1100 -Subject: [PATCH 20/44] add absl_prefetch target - ---- - third_party/absl/system.absl.base.BUILD | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/third_party/absl/system.absl.base.BUILD b/third_party/absl/system.absl.base.BUILD -index a423d5f70da..b31592d31a3 100644 ---- a/third_party/absl/system.absl.base.BUILD -+++ b/third_party/absl/system.absl.base.BUILD -@@ -116,6 +116,14 @@ cc_library( - ], - ) - -+cc_library( -+ name = "prefetch", -+ deps = [ -+ ":config", -+ ":core_headers", -+ ], -+) -+ - cc_library( - name = "strerror", - linkopts = ["-labsl_strerror"], diff --git a/recipe/patches/0026-Only-link-to-sparse_core_layout_proto_cc-headers.patch b/recipe/patches/0021-Only-link-to-sparse_core_layout_proto_cc-headers.patch similarity index 78% rename from recipe/patches/0026-Only-link-to-sparse_core_layout_proto_cc-headers.patch rename to recipe/patches/0021-Only-link-to-sparse_core_layout_proto_cc-headers.patch index f757d17c..b436e973 100644 --- a/recipe/patches/0026-Only-link-to-sparse_core_layout_proto_cc-headers.patch +++ b/recipe/patches/0021-Only-link-to-sparse_core_layout_proto_cc-headers.patch @@ -1,17 +1,17 @@ -From 24d7281db5cba2c5d1221bf8aff532679fa14b52 Mon Sep 17 00:00:00 2001 +From 412a80c0e94daa47d9206aef26b1d13af9dc84ef Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 16 Jul 2024 17:18:23 +0200 -Subject: [PATCH 26/44] Only link to sparse_core_layout_proto_cc headers +Subject: [PATCH 21/31] Only link to sparse_core_layout_proto_cc headers --- tensorflow/core/tpu/kernels/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/core/tpu/kernels/BUILD b/tensorflow/core/tpu/kernels/BUILD -index e65eea35bd0..5f10b019634 100644 +index 94bf252e09e..352329dde93 100644 --- a/tensorflow/core/tpu/kernels/BUILD +++ b/tensorflow/core/tpu/kernels/BUILD -@@ -1486,7 +1486,7 @@ cc_library( +@@ -1533,7 +1533,7 @@ cc_library( hdrs = ["sparse_core_layout.h"], visibility = ["//tensorflow/python/tpu:__pkg__"], # ONLY for `_pywrap_sparse_core_layout`. deps = [ diff --git a/recipe/patches/0022-remove-dependencies-to-libcuda.patch b/recipe/patches/0022-remove-dependencies-to-libcuda.patch new file mode 100644 index 00000000..a936c3fd --- /dev/null +++ b/recipe/patches/0022-remove-dependencies-to-libcuda.patch @@ -0,0 +1,22 @@ +From 60e5a942e327942a307324c633a00f323fdb5d8d Mon Sep 17 00:00:00 2001 +From: Jinzhe Zeng +Date: Fri, 7 Feb 2025 03:41:29 -0500 +Subject: [PATCH 22/31] remove dependencies to libcuda + +--- + .../xla/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/xla/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl b/third_party/xla/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl +index ba86fe70611..22680698869 100644 +--- a/third_party/xla/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl ++++ b/third_party/xla/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl +@@ -28,7 +28,7 @@ cc_import( + %{multiline_comment} + cc_library( + name = "cuda_driver", +- %{comment}deps = [":cuda_stub"], ++ #%{comment}deps = [":cuda_stub"], + visibility = ["//visibility:public"], + ) + diff --git a/recipe/patches/0030-Fixup-pybind11_protobuf.patch b/recipe/patches/0023-Fixup-pybind11_protobuf.patch similarity index 54% rename from recipe/patches/0030-Fixup-pybind11_protobuf.patch rename to recipe/patches/0023-Fixup-pybind11_protobuf.patch index d3bec97c..276b67e6 100644 --- a/recipe/patches/0030-Fixup-pybind11_protobuf.patch +++ b/recipe/patches/0023-Fixup-pybind11_protobuf.patch @@ -1,35 +1,30 @@ -From 5999590f2bb6bf895012f8777adcd289576beb8b Mon Sep 17 00:00:00 2001 +From 063e28adcd3dcd92ddc24d3d718a929e283e1b5b Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 6 Jul 2025 16:45:03 -0400 -Subject: [PATCH 30/44] Fixup pybind11_protobuf +Subject: [PATCH 23/31] Fixup pybind11_protobuf --- - tensorflow/workspace2.bzl | 8 +++++--- + tensorflow/workspace2.bzl | 5 +++++ third_party/pybind11_protobuf/remove_license.patch | 10 +++++----- - third_party/xla/workspace2.bzl | 11 ++++++++--- - 3 files changed, 18 insertions(+), 11 deletions(-) + third_party/xla/workspace2.bzl | 5 +++++ + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl -index eaab025f55f..f402d5eb2a4 100644 +index 1f0ff1b11fd..52204d79ed6 100644 --- a/tensorflow/workspace2.bzl +++ b/tensorflow/workspace2.bzl -@@ -788,11 +788,13 @@ def _tf_repositories(): - - tf_http_archive( - name = "pybind11_protobuf", -- urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/80f3440cd8fee124e077e2e47a8a17b78b451363.zip"), -- sha256 = "c7ab64b1ccf9a678694a89035a8c865a693e4e872803778f91f0965c2f281d78", -- strip_prefix = "pybind11_protobuf-80f3440cd8fee124e077e2e47a8a17b78b451363", -+ urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/f02a2b7653bc50eb5119d125842a3870db95d251.zip"), -+ sha256 = "3cf7bf0f23954c5ce6c37f0a215f506efa3035ca06e3b390d67f4cbe684dce23", -+ strip_prefix = "pybind11_protobuf-f02a2b7653bc50eb5119d125842a3870db95d251", - patch_file = [ - "//third_party/pybind11_protobuf:remove_license.patch", +@@ -793,6 +793,11 @@ def _tf_repositories(): + urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/f02a2b7653bc50eb5119d125842a3870db95d251.zip"), + sha256 = "3cf7bf0f23954c5ce6c37f0a215f506efa3035ca06e3b390d67f4cbe684dce23", + strip_prefix = "pybind11_protobuf-f02a2b7653bc50eb5119d125842a3870db95d251", ++ patch_file = [ ++ "//third_party/pybind11_protobuf:remove_license.patch", + "//third_party/pybind11_protobuf:0001-DO-not-link-to-proto_api.patch", + "//third_party/pybind11_protobuf:0002-Add-Python-include-path.patch", - ], ++ ], ) + tf_http_archive( diff --git a/third_party/pybind11_protobuf/remove_license.patch b/third_party/pybind11_protobuf/remove_license.patch index 2e41474ee4a..7180fa8167e 100644 --- a/third_party/pybind11_protobuf/remove_license.patch @@ -55,19 +50,13 @@ index 2e41474ee4a..7180fa8167e 100644 \ No newline at end of file + hdrs = ["enum_type_caster.h"], diff --git a/third_party/xla/workspace2.bzl b/third_party/xla/workspace2.bzl -index a1e98c628e7..2adf2bcd80b 100644 +index 9e4166034d0..47646f463bf 100644 --- a/third_party/xla/workspace2.bzl +++ b/third_party/xla/workspace2.bzl -@@ -153,9 +153,14 @@ def _tf_repositories(): - - tf_http_archive( - name = "pybind11_protobuf", -- urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/80f3440cd8fee124e077e2e47a8a17b78b451363.zip"), -- sha256 = "c7ab64b1ccf9a678694a89035a8c865a693e4e872803778f91f0965c2f281d78", -- strip_prefix = "pybind11_protobuf-80f3440cd8fee124e077e2e47a8a17b78b451363", -+ urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/f02a2b7653bc50eb5119d125842a3870db95d251.zip"), -+ sha256 = "3cf7bf0f23954c5ce6c37f0a215f506efa3035ca06e3b390d67f4cbe684dce23", -+ strip_prefix = "pybind11_protobuf-f02a2b7653bc50eb5119d125842a3870db95d251", +@@ -512,6 +512,11 @@ def _tf_repositories(): + urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/f02a2b7653bc50eb5119d125842a3870db95d251.zip"), + sha256 = "3cf7bf0f23954c5ce6c37f0a215f506efa3035ca06e3b390d67f4cbe684dce23", + strip_prefix = "pybind11_protobuf-f02a2b7653bc50eb5119d125842a3870db95d251", + patch_file = [ + "//third_party/pybind11_protobuf:remove_license.patch", + "//third_party/pybind11_protobuf:0001-DO-not-link-to-proto_api.patch", @@ -75,4 +64,4 @@ index a1e98c628e7..2adf2bcd80b 100644 + ], ) - # buildifier: disable=function-docstring + java_import_external( diff --git a/recipe/patches/0024-Update-linkages-for-new-absl-organization.patch b/recipe/patches/0024-Update-linkages-for-new-absl-organization.patch new file mode 100644 index 00000000..13a4142a --- /dev/null +++ b/recipe/patches/0024-Update-linkages-for-new-absl-organization.patch @@ -0,0 +1,42 @@ +From 741c6e27aa5039a15f74dd94cc63f5077e71a9b7 Mon Sep 17 00:00:00 2001 +From: Mark Harfouche +Date: Sun, 6 Jul 2025 17:32:42 -0400 +Subject: [PATCH 24/31] Update linkages for new absl organization + +--- + third_party/xla/third_party/absl/system.absl.random.BUILD | 1 - + third_party/xla/third_party/absl/system.absl.types.BUILD | 2 -- + 2 files changed, 3 deletions(-) + +diff --git a/third_party/xla/third_party/absl/system.absl.random.BUILD b/third_party/xla/third_party/absl/system.absl.random.BUILD +index ac17ce6343b..71aaa9a1cd5 100644 +--- a/third_party/xla/third_party/absl/system.absl.random.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.random.BUILD +@@ -30,7 +30,6 @@ cc_library( + name = "seed_sequences", + linkopts = [ + "-labsl_random_internal_platform", +- "-labsl_random_internal_pool_urbg", + "-labsl_random_internal_randen", + "-labsl_random_internal_randen_hwaes", + "-labsl_random_internal_randen_hwaes_impl", +diff --git a/third_party/xla/third_party/absl/system.absl.types.BUILD b/third_party/xla/third_party/absl/system.absl.types.BUILD +index db94fc99185..623c0e96126 100644 +--- a/third_party/xla/third_party/absl/system.absl.types.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.types.BUILD +@@ -30,7 +30,6 @@ cc_library( + + cc_library( + name = "bad_optional_access", +- linkopts = ["-labsl_bad_optional_access"], + deps = [ + "//absl/base:raw_logging_internal", + ], +@@ -38,7 +37,6 @@ cc_library( + + cc_library( + name = "bad_variant_access", +- linkopts = ["-labsl_bad_variant_access"], + deps = [ + "//absl/base:raw_logging_internal", + ], diff --git a/recipe/patches/0037-add-absl_tracing_internal.patch b/recipe/patches/0025-add-absl_tracing_internal.patch similarity index 55% rename from recipe/patches/0037-add-absl_tracing_internal.patch rename to recipe/patches/0025-add-absl_tracing_internal.patch index b842a5b3..60cbb58f 100644 --- a/recipe/patches/0037-add-absl_tracing_internal.patch +++ b/recipe/patches/0025-add-absl_tracing_internal.patch @@ -1,29 +1,29 @@ -From 1eecc2a532902a85a363f00f9e8126b144c63885 Mon Sep 17 00:00:00 2001 +From 28fd79ec32c1a9f95135088616db947b18cb313e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 6 Aug 2025 15:36:13 +0000 -Subject: [PATCH 37/44] add absl_tracing_internal +Subject: [PATCH 25/31] add absl_tracing_internal --- - tensorflow/core/kernels/batching_util/BUILD | 1 + - third_party/absl/system.absl.base.BUILD | 7 +++++++ + tensorflow/core/kernels/batching_util/BUILD | 1 + + third_party/xla/third_party/absl/system.absl.base.BUILD | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/tensorflow/core/kernels/batching_util/BUILD b/tensorflow/core/kernels/batching_util/BUILD -index f953c4de7e7..2b5853055b3 100644 +index 9a66862779e..098005f6704 100644 --- a/tensorflow/core/kernels/batching_util/BUILD +++ b/tensorflow/core/kernels/batching_util/BUILD -@@ -466,6 +466,7 @@ cc_library( +@@ -465,6 +465,7 @@ cc_library( "@com_google_absl//absl/synchronization", "@com_google_absl//absl/time", "@com_google_absl//absl/types:optional", + "@com_google_absl//absl/base:tracing_internal", - "@local_tsl//tsl/platform:criticality", + "@local_xla//xla/tsl/platform:criticality", ], ) -diff --git a/third_party/absl/system.absl.base.BUILD b/third_party/absl/system.absl.base.BUILD +diff --git a/third_party/xla/third_party/absl/system.absl.base.BUILD b/third_party/xla/third_party/absl/system.absl.base.BUILD index b31592d31a3..6534793637c 100644 ---- a/third_party/absl/system.absl.base.BUILD -+++ b/third_party/absl/system.absl.base.BUILD +--- a/third_party/xla/third_party/absl/system.absl.base.BUILD ++++ b/third_party/xla/third_party/absl/system.absl.base.BUILD @@ -25,6 +25,13 @@ cc_library( ], ) diff --git a/recipe/patches/0038-Fix-building-different-python-wheels-from-one-python.patch b/recipe/patches/0026-Fix-building-different-python-wheels-from-one-python.patch similarity index 89% rename from recipe/patches/0038-Fix-building-different-python-wheels-from-one-python.patch rename to recipe/patches/0026-Fix-building-different-python-wheels-from-one-python.patch index dc33d946..6c31b442 100644 --- a/recipe/patches/0038-Fix-building-different-python-wheels-from-one-python.patch +++ b/recipe/patches/0026-Fix-building-different-python-wheels-from-one-python.patch @@ -1,7 +1,7 @@ -From 1b093af46c2e1e0aa73b4e217ec96023bd8d778e Mon Sep 17 00:00:00 2001 +From 0066f3ac3fa177d0d278d353cde35fd505ee6d8e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 6 Aug 2025 17:50:08 +0000 -Subject: [PATCH 38/44] Fix building different python wheels from one python +Subject: [PATCH 26/31] Fix building different python wheels from one python --- tensorflow/tools/pip_package/build_pip_package.py | 11 ++++++++++- @@ -58,14 +58,14 @@ index e254358d435..0f8426a411a 100644 finally: temp_dir.cleanup() diff --git a/tensorflow/tools/pip_package/utils/tf_wheel.bzl b/tensorflow/tools/pip_package/utils/tf_wheel.bzl -index 057779e946e..dd34695b5dd 100644 +index fa66b202821..155e36075bc 100644 --- a/tensorflow/tools/pip_package/utils/tf_wheel.bzl +++ b/tensorflow/tools/pip_package/utils/tf_wheel.bzl -@@ -91,6 +91,7 @@ def _tf_wheel_impl(ctx): +@@ -109,6 +109,7 @@ def _tf_wheel_impl(ctx): ctx.attr.platform_name, ctx.attr.platform_tag, )) + args.add("--full-wheel-name", full_wheel_name) args.add("--collab", str(WHEEL_COLLAB)) args.add("--output-name", wheel_dir) - args.add("--version", VERSION) + args.add("--version", TF_VERSION) diff --git a/recipe/patches/0039-Fix-matmul-unused-result-error.patch b/recipe/patches/0027-Fix-matmul-unused-result-error.patch similarity index 77% rename from recipe/patches/0039-Fix-matmul-unused-result-error.patch rename to recipe/patches/0027-Fix-matmul-unused-result-error.patch index 190cdf66..5259f55b 100644 --- a/recipe/patches/0039-Fix-matmul-unused-result-error.patch +++ b/recipe/patches/0027-Fix-matmul-unused-result-error.patch @@ -1,17 +1,17 @@ -From f27636f9d6ef3a4d623ece0236edaa2ac9db286e Mon Sep 17 00:00:00 2001 +From d94283a86058f58325e1f2dcb3442c57d25442dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Wed, 6 Aug 2025 18:16:06 +0000 -Subject: [PATCH 39/44] Fix matmul unused result error +Subject: [PATCH 27/31] Fix matmul unused result error --- .../toco/graph_transformations/resolve_tensorflow_matmul.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc b/tensorflow/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc -index ccca3f7a2e0..e961891dda4 100644 +index ceacf0378ff..892462551d2 100644 --- a/tensorflow/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc +++ b/tensorflow/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc -@@ -174,7 +174,7 @@ TransposeOperator* FindTransposeOpWithInput(const Model& model, +@@ -173,7 +173,7 @@ absl::Status ResolveTensorFlowMatMul::Run(Model* model, std::size_t op_index, fc_op->outputs = matmul_op->outputs; // Insert the newly constructed FullyConnectedOperator. diff --git a/recipe/patches/0027-Protobuf-5-compatability.patch b/recipe/patches/0027-Protobuf-5-compatability.patch deleted file mode 100644 index 1d21a7a2..00000000 --- a/recipe/patches/0027-Protobuf-5-compatability.patch +++ /dev/null @@ -1,326 +0,0 @@ -From 42c45204278fc1f3021bfff528664743a7bd81ac Mon Sep 17 00:00:00 2001 -From: "Uwe L. Korn" -Date: Thu, 10 Oct 2024 19:59:31 +0200 -Subject: [PATCH 27/44] Protobuf 5 compatability - ---- - .../mlir/lite/python/jax_to_tfl_flatbuffer.cc | 2 +- - .../mlir/tensorflow/utils/parse_text_proto.cc | 2 +- - tensorflow/core/debug/debug_io_utils.cc | 4 ++ - .../core/ir/importexport/parse_text_proto.cc | 2 +- - .../profiler/convert/hlo_to_tools_data.cc | 4 ++ - .../convert/xplane_to_memory_profile.cc | 4 ++ - .../profiler/convert/xplane_to_tools_data.cc | 8 +++ - tensorflow/core/util/proto/proto_utils.cc | 10 ++-- - tensorflow/core/util/proto/proto_utils.h | 4 +- - .../proto_text/gen_proto_text_functions.cc | 4 +- - tensorflow/workspace2.bzl | 4 ++ - ...Migrate-from-AddError-to-RecordError.patch | 33 ++++++++++++ - ...y-with-protobuf-v26-migrate-from-dep.patch | 52 +++++++++++++++++++ - .../platform/default/human_readable_json.cc | 4 ++ - 14 files changed, 125 insertions(+), 12 deletions(-) - create mode 100644 third_party/0001-Migrate-from-AddError-to-RecordError.patch - create mode 100644 third_party/0002-Fix-compatibility-with-protobuf-v26-migrate-from-dep.patch - -diff --git a/tensorflow/compiler/mlir/lite/python/jax_to_tfl_flatbuffer.cc b/tensorflow/compiler/mlir/lite/python/jax_to_tfl_flatbuffer.cc -index d4a2d02db6a..1448305ca2b 100644 ---- a/tensorflow/compiler/mlir/lite/python/jax_to_tfl_flatbuffer.cc -+++ b/tensorflow/compiler/mlir/lite/python/jax_to_tfl_flatbuffer.cc -@@ -57,7 +57,7 @@ namespace { - // Error collector that simply ignores errors reported. - class NoOpErrorCollector : public tsl::protobuf::io::ErrorCollector { - public: -- void AddError(int line, int column, const std::string& message) override {} -+ void RecordError(int line, int column, const absl::string_view message) override {} - }; - - absl::StatusOr LoadHloProto(const std::string& contents) { -diff --git a/tensorflow/compiler/mlir/tensorflow/utils/parse_text_proto.cc b/tensorflow/compiler/mlir/tensorflow/utils/parse_text_proto.cc -index aa2d9406e91..1d41972266f 100644 ---- a/tensorflow/compiler/mlir/tensorflow/utils/parse_text_proto.cc -+++ b/tensorflow/compiler/mlir/tensorflow/utils/parse_text_proto.cc -@@ -30,7 +30,7 @@ namespace { - // Error collector that simply ignores errors reported. - class NoOpErrorCollector : public protobuf::io::ErrorCollector { - public: -- void AddError(int line, int column, const std::string& message) override {} -+ void RecordError(int line, int column, absl::string_view message) override {} - }; - } // namespace - -diff --git a/tensorflow/core/debug/debug_io_utils.cc b/tensorflow/core/debug/debug_io_utils.cc -index 04317455a94..700b5b2b645 100644 ---- a/tensorflow/core/debug/debug_io_utils.cc -+++ b/tensorflow/core/debug/debug_io_utils.cc -@@ -94,7 +94,11 @@ Event PrepareChunkEventProto(const DebugNodeKey& debug_node_key, - // Encode the data in JSON. - string json_output; - tensorflow::protobuf::util::JsonPrintOptions json_options; -+#if GOOGLE_PROTOBUF_VERSION < 5026000 - json_options.always_print_primitive_fields = true; -+#else -+ json_options.always_print_fields_with_no_presence = true; -+#endif - auto status = tensorflow::protobuf::util::MessageToJsonString( - metadata, &json_output, json_options); - if (status.ok()) { -diff --git a/tensorflow/core/ir/importexport/parse_text_proto.cc b/tensorflow/core/ir/importexport/parse_text_proto.cc -index c631785cefc..3ab6e17c3aa 100644 ---- a/tensorflow/core/ir/importexport/parse_text_proto.cc -+++ b/tensorflow/core/ir/importexport/parse_text_proto.cc -@@ -35,7 +35,7 @@ namespace { - // Error collector that simply ignores errors reported. - class NoOpErrorCollector : public tensorflow::protobuf::io::ErrorCollector { - public: -- void AddError(int line, int column, const std::string& message) override {} -+ void RecordError(int line, int column, const absl::string_view message) override {} - }; - } // namespace - -diff --git a/tensorflow/core/profiler/convert/hlo_to_tools_data.cc b/tensorflow/core/profiler/convert/hlo_to_tools_data.cc -index 7fbcd397906..d17f3402a3f 100644 ---- a/tensorflow/core/profiler/convert/hlo_to_tools_data.cc -+++ b/tensorflow/core/profiler/convert/hlo_to_tools_data.cc -@@ -62,7 +62,11 @@ absl::StatusOr ConvertHloProtoToMemoryViewer( - - std::string json_output; - tensorflow::protobuf::util::JsonPrintOptions options; -+#if GOOGLE_PROTOBUF_VERSION < 5026000 - options.always_print_primitive_fields = true; -+#else -+ options.always_print_fields_with_no_presence = true; -+#endif - auto encoded_status = tensorflow::protobuf::util::MessageToJsonString( - result_or.value(), &json_output, options); - if (!encoded_status.ok()) { -diff --git a/tensorflow/core/profiler/convert/xplane_to_memory_profile.cc b/tensorflow/core/profiler/convert/xplane_to_memory_profile.cc -index 612a40bc3f7..7f82387011a 100644 ---- a/tensorflow/core/profiler/convert/xplane_to_memory_profile.cc -+++ b/tensorflow/core/profiler/convert/xplane_to_memory_profile.cc -@@ -530,7 +530,11 @@ template - absl::Status ConvertProtoToJson(const Proto& proto_output, - std::string* json_output) { - protobuf::util::JsonPrintOptions json_options; -+#if GOOGLE_PROTOBUF_VERSION < 5026000 - json_options.always_print_primitive_fields = true; -+#else -+ json_options.always_print_fields_with_no_presence = true; -+#endif - auto status = protobuf::util::MessageToJsonString(proto_output, json_output, - json_options); - if (!status.ok()) { -diff --git a/tensorflow/core/profiler/convert/xplane_to_tools_data.cc b/tensorflow/core/profiler/convert/xplane_to_tools_data.cc -index 01168576114..09b284e34f5 100644 ---- a/tensorflow/core/profiler/convert/xplane_to_tools_data.cc -+++ b/tensorflow/core/profiler/convert/xplane_to_tools_data.cc -@@ -230,7 +230,11 @@ absl::StatusOr ConvertMultiXSpacesToPodViewer( - - std::string json_output; - protobuf::util::JsonPrintOptions opts; -+#if GOOGLE_PROTOBUF_VERSION < 5026000 - opts.always_print_primitive_fields = true; -+#else -+ opts.always_print_fields_with_no_presence = true; -+#endif - auto encode_status = protobuf::util::MessageToJsonString( - ConvertOpStatsToPodViewer(combined_op_stats), &json_output, opts); - if (!encode_status.ok()) { -@@ -310,7 +314,11 @@ absl::StatusOr ConvertMultiXSpacesToOpProfileViewer( - profile); - std::string json_output; - protobuf::util::JsonPrintOptions opts; -+#if GOOGLE_PROTOBUF_VERSION < 5026000 - opts.always_print_primitive_fields = true; -+#else -+ opts.always_print_fields_with_no_presence = true; -+#endif - - auto encode_status = - protobuf::util::MessageToJsonString(profile, &json_output, opts); -diff --git a/tensorflow/core/util/proto/proto_utils.cc b/tensorflow/core/util/proto/proto_utils.cc -index be13bdd8767..23d1e14ba5a 100644 ---- a/tensorflow/core/util/proto/proto_utils.cc -+++ b/tensorflow/core/util/proto/proto_utils.cc -@@ -101,17 +101,17 @@ StringErrorCollector::StringErrorCollector(string* error_text, - } - } - --void StringErrorCollector::AddError(int line, int column, -- const string& message) { -+void StringErrorCollector::RecordError(int line, int column, -+ absl::string_view message) { - if (error_text_ != nullptr) { - absl::SubstituteAndAppend(error_text_, "$0($1): $2\n", line + index_offset_, - column + index_offset_, message); - } - } - --void StringErrorCollector::AddWarning(int line, int column, -- const string& message) { -- AddError(line, column, message); -+void StringErrorCollector::RecordWarning(int line, int column, -+ absl::string_view message) { -+ RecordError(line, column, message); - } - - } // namespace proto_utils -diff --git a/tensorflow/core/util/proto/proto_utils.h b/tensorflow/core/util/proto/proto_utils.h -index 01b8ad0d747..58c4a301ee9 100644 ---- a/tensorflow/core/util/proto/proto_utils.h -+++ b/tensorflow/core/util/proto/proto_utils.h -@@ -53,10 +53,10 @@ class StringErrorCollector : public protobuf::io::ErrorCollector { - StringErrorCollector& operator=(const StringErrorCollector&) = delete; - - // Implementation of protobuf::io::ErrorCollector::AddError. -- void AddError(int line, int column, const string& message) override; -+ void RecordError(int line, int column, absl::string_view message) override; - - // Implementation of protobuf::io::ErrorCollector::AddWarning. -- void AddWarning(int line, int column, const string& message) override; -+ void RecordWarning(int line, int column, absl::string_view message) override; - - private: - string* const error_text_; -diff --git a/tensorflow/tools/proto_text/gen_proto_text_functions.cc b/tensorflow/tools/proto_text/gen_proto_text_functions.cc -index 9fab9130d94..557b17f3d0c 100644 ---- a/tensorflow/tools/proto_text/gen_proto_text_functions.cc -+++ b/tensorflow/tools/proto_text/gen_proto_text_functions.cc -@@ -31,8 +31,8 @@ class CrashOnErrorCollector - public: - ~CrashOnErrorCollector() override {} - -- void AddError(const string& filename, int line, int column, -- const string& message) override { -+ void RecordError(absl::string_view filename, int line, int column, -+ absl::string_view message) override { - LOG(FATAL) << "Unexpected error at " << filename << "@" << line << ":" - << column << " - " << message; - } -diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl -index fe87aac9a8c..eaab025f55f 100644 ---- a/tensorflow/workspace2.bzl -+++ b/tensorflow/workspace2.bzl -@@ -873,6 +873,10 @@ def _tf_repositories(): - name = "riegeli", - sha256 = "1d216d5c97fa60632143d209a1bb48c2a83788efdb876902e7bbc06396d5ee1f", - strip_prefix = "riegeli-5d75119232cd4f6db8dfa69a1503289f050e9643", -+ patch_file = [ -+ "//third_party:0001-Migrate-from-AddError-to-RecordError.patch", -+ "//third_party:0002-Fix-compatibility-with-protobuf-v26-migrate-from-dep.patch", -+ ], - urls = tf_mirror_urls("https://github.com/google/riegeli/archive/5d75119232cd4f6db8dfa69a1503289f050e9643.zip"), - ) - -diff --git a/third_party/0001-Migrate-from-AddError-to-RecordError.patch b/third_party/0001-Migrate-from-AddError-to-RecordError.patch -new file mode 100644 -index 00000000000..0ed75ee8019 ---- /dev/null -+++ b/third_party/0001-Migrate-from-AddError-to-RecordError.patch -@@ -0,0 +1,33 @@ -+From e75b32516c67dbcb0cd1a698d6700c3d7bd85a35 Mon Sep 17 00:00:00 2001 -+From: Compression Team -+Date: Fri, 31 May 2024 18:20:47 +0200 -+Subject: [PATCH 1/2] Migrate from AddError() to RecordError() -+ -+In Protobuf v22 RecordError() has been introduced and AddError() deprecated. -+In Protobuf v26 AddError() has been removed. -+ -+PiperOrigin-RevId: 639057502 -+--- -+ riegeli/records/record_reader.cc | 6 +++--- -+ 1 file changed, 3 insertions(+), 3 deletions(-) -+ -+diff --git a/riegeli/records/record_reader.cc b/riegeli/records/record_reader.cc -+index 499432ab..f4d90cea 100644 -+--- a/riegeli/records/record_reader.cc -++++ b/riegeli/records/record_reader.cc -+@@ -62,9 +62,9 @@ namespace riegeli { -+ class RecordsMetadataDescriptors::ErrorCollector -+ : public google::protobuf::DescriptorPool::ErrorCollector { -+ public: -+- void AddError(const std::string& filename, const std::string& element_name, -+- const google::protobuf::Message* descriptor, -+- ErrorLocation location, const std::string& message) override { -++ void RecordError(absl::string_view filename, absl::string_view element_name, -++ const google::protobuf::Message* descriptor, -++ ErrorLocation location, absl::string_view message) override { -+ descriptors_->Fail(absl::InvalidArgumentError( -+ absl::StrCat("Error in file ", filename, ", element ", element_name, -+ ": ", message))); -+-- -+2.34.1 -+ -diff --git a/third_party/0002-Fix-compatibility-with-protobuf-v26-migrate-from-dep.patch b/third_party/0002-Fix-compatibility-with-protobuf-v26-migrate-from-dep.patch -new file mode 100644 -index 00000000000..b5af8d2dff5 ---- /dev/null -+++ b/third_party/0002-Fix-compatibility-with-protobuf-v26-migrate-from-dep.patch -@@ -0,0 +1,52 @@ -+From 96dccef7210d7e182446b2db7424b16f44a66dd0 Mon Sep 17 00:00:00 2001 -+From: Marcin Kowalczyk -+Date: Tue, 4 Jun 2024 16:50:59 +0200 -+Subject: [PATCH 2/2] =?UTF-8?q?Fix=20compatibility=20with=20protobuf=20v26?= -+ =?UTF-8?q?+:=20migrate=20from=20deprecated=20`AddError()`=20to=20`RecordE?= -+ =?UTF-8?q?rror()`=20also=20in=20text=20parser=E2=80=99s=20`ErrorCollector?= -+ =?UTF-8?q?`.?= -+MIME-Version: 1.0 -+Content-Type: text/plain; charset=UTF-8 -+Content-Transfer-Encoding: 8bit -+ -+PiperOrigin-RevId: 640152285 -+--- -+ riegeli/messages/text_parse.cc | 6 +++--- -+ riegeli/messages/text_parse.h | 4 ++-- -+ 2 files changed, 5 insertions(+), 5 deletions(-) -+ -+diff --git a/riegeli/messages/text_parse.cc b/riegeli/messages/text_parse.cc -+index 94a28180..5089c728 100644 -+--- a/riegeli/messages/text_parse.cc -++++ b/riegeli/messages/text_parse.cc -+@@ -35,9 +35,9 @@ namespace riegeli { -+ -+ namespace messages_internal { -+ -+-void StringErrorCollector::AddError(int line, -+- google::protobuf::io::ColumnNumber column, -+- const std::string& message) { -++void StringErrorCollector::RecordError( -++ int line, google::protobuf::io::ColumnNumber column, -++ absl::string_view message) { -+ if (line >= 0) { -+ absl::StrAppend(&errors_, "\nAt ", line + 1, ":", column + 1, ": ", -+ message); -+diff --git a/riegeli/messages/text_parse.h b/riegeli/messages/text_parse.h -+index e6bb4db2..ee234ec8 100644 -+--- a/riegeli/messages/text_parse.h -++++ b/riegeli/messages/text_parse.h -+@@ -39,8 +39,8 @@ namespace messages_internal { -+ -+ class StringErrorCollector : public google::protobuf::io::ErrorCollector { -+ public: -+- void AddError(int line, google::protobuf::io::ColumnNumber column, -+- const std::string& message) override; -++ void RecordError(int line, google::protobuf::io::ColumnNumber column, -++ absl::string_view message) override; -+ -+ absl::string_view errors() const { return errors_; } -+ -+-- -+2.34.1 -+ -diff --git a/third_party/xla/xla/tsl/platform/default/human_readable_json.cc b/third_party/xla/xla/tsl/platform/default/human_readable_json.cc -index 5c3da22fddd..375ca1d701d 100644 ---- a/third_party/xla/xla/tsl/platform/default/human_readable_json.cc -+++ b/third_party/xla/xla/tsl/platform/default/human_readable_json.cc -@@ -33,7 +33,11 @@ absl::StatusOr ProtoToHumanReadableJson( - - protobuf::util::JsonPrintOptions json_options; - json_options.preserve_proto_field_names = true; -+#if GOOGLE_PROTOBUF_VERSION < 5026000 - json_options.always_print_primitive_fields = true; -+#else -+ json_options.always_print_fields_with_no_presence = true; -+#endif - auto status = - protobuf::util::MessageToJsonString(proto, &result, json_options); - if (!status.ok()) { diff --git a/recipe/patches/0028-Avoid-linking-with-internal-nvrtc.patch b/recipe/patches/0028-Avoid-linking-with-internal-nvrtc.patch deleted file mode 100644 index ce61a2ac..00000000 --- a/recipe/patches/0028-Avoid-linking-with-internal-nvrtc.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 034e5f1fe37e24c16ed60e6447bab1a3dd04f6f1 Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Sun, 2 Feb 2025 08:32:46 -0500 -Subject: [PATCH 28/44] Avoid linking with internal nvrtc - ---- - third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl | 5 ----- - .../tsl/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl | 5 ----- - 2 files changed, 10 deletions(-) - -diff --git a/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl b/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl -index fea4c5d7ce7..1f6f8fc3577 100644 ---- a/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl -+++ b/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl -@@ -10,16 +10,11 @@ cc_import( - shared_library = "lib/libnvrtc.so.%{libnvrtc_version}", - ) - --cc_import( -- name = "nvrtc_builtins", -- shared_library = "lib/libnvrtc-builtins.so.%{libnvrtc-builtins_version}", --) - %{multiline_comment} - cc_library( - name = "nvrtc", - %{comment}deps = [ - %{comment}":nvrtc_main", -- %{comment}":nvrtc_builtins", - %{comment}], - %{comment}linkopts = cuda_rpath_flags("nvidia/cuda_nvrtc/lib"), - visibility = ["//visibility:public"], -diff --git a/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl b/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl -index fea4c5d7ce7..1f6f8fc3577 100644 ---- a/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl -+++ b/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_nvrtc.BUILD.tpl -@@ -10,16 +10,11 @@ cc_import( - shared_library = "lib/libnvrtc.so.%{libnvrtc_version}", - ) - --cc_import( -- name = "nvrtc_builtins", -- shared_library = "lib/libnvrtc-builtins.so.%{libnvrtc-builtins_version}", --) - %{multiline_comment} - cc_library( - name = "nvrtc", - %{comment}deps = [ - %{comment}":nvrtc_main", -- %{comment}":nvrtc_builtins", - %{comment}], - %{comment}linkopts = cuda_rpath_flags("nvidia/cuda_nvrtc/lib"), - visibility = ["//visibility:public"], diff --git a/recipe/patches/0028-Support-cuda-12.8.patch b/recipe/patches/0028-Support-cuda-12.8.patch new file mode 100644 index 00000000..89d2a016 --- /dev/null +++ b/recipe/patches/0028-Support-cuda-12.8.patch @@ -0,0 +1,34 @@ +From fed0ddda91b1e368128ba32a7607495615c01e81 Mon Sep 17 00:00:00 2001 +From: oqs <2227-loqs@users.noreply.gitlab.archlinux.org> +Date: Wed, 6 Aug 2025 19:34:12 +0000 +Subject: [PATCH 28/31] Support cuda 12.8 + +Co-authored-by: Isuru Fernando +--- + tensorflow/core/kernels/gpu_prim.h | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/tensorflow/core/kernels/gpu_prim.h b/tensorflow/core/kernels/gpu_prim.h +index bcc873bfb03..5ad7570224d 100644 +--- a/tensorflow/core/kernels/gpu_prim.h ++++ b/tensorflow/core/kernels/gpu_prim.h +@@ -37,8 +37,7 @@ namespace gpuprim = ::cub; + + // Required for sorting Eigen::half and bfloat16. + namespace cub { +-template <> +-__device__ __forceinline__ void ThreadStoreVolatilePtr( ++__device__ __forceinline__ void ThreadStoreVolatilePtr( + Eigen::half *ptr, Eigen::half val, Int2Type /*is_primitive*/) { + *reinterpret_cast(ptr) = + Eigen::numext::bit_cast(val); +@@ -50,8 +49,7 @@ __device__ __forceinline__ Eigen::half ThreadLoadVolatilePointer( + return Eigen::numext::bit_cast(result); + } + +-template <> +-__device__ __forceinline__ void ThreadStoreVolatilePtr( ++__device__ __forceinline__ void ThreadStoreVolatilePtr( + Eigen::bfloat16 *ptr, Eigen::bfloat16 val, + Int2Type /*is_primitive*/) { + *reinterpret_cast(ptr) = diff --git a/recipe/patches/0041-Disable-profiler.patch b/recipe/patches/0029-Disable-profiler.patch similarity index 94% rename from recipe/patches/0041-Disable-profiler.patch rename to recipe/patches/0029-Disable-profiler.patch index aee405d1..d2c175fe 100644 --- a/recipe/patches/0041-Disable-profiler.patch +++ b/recipe/patches/0029-Disable-profiler.patch @@ -1,7 +1,7 @@ -From 2d39b35a19ede081ccc78120df16c845bcba622c Mon Sep 17 00:00:00 2001 +From 36b025e3011d8dd8abf52035c9bc9a1b8423abd6 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 13 Oct 2025 19:52:15 +0000 -Subject: [PATCH 41/44] Disable profiler +Subject: [PATCH 29/31] Disable profiler Enabling the profiler results in diff --git a/recipe/patches/0029-remove-dependencies-to-libcuda.patch b/recipe/patches/0029-remove-dependencies-to-libcuda.patch deleted file mode 100644 index 616e1b47..00000000 --- a/recipe/patches/0029-remove-dependencies-to-libcuda.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8c1ba879041b21f5ecc6b358e0cf27ec491e3b36 Mon Sep 17 00:00:00 2001 -From: Jinzhe Zeng -Date: Fri, 7 Feb 2025 03:41:29 -0500 -Subject: [PATCH 29/44] remove dependencies to libcuda - ---- - third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl | 2 +- - .../tsl/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl b/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl -index fabb310001c..8a079831b34 100644 ---- a/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl -+++ b/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl -@@ -28,7 +28,7 @@ cc_import( - %{multiline_comment} - cc_library( - name = "cuda_driver", -- %{comment}deps = [":cuda_stub"], -+ #%{comment}deps = [":cuda_stub"], - visibility = ["//visibility:public"], - ) - -diff --git a/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl b/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl -index fabb310001c..8a079831b34 100644 ---- a/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl -+++ b/third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_cudart.BUILD.tpl -@@ -28,7 +28,7 @@ cc_import( - %{multiline_comment} - cc_library( - name = "cuda_driver", -- %{comment}deps = [":cuda_stub"], -+ #%{comment}deps = [":cuda_stub"], - visibility = ["//visibility:public"], - ) - diff --git a/recipe/patches/0042-cross-arch-config.patch b/recipe/patches/0030-cross-arch-config.patch similarity index 62% rename from recipe/patches/0042-cross-arch-config.patch rename to recipe/patches/0030-cross-arch-config.patch index 3f3df753..f23c62b4 100644 --- a/recipe/patches/0042-cross-arch-config.patch +++ b/recipe/patches/0030-cross-arch-config.patch @@ -1,19 +1,19 @@ -From 977dfe9a0ff84b6d42307a5784ced2aa70bc93b6 Mon Sep 17 00:00:00 2001 +From 1d9032c0b03590e77694cade350fe21a4b160e8a Mon Sep 17 00:00:00 2001 From: dslarm Date: Tue, 14 Oct 2025 15:02:09 +0000 -Subject: [PATCH 42/44] cross arch config +Subject: [PATCH 30/31] cross arch config --- - third_party/llvm/dirty.patch | 11 +++++++++++ - third_party/llvm/workspace.bzl | 1 + + third_party/xla/third_party/llvm/dirty.patch | 11 +++++++++++ + third_party/xla/third_party/llvm/workspace.bzl | 1 + 2 files changed, 12 insertions(+) - create mode 100644 third_party/llvm/dirty.patch + create mode 100644 third_party/xla/third_party/llvm/dirty.patch -diff --git a/third_party/llvm/dirty.patch b/third_party/llvm/dirty.patch +diff --git a/third_party/xla/third_party/llvm/dirty.patch b/third_party/xla/third_party/llvm/dirty.patch new file mode 100644 index 00000000000..db99a4e597d --- /dev/null -+++ b/third_party/llvm/dirty.patch ++++ b/third_party/xla/third_party/llvm/dirty.patch @@ -0,0 +1,11 @@ +--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl 2025-04-17 16:11:50.417140143 +0000 ++++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl 2025-04-17 16:11:54.891132310 +0000 @@ -26,12 +26,12 @@ index 00000000000..db99a4e597d + }) + [ + "LLVM_VERSION_MAJOR={}".format(LLVM_VERSION_MAJOR), + "LLVM_VERSION_MINOR={}".format(LLVM_VERSION_MINOR), -diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl -index dc3ceaddaea..924293650ca 100644 ---- a/third_party/llvm/workspace.bzl -+++ b/third_party/llvm/workspace.bzl -@@ -22,6 +22,7 @@ def repo(name): - "//third_party/llvm:mathextras.patch", +diff --git a/third_party/xla/third_party/llvm/workspace.bzl b/third_party/xla/third_party/llvm/workspace.bzl +index 02047a0be6f..4e81a59507a 100644 +--- a/third_party/xla/third_party/llvm/workspace.bzl ++++ b/third_party/xla/third_party/llvm/workspace.bzl +@@ -23,6 +23,7 @@ def repo(name): + "//third_party/llvm:memcpy.patch", "//third_party/llvm:toolchains.patch", "//third_party/llvm:zstd.patch", + "//third_party/llvm:dirty.patch", diff --git a/recipe/patches/0045-Force-python-wheel-architecture-to-aarch64.patch b/recipe/patches/0031-Force-python-wheel-architecture-to-aarch64-When-cros.patch similarity index 83% rename from recipe/patches/0045-Force-python-wheel-architecture-to-aarch64.patch rename to recipe/patches/0031-Force-python-wheel-architecture-to-aarch64-When-cros.patch index e746a4cb..d40acd21 100644 --- a/recipe/patches/0045-Force-python-wheel-architecture-to-aarch64.patch +++ b/recipe/patches/0031-Force-python-wheel-architecture-to-aarch64-When-cros.patch @@ -1,7 +1,7 @@ -From 2647d10989b95d1f682cbe125f5e1023c74e2f9e Mon Sep 17 00:00:00 2001 +From 2cd4f7a5ac811609bab06bc30c2509755572e094 Mon Sep 17 00:00:00 2001 From: David Lecomber Date: Fri, 30 Jan 2026 13:38:07 +0000 -Subject: [PATCH] Force python wheel architecture to aarch64 When +Subject: [PATCH 31/31] Force python wheel architecture to aarch64 When cross-building, the wheel-creation phase creates for the host architecture instead of target as bazel has somehow confused the architecture; this patch is a workaround to this issue. @@ -11,10 +11,10 @@ Subject: [PATCH] Force python wheel architecture to aarch64 When 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tensorflow/tools/pip_package/BUILD b/tensorflow/tools/pip_package/BUILD -index 5aecef595ba..d3aa65c48ef 100644 +index aa61734c38d..b17f0e6f9fe 100644 --- a/tensorflow/tools/pip_package/BUILD +++ b/tensorflow/tools/pip_package/BUILD -@@ -288,12 +288,7 @@ tf_wheel( +@@ -302,12 +302,7 @@ tf_wheel( "@platforms//os:windows": "win", "@platforms//os:linux": "linux", }), diff --git a/recipe/patches/0031-Update-linkages-for-new-absl-organization.patch b/recipe/patches/0031-Update-linkages-for-new-absl-organization.patch deleted file mode 100644 index 373ca1f1..00000000 --- a/recipe/patches/0031-Update-linkages-for-new-absl-organization.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 33f3d835747dcb83b9d63d6ae11327d5f67c947c Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Sun, 6 Jul 2025 17:32:42 -0400 -Subject: [PATCH 31/44] Update linkages for new absl organization - ---- - third_party/absl/system.absl.random.BUILD | 1 - - third_party/absl/system.absl.types.BUILD | 2 -- - .../third_party/tsl/third_party/absl/system.absl.random.BUILD | 1 - - .../third_party/tsl/third_party/absl/system.absl.types.BUILD | 2 -- - 4 files changed, 6 deletions(-) - -diff --git a/third_party/absl/system.absl.random.BUILD b/third_party/absl/system.absl.random.BUILD -index ac17ce6343b..71aaa9a1cd5 100644 ---- a/third_party/absl/system.absl.random.BUILD -+++ b/third_party/absl/system.absl.random.BUILD -@@ -30,7 +30,6 @@ cc_library( - name = "seed_sequences", - linkopts = [ - "-labsl_random_internal_platform", -- "-labsl_random_internal_pool_urbg", - "-labsl_random_internal_randen", - "-labsl_random_internal_randen_hwaes", - "-labsl_random_internal_randen_hwaes_impl", -diff --git a/third_party/absl/system.absl.types.BUILD b/third_party/absl/system.absl.types.BUILD -index db94fc99185..623c0e96126 100644 ---- a/third_party/absl/system.absl.types.BUILD -+++ b/third_party/absl/system.absl.types.BUILD -@@ -30,7 +30,6 @@ cc_library( - - cc_library( - name = "bad_optional_access", -- linkopts = ["-labsl_bad_optional_access"], - deps = [ - "//absl/base:raw_logging_internal", - ], -@@ -38,7 +37,6 @@ cc_library( - - cc_library( - name = "bad_variant_access", -- linkopts = ["-labsl_bad_variant_access"], - deps = [ - "//absl/base:raw_logging_internal", - ], -diff --git a/third_party/xla/third_party/tsl/third_party/absl/system.absl.random.BUILD b/third_party/xla/third_party/tsl/third_party/absl/system.absl.random.BUILD -index ac17ce6343b..71aaa9a1cd5 100644 ---- a/third_party/xla/third_party/tsl/third_party/absl/system.absl.random.BUILD -+++ b/third_party/xla/third_party/tsl/third_party/absl/system.absl.random.BUILD -@@ -30,7 +30,6 @@ cc_library( - name = "seed_sequences", - linkopts = [ - "-labsl_random_internal_platform", -- "-labsl_random_internal_pool_urbg", - "-labsl_random_internal_randen", - "-labsl_random_internal_randen_hwaes", - "-labsl_random_internal_randen_hwaes_impl", -diff --git a/third_party/xla/third_party/tsl/third_party/absl/system.absl.types.BUILD b/third_party/xla/third_party/tsl/third_party/absl/system.absl.types.BUILD -index db94fc99185..623c0e96126 100644 ---- a/third_party/xla/third_party/tsl/third_party/absl/system.absl.types.BUILD -+++ b/third_party/xla/third_party/tsl/third_party/absl/system.absl.types.BUILD -@@ -30,7 +30,6 @@ cc_library( - - cc_library( - name = "bad_optional_access", -- linkopts = ["-labsl_bad_optional_access"], - deps = [ - "//absl/base:raw_logging_internal", - ], -@@ -38,7 +37,6 @@ cc_library( - - cc_library( - name = "bad_variant_access", -- linkopts = ["-labsl_bad_variant_access"], - deps = [ - "//absl/base:raw_logging_internal", - ], diff --git a/recipe/patches/0032-Remove-ambiguous-inherited-constructor-in-default_qu.patch b/recipe/patches/0032-Remove-ambiguous-inherited-constructor-in-default_qu.patch deleted file mode 100644 index 8d9d5294..00000000 --- a/recipe/patches/0032-Remove-ambiguous-inherited-constructor-in-default_qu.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 1d9ce9485bf23f4e5d801c34fe8eb594959e13b2 Mon Sep 17 00:00:00 2001 -From: "Patrick J. LoPresti" -Date: Thu, 3 Apr 2025 10:24:37 -0700 -Subject: [PATCH 32/44] Remove ambiguous inherited constructor in - default_quant_params.cc. GCC complains about this - (https://stackoverflow.com/q/79553477/). Fix is trivial and harmless. - -Fixes #84977. ---- - .../compiler/mlir/lite/transforms/default_quant_params.cc | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/tensorflow/compiler/mlir/lite/transforms/default_quant_params.cc b/tensorflow/compiler/mlir/lite/transforms/default_quant_params.cc -index f1b602a6763..7acbb7d1724 100644 ---- a/tensorflow/compiler/mlir/lite/transforms/default_quant_params.cc -+++ b/tensorflow/compiler/mlir/lite/transforms/default_quant_params.cc -@@ -54,7 +54,9 @@ namespace { - class DefaultQuantParamsPass - : public impl::DefaultQuantParamsPassBase { - public: -- using DefaultQuantParamsPassBase::DefaultQuantParamsPassBase; -+ DefaultQuantParamsPass() -+ { -+ } - - explicit DefaultQuantParamsPass(double default_min, double default_max, - bool is_signed) { diff --git a/recipe/patches/0032-Restore-system-link-files-for-absl.patch b/recipe/patches/0032-Restore-system-link-files-for-absl.patch new file mode 100644 index 00000000..934e1b4a --- /dev/null +++ b/recipe/patches/0032-Restore-system-link-files-for-absl.patch @@ -0,0 +1,53 @@ +From 252a1f04c7ffe6f7208d5b4aeebb663bd71b7eae Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Fri, 13 Feb 2026 21:31:43 +0000 +Subject: [PATCH 32/32] Restore system link files for absl + +--- + .../xla/third_party/absl/workspace.bzl | 29 +++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/third_party/xla/third_party/absl/workspace.bzl b/third_party/xla/third_party/absl/workspace.bzl +index 9144c5bd5b6..f3821f93e9b 100644 +--- a/third_party/xla/third_party/absl/workspace.bzl ++++ b/third_party/xla/third_party/absl/workspace.bzl +@@ -11,10 +11,39 @@ def repo(): + ABSL_SHA256 = "c397cd9cca3f71724a8ddf183e7fa71c19196eaafd1dc2a3c86d3a572613a807" + # LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake) + ++ SYS_DIRS = [ ++ "algorithm", ++ "base", ++ "cleanup", ++ "container", ++ "crc", ++ "debugging", ++ "flags", ++ "functional", ++ "hash", ++ "log", ++ "memory", ++ "meta", ++ "numeric", ++ "random", ++ "status", ++ "strings", ++ "synchronization", ++ "time", ++ "types", ++ "utility", ++ ] ++ SYS_LINKS = { ++ "//third_party/absl:system.absl.{name}.BUILD".format(name = n): "absl/{name}/BUILD.bazel".format(name = n) ++ for n in SYS_DIRS ++ } ++ + tf_http_archive( + name = "com_google_absl", + sha256 = ABSL_SHA256, + strip_prefix = "abseil-cpp-{commit}".format(commit = ABSL_COMMIT), ++ system_build_file = "//third_party/absl:system.BUILD", ++ system_link_files = SYS_LINKS, + urls = tf_mirror_urls("https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT)), + patch_file = [ + "//third_party/absl:btree.patch", diff --git a/recipe/patches/0033-third_party-ducc-fix-ambiguous-failure.patch b/recipe/patches/0033-third_party-ducc-fix-ambiguous-failure.patch deleted file mode 100644 index d85402b9..00000000 --- a/recipe/patches/0033-third_party-ducc-fix-ambiguous-failure.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 83db53827ca3914f035fe10f7666c84d7cad41dd Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Mon, 14 Jul 2025 15:35:54 +0800 -Subject: [PATCH 33/44] third_party/ducc: fix ambiguous failure - -... -bazel-out/k8-opt/bin/external/ducc/_virtual_includes/fft/ducc/src/ducc0/fft/fftnd_impl.h:1393:20: error: call of '(ducc0::detail_mav::vmav, 2>) (long unsigned int&, size_t&)' is ambiguous - 1393 | tmp(i,j) *= conj(roots[i*j]); - | ~~~^~~~~ -In file included from bazel-out/k8-opt/bin/external/ducc/_virtual_includes/fft/ducc/src/ducc0/fft/fft.h:65, - from external/ducc/google/fft.cc:26: -external/ducc/src/ducc0/infra/mav.h:803:41: note: there are 2 candidates - 803 | template class vmav: public cmav - | ^~~~ -external/ducc/src/ducc0/infra/mav.h:765:39: note: candidate 1: 'const T& ducc0::detail_mav::cmav::operator()(Ns ...) const [with Ns = {long unsigned int, long unsigned int}; T = std::complex; long unsigned int ndim = 2]' - 765 | template const T &operator()(Ns... ns) const - | ^~~~~~~~ -external/ducc/src/ducc0/infra/mav.h:856:33: note: candidate 2: 'T& ducc0::detail_mav::vmav::operator()(Ns ...) const [with Ns = {long unsigned int, long unsigned int}; T = std::complex; long unsigned int ndim = 2]' - 856 | template T &operator()(Ns... ns) const -... - -Upstream-Status: Pending - -Signed-off-by: Hongxu Jia ---- - .../ducc/0001-fix-ambiguous-failure.patch | 51 +++++++++++++++++++ - third_party/ducc/ducc.BUILD | 1 + - third_party/ducc/workspace.bzl | 3 ++ - 3 files changed, 55 insertions(+) - create mode 100644 third_party/ducc/0001-fix-ambiguous-failure.patch - -diff --git a/third_party/ducc/0001-fix-ambiguous-failure.patch b/third_party/ducc/0001-fix-ambiguous-failure.patch -new file mode 100644 -index 00000000000..2abb2848952 ---- /dev/null -+++ b/third_party/ducc/0001-fix-ambiguous-failure.patch -@@ -0,0 +1,51 @@ -+From e297a09e813aa001be02737bddd2a7a1555518a7 Mon Sep 17 00:00:00 2001 -+From: Hongxu Jia -+Date: Mon, 14 Jul 2025 15:21:20 +0800 -+Subject: [PATCH] fix ambiguous failure -+ -+... -+bazel-out/k8-opt/bin/external/ducc/_virtual_includes/fft/ducc/src/ducc0/fft/fftnd_impl.h:1393:20: error: call of '(ducc0::detail_mav::vmav, 2>) (long unsigned int&, size_t&)' is ambiguous -+ 1393 | tmp(i,j) *= conj(roots[i*j]); -+ | ~~~^~~~~ -+In file included from bazel-out/k8-opt/bin/external/ducc/_virtual_includes/fft/ducc/src/ducc0/fft/fft.h:65, -+ from external/ducc/google/fft.cc:26: -+external/ducc/src/ducc0/infra/mav.h:803:41: note: there are 2 candidates -+ 803 | template class vmav: public cmav -+ | ^~~~ -+external/ducc/src/ducc0/infra/mav.h:765:39: note: candidate 1: 'const T& ducc0::detail_mav::cmav::operator()(Ns ...) const [with Ns = {long unsigned int, long unsigned int}; T = std::complex; long unsigned int ndim = 2]' -+ 765 | template const T &operator()(Ns... ns) const -+ | ^~~~~~~~ -+external/ducc/src/ducc0/infra/mav.h:856:33: note: candidate 2: 'T& ducc0::detail_mav::vmav::operator()(Ns ...) const [with Ns = {long unsigned int, long unsigned int}; T = std::complex; long unsigned int ndim = 2]' -+ 856 | template T &operator()(Ns... ns) const -+... -+ -+Signed-off-by: Hongxu Jia -+--- -+ src/ducc0/infra/mav.h | 4 ++-- -+ 1 file changed, 2 insertions(+), 2 deletions(-) -+ -+diff --git a/src/ducc0/infra/mav.h b/src/ducc0/infra/mav.h -+index 73f0441..87a9bc9 100644 -+--- a/src/ducc0/infra/mav.h -++++ b/src/ducc0/infra/mav.h -+@@ -640,7 +640,7 @@ template class vfmav: public cfmav -+ -+ T *data() const -+ { return const_cast(tbuf::d); } -+- template T &raw(I i) const -++ template const T &raw(I i) const -+ { return data()[i]; } -+ -+ // no-op. Needed for template tricks. -+@@ -853,7 +853,7 @@ template class vmav: public cmav -+ vfmav to_fmav() const { return operator vfmav(); } -+ -+ using parent::operator(); -+- template T &operator()(Ns... ns) const -++ template const T &operator()(Ns... ns) const -+ { return const_cast(parent::operator()(ns...)); } -+ -+ template vmav subarray(const vector &slices) const -+-- -+2.34.1 -+ -diff --git a/third_party/ducc/ducc.BUILD b/third_party/ducc/ducc.BUILD -index a1c4956d0a7..c82f1247629 100644 ---- a/third_party/ducc/ducc.BUILD -+++ b/third_party/ducc/ducc.BUILD -@@ -9,6 +9,7 @@ DUCC_COPTS = [ - "-frtti", - "-fexceptions", - "-ffp-contract=fast", -+ "-fpermissive", - ] - - # This library exposes the raw DUCC fft API. It should be used -diff --git a/third_party/ducc/workspace.bzl b/third_party/ducc/workspace.bzl -index 99c8b14cd9f..0168c5e9886 100644 ---- a/third_party/ducc/workspace.bzl -+++ b/third_party/ducc/workspace.bzl -@@ -11,6 +11,9 @@ def repo(): - sha256 = DUCC_SHA256, - urls = tf_mirror_urls("https://gitlab.mpcdf.mpg.de/mtr/ducc/-/archive/{commit}/ducc-{commit}.tar.gz".format(commit = DUCC_COMMIT)), - build_file = "//third_party/ducc:ducc.BUILD", -+ patch_file = [ -+ "//third_party/ducc:0001-fix-ambiguous-failure.patch", -+ ], - link_files = { - "//third_party/ducc:ducc0_custom_lowlevel_threading.h": "google/ducc0_custom_lowlevel_threading.h", - "//third_party/ducc:fft.h": "google/fft.h", diff --git a/recipe/patches/0034-third_party-tf_runtime-fix-compile-failure.patch b/recipe/patches/0034-third_party-tf_runtime-fix-compile-failure.patch deleted file mode 100644 index 04d97e90..00000000 --- a/recipe/patches/0034-third_party-tf_runtime-fix-compile-failure.patch +++ /dev/null @@ -1,82 +0,0 @@ -From f095eb76d7f32020f7cbc184aa7993d3f5d46abe Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Mon, 14 Jul 2025 16:13:33 +0800 -Subject: [PATCH 34/44] third_party/tf_runtime: fix compile failure - -... -In file included from external/tf_runtime/include/tfrt/support/crc32c.h:26, - from external/tf_runtime/lib/support/crc32c.cc:19: -external/tf_runtime/include/tfrt/support/forward_decls.h:110:15: error: 'int64_t' does not name a type - 110 | using Index = int64_t; - | ^~~~~~~ -external/tf_runtime/include/tfrt/support/forward_decls.h:28:1: note: 'int64_t' is defined in header ''; this is probably fixable by adding '#include ' - 27 | #include "llvm/Support/ErrorHandling.h" - +++ |+#include -... - -Upstream-Status: Pending - -Signed-off-by: Hongxu Jia ---- - .../tf_runtime/0001-fix-compile-failure.patch | 36 +++++++++++++++++++ - third_party/tf_runtime/workspace.bzl | 6 ++-- - 2 files changed, 39 insertions(+), 3 deletions(-) - create mode 100644 third_party/tf_runtime/0001-fix-compile-failure.patch - -diff --git a/third_party/tf_runtime/0001-fix-compile-failure.patch b/third_party/tf_runtime/0001-fix-compile-failure.patch -new file mode 100644 -index 00000000000..c05ea5b41e7 ---- /dev/null -+++ b/third_party/tf_runtime/0001-fix-compile-failure.patch -@@ -0,0 +1,36 @@ -+From 7723f8c54b2b6f0db9c1420d4478de1f6dcf9459 Mon Sep 17 00:00:00 2001 -+From: Hongxu Jia -+Date: Mon, 14 Jul 2025 16:04:18 +0800 -+Subject: [PATCH] fix compile failure -+ -+... -+In file included from external/tf_runtime/include/tfrt/support/crc32c.h:26, -+ from external/tf_runtime/lib/support/crc32c.cc:19: -+external/tf_runtime/include/tfrt/support/forward_decls.h:110:15: error: 'int64_t' does not name a type -+ 110 | using Index = int64_t; -+ | ^~~~~~~ -+external/tf_runtime/include/tfrt/support/forward_decls.h:28:1: note: 'int64_t' is defined in header ''; this is probably fixable by adding '#include ' -+ 27 | #include "llvm/Support/ErrorHandling.h" -+ +++ |+#include -+... -+ -+Signed-off-by: Hongxu Jia -+--- -+ include/tfrt/support/forward_decls.h | 1 + -+ 1 file changed, 1 insertion(+) -+ -+diff --git a/include/tfrt/support/forward_decls.h b/include/tfrt/support/forward_decls.h -+index c3a4250..d8e28db 100644 -+--- a/include/tfrt/support/forward_decls.h -++++ b/include/tfrt/support/forward_decls.h -+@@ -25,6 +25,7 @@ -+ -+ #include "llvm/Support/Casting.h" -+ #include "llvm/Support/ErrorHandling.h" -++#include -+ -+ // We don't forward declare: -+ // DenseMap, SmallVector, StringMap, StringSet -+-- -+2.34.1 -+ -diff --git a/third_party/tf_runtime/workspace.bzl b/third_party/tf_runtime/workspace.bzl -index 69fc0f81f6f..460641dde06 100644 ---- a/third_party/tf_runtime/workspace.bzl -+++ b/third_party/tf_runtime/workspace.bzl -@@ -18,7 +18,7 @@ def repo(): - "@tsl": "@local_tsl", - "@xla": "@local_xla", - }, -- # A patch file can be provided for atomic commits to both TF and TFRT. -- # The job that bumps the TFRT_COMMIT also resets patch_file to 'None'. -- patch_file = None, -+ patch_file = [ -+ "//third_party/tf_runtime:0001-fix-compile-failure.patch", -+ ], - ) diff --git a/recipe/patches/0035-support-to-build-with-gcc-15.patch b/recipe/patches/0035-support-to-build-with-gcc-15.patch deleted file mode 100644 index 4f68d4c8..00000000 --- a/recipe/patches/0035-support-to-build-with-gcc-15.patch +++ /dev/null @@ -1,122 +0,0 @@ -From e71278601106b0f00fbd01f641055df87789e8b6 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Tue, 25 Mar 2025 22:38:37 -0700 -Subject: [PATCH 35/44] support to build with gcc 15 - -Upstream-Status: Pending - -Suggested-by: Martin Jansa -Signed-off-by: Hongxu Jia ---- - ...r-internal-Explicitly-include-cstdin.patch | 35 +++++++++++++++++++ - third_party/absl/workspace.bzl | 1 + - ...r-internal-Explicitly-include-cstdin.patch | 35 +++++++++++++++++++ - .../tsl/third_party/absl/workspace.bzl | 1 + - 4 files changed, 72 insertions(+) - create mode 100644 third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch - create mode 100644 third_party/xla/third_party/tsl/third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch - -diff --git a/third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch b/third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch -new file mode 100644 -index 00000000000..02f6385b5c6 ---- /dev/null -+++ b/third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch -@@ -0,0 +1,35 @@ -+From 809e5de7b92950849289236a5a09e9cb4f32c7b9 Mon Sep 17 00:00:00 2001 -+From: Christopher Fore -+Date: Mon, 5 Aug 2024 12:09:18 -0700 -+Subject: [PATCH] PR #1739: container/internal: Explicitly include -+ -+Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1739 -+ -+GCC 15 will no longer include by default, resulting in build failures in projects that do not explicitly include it. -+ -+Merge faf1b03a591f06933da02976119da5743f428e4f into 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 -+ -+Merging this change closes #1739 -+ -+COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1739 from csfore:gcc-15-fix faf1b03a591f06933da02976119da5743f428e4f -+PiperOrigin-RevId: 659637669 -+Change-Id: If14cb0e3522774cb700bd5a74abffb75feb7a0f5 -+--- -+ absl/container/internal/container_memory.h | 1 + -+ 1 file changed, 1 insertion(+) -+ -+diff --git a/absl/container/internal/container_memory.h b/absl/container/internal/container_memory.h -+index ba8e08a2..e7031797 100644 -+--- a/absl/container/internal/container_memory.h -++++ b/absl/container/internal/container_memory.h -+@@ -17,6 +17,7 @@ -+ -+ #include -+ #include -++#include -+ #include -+ #include -+ #include -+-- -+2.25.1 -+ -diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl -index 0bb3fbbf074..ae6259859a1 100644 ---- a/third_party/absl/workspace.bzl -+++ b/third_party/absl/workspace.bzl -@@ -48,5 +48,6 @@ def repo(): - urls = tf_mirror_urls("https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT)), - patch_file = [ - "//third_party/absl:nvidia_jetson.patch", -+ "//third_party/absl:0001-PR-1739-container-internal-Explicitly-include-cstdin.patch", - ], - ) -diff --git a/third_party/xla/third_party/tsl/third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch b/third_party/xla/third_party/tsl/third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch -new file mode 100644 -index 00000000000..02f6385b5c6 ---- /dev/null -+++ b/third_party/xla/third_party/tsl/third_party/absl/0001-PR-1739-container-internal-Explicitly-include-cstdin.patch -@@ -0,0 +1,35 @@ -+From 809e5de7b92950849289236a5a09e9cb4f32c7b9 Mon Sep 17 00:00:00 2001 -+From: Christopher Fore -+Date: Mon, 5 Aug 2024 12:09:18 -0700 -+Subject: [PATCH] PR #1739: container/internal: Explicitly include -+ -+Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1739 -+ -+GCC 15 will no longer include by default, resulting in build failures in projects that do not explicitly include it. -+ -+Merge faf1b03a591f06933da02976119da5743f428e4f into 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 -+ -+Merging this change closes #1739 -+ -+COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1739 from csfore:gcc-15-fix faf1b03a591f06933da02976119da5743f428e4f -+PiperOrigin-RevId: 659637669 -+Change-Id: If14cb0e3522774cb700bd5a74abffb75feb7a0f5 -+--- -+ absl/container/internal/container_memory.h | 1 + -+ 1 file changed, 1 insertion(+) -+ -+diff --git a/absl/container/internal/container_memory.h b/absl/container/internal/container_memory.h -+index ba8e08a2..e7031797 100644 -+--- a/absl/container/internal/container_memory.h -++++ b/absl/container/internal/container_memory.h -+@@ -17,6 +17,7 @@ -+ -+ #include -+ #include -++#include -+ #include -+ #include -+ #include -+-- -+2.25.1 -+ -diff --git a/third_party/xla/third_party/tsl/third_party/absl/workspace.bzl b/third_party/xla/third_party/tsl/third_party/absl/workspace.bzl -index d5973b13b39..c9004e92df8 100644 ---- a/third_party/xla/third_party/tsl/third_party/absl/workspace.bzl -+++ b/third_party/xla/third_party/tsl/third_party/absl/workspace.bzl -@@ -46,5 +46,6 @@ def repo(): - urls = tf_mirror_urls("https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT)), - patch_file = [ - "//third_party/absl:nvidia_jetson.patch", -+ "//third_party/absl:0001-PR-1739-container-internal-Explicitly-include-cstdin.patch", - ], - ) diff --git a/recipe/patches/0036-third_party-eigen_archive-workaround-ice-failure-whi.patch b/recipe/patches/0036-third_party-eigen_archive-workaround-ice-failure-whi.patch deleted file mode 100644 index 875b2d6e..00000000 --- a/recipe/patches/0036-third_party-eigen_archive-workaround-ice-failure-whi.patch +++ /dev/null @@ -1,107 +0,0 @@ -From e930fab1defd8fab209044028e530d7e533c1ef4 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Mon, 16 May 2022 23:15:47 -0700 -Subject: [PATCH 36/44] third_party/eigen_archive:workaround ice failure while - building from source with gcc 7.3.1 - -The root cause is gcc ice issue: -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89752 - -But we could not patch on native gcc,so try to workaround, -Refer: https://github.com/tensorflow/tensorflow/issues/25323 - -Upstream-Status: Inappropriate [wr-installer specific] - -Signed-off-by: Hongxu Jia ---- - ...ailure-while-building-from-source-wi.patch | 68 +++++++++++++++++++ - third_party/eigen3/workspace.bzl | 1 + - 2 files changed, 69 insertions(+) - create mode 100644 third_party/eigen3/0001-workaround-ice-failure-while-building-from-source-wi.patch - -diff --git a/third_party/eigen3/0001-workaround-ice-failure-while-building-from-source-wi.patch b/third_party/eigen3/0001-workaround-ice-failure-while-building-from-source-wi.patch -new file mode 100644 -index 00000000000..82ef62a0d9a ---- /dev/null -+++ b/third_party/eigen3/0001-workaround-ice-failure-while-building-from-source-wi.patch -@@ -0,0 +1,68 @@ -+From 649d0b938aab1b7081c3895aa1f527d034edb735 Mon Sep 17 00:00:00 2001 -+From: Hongxu Jia -+Date: Fri, 23 Aug 2024 10:49:54 +0800 -+Subject: [PATCH] workaround ice failure while building from source with gcc -+ 7.3.1 -+ -+The root cause is gcc ice issue: -+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89752 -+ -+But we could not patch on native gcc,so try to workaround, -+Refer: https://github.com/tensorflow/tensorflow/issues/25323 -+ -+Signed-off-by: Hongxu Jia -+--- -+ unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h | 4 +++- -+ unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h | 9 ++++++--- -+ 2 files changed, 9 insertions(+), 4 deletions(-) -+ -+diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h -+index 291301a..94e78ba 100644 -+--- a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h -++++ b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h -+@@ -531,7 +531,9 @@ struct TensorEvaluator, Device> { -+ EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; -+ EIGEN_UNROLL_LOOP -+ for (int i = 0; i < PacketSize; ++i) { -+- values[i] = coeff(index + i); -++ Self::CoeffReturnType a = coeff(index+i); -++ values[i] = a; -++ -+ } -+ PacketReturnType rslt = internal::pload(values); -+ return rslt; -+diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h -+index 2ecbb7c..ae0f745 100644 -+--- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h -++++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h -+@@ -838,8 +838,9 @@ struct TensorReductionEvaluatorBase::reduce(*this, firstIndex + i * num_values_to_reduce, -++ Self::CoeffReturnType a = internal::InnerMostDimReducer::reduce(*this, firstIndex + i * num_values_to_reduce, -+ num_values_to_reduce, reducer); -++ values[i] = a; -+ } -+ } else if (PreservingInnerMostDims) { -+ const Index firstIndex = firstInput(index); -+@@ -852,12 +853,14 @@ struct TensorReductionEvaluatorBase(values); -+-- -+2.27.0 -+ -diff --git a/third_party/eigen3/workspace.bzl b/third_party/eigen3/workspace.bzl -index f06eca368c1..40bdebd6796 100644 ---- a/third_party/eigen3/workspace.bzl -+++ b/third_party/eigen3/workspace.bzl -@@ -14,6 +14,7 @@ def repo(): - tf_http_archive( - name = "eigen_archive", - build_file = "//third_party/eigen3:eigen_archive.BUILD", -+ patch_file = ["//third_party/eigen3:0001-workaround-ice-failure-while-building-from-source-wi.patch"], - sha256 = EIGEN_SHA256, - strip_prefix = "eigen-{commit}".format(commit = EIGEN_COMMIT), - urls = tf_mirror_urls("https://gitlab.com/libeigen/eigen/-/archive/{commit}/eigen-{commit}.tar.gz".format(commit = EIGEN_COMMIT)), diff --git a/recipe/patches/0040-Support-cuda-12.8.patch b/recipe/patches/0040-Support-cuda-12.8.patch deleted file mode 100644 index b087d04e..00000000 --- a/recipe/patches/0040-Support-cuda-12.8.patch +++ /dev/null @@ -1,79 +0,0 @@ -From f0bcaf0caa735d2a68b2f0d8c8baf8e8f4453b4f Mon Sep 17 00:00:00 2001 -From: oqs <2227-loqs@users.noreply.gitlab.archlinux.org> -Date: Wed, 6 Aug 2025 19:34:12 +0000 -Subject: [PATCH 40/44] Support cuda 12.8 - -Co-authored-by: Isuru Fernando ---- - tensorflow/core/kernels/gpu_prim.h | 19 +++++++------------ - third_party/xla/xla/service/gpu/gpu_prim.h | 6 ++---- - 2 files changed, 9 insertions(+), 16 deletions(-) - -diff --git a/tensorflow/core/kernels/gpu_prim.h b/tensorflow/core/kernels/gpu_prim.h -index bef22b50ada..821b476cce9 100644 ---- a/tensorflow/core/kernels/gpu_prim.h -+++ b/tensorflow/core/kernels/gpu_prim.h -@@ -37,32 +37,27 @@ namespace gpuprim = ::cub; - - // Required for sorting Eigen::half and bfloat16. - namespace cub { --template <> --__device__ __forceinline__ void ThreadStoreVolatilePtr( -+__device__ __forceinline__ void ThreadStoreVolatilePtr( - Eigen::half *ptr, Eigen::half val, Int2Type /*is_primitive*/) { - *reinterpret_cast(ptr) = - Eigen::numext::bit_cast(val); - } - --template <> --__device__ __forceinline__ Eigen::half ThreadLoadVolatilePointer( -- Eigen::half *ptr, Int2Type /*is_primitive*/) { -- uint16_t result = *reinterpret_cast(ptr); -+__device__ __forceinline__ Eigen::half ThreadLoadVolatilePointer( -+ const Eigen::half *ptr, Int2Type /*is_primitive*/) { -+ uint16_t result = *reinterpret_cast(ptr); - return Eigen::numext::bit_cast(result); - } - --template <> --__device__ __forceinline__ void ThreadStoreVolatilePtr( -+__device__ __forceinline__ void ThreadStoreVolatilePtr( - Eigen::bfloat16 *ptr, Eigen::bfloat16 val, - Int2Type /*is_primitive*/) { - *reinterpret_cast(ptr) = - Eigen::numext::bit_cast(val); - } - --template <> --__device__ __forceinline__ Eigen::bfloat16 --ThreadLoadVolatilePointer(Eigen::bfloat16 *ptr, -- Int2Type /*is_primitive*/) { -+__device__ __forceinline__ Eigen::bfloat16 ThreadLoadVolatilePointer( -+ Eigen::bfloat16 *ptr, Int2Type /*is_primitive*/) { - uint16_t result = *reinterpret_cast(ptr); - return Eigen::numext::bit_cast(result); - } -diff --git a/third_party/xla/xla/service/gpu/gpu_prim.h b/third_party/xla/xla/service/gpu/gpu_prim.h -index 83605864498..d23453f88e1 100644 ---- a/third_party/xla/xla/service/gpu/gpu_prim.h -+++ b/third_party/xla/xla/service/gpu/gpu_prim.h -@@ -37,8 +37,7 @@ namespace gpuprim = ::cub; - - // Required for sorting Eigen::half and bfloat16. - namespace cub { --template <> --__device__ __forceinline__ void ThreadStoreVolatilePtr( -+__device__ __forceinline__ void ThreadStoreVolatilePtr( - Eigen::half *ptr, Eigen::half val, Int2Type /*is_primitive*/) { - *reinterpret_cast(ptr) = - Eigen::numext::bit_cast(val); -@@ -50,8 +49,7 @@ __device__ __forceinline__ Eigen::half ThreadLoadVolatilePointer( - return Eigen::numext::bit_cast(result); - } - --template <> --__device__ __forceinline__ void ThreadStoreVolatilePtr( -+__device__ __forceinline__ void ThreadStoreVolatilePtr( - tsl::bfloat16 *ptr, tsl::bfloat16 val, Int2Type /*is_primitive*/) { - *reinterpret_cast(ptr) = - Eigen::numext::bit_cast(val); diff --git a/recipe/patches/0043-Support-for-TFv2.20-to-compile-with-CUDA-v12.9.1.patch b/recipe/patches/0043-Support-for-TFv2.20-to-compile-with-CUDA-v12.9.1.patch deleted file mode 100644 index c735de41..00000000 --- a/recipe/patches/0043-Support-for-TFv2.20-to-compile-with-CUDA-v12.9.1.patch +++ /dev/null @@ -1,77 +0,0 @@ -From e9edf6f421d091b5c51f4022bedf67e9a0bc2ca9 Mon Sep 17 00:00:00 2001 -From: aravindhbalaji1985 -Date: Mon, 25 Aug 2025 15:15:14 -0700 -Subject: [PATCH 43/44] Support for TFv2.20 to compile with CUDA v12.9.1 - ---- - tensorflow/core/kernels/concat_lib_gpu_impl.cu.cc | 2 +- - .../core/kernels/dynamic_partition_op_gpu.cu.cc | 6 +++++- - tensorflow/core/kernels/split_lib_gpu.cu.cc | 2 +- - tensorflow/core/kernels/where_op_gpu.cu.h | 11 +++++++++++ - 4 files changed, 18 insertions(+), 3 deletions(-) - -diff --git a/tensorflow/core/kernels/concat_lib_gpu_impl.cu.cc b/tensorflow/core/kernels/concat_lib_gpu_impl.cu.cc -index 031464dfdd9..b4fe8ae6977 100644 ---- a/tensorflow/core/kernels/concat_lib_gpu_impl.cu.cc -+++ b/tensorflow/core/kernels/concat_lib_gpu_impl.cu.cc -@@ -70,7 +70,7 @@ __global__ void concat_variable_kernel( - IntType num_inputs = input_ptr_data.size; - - // verbose declaration needed due to template -- GPU_DYNAMIC_SHARED_MEM_DECL(sizeof(T), unsigned char, smem); -+ GPU_DYNAMIC_SHARED_MEM_DECL(8, unsigned char, smem); - IntType* smem_col_scan = reinterpret_cast(smem); - - if (useSmem) { -diff --git a/tensorflow/core/kernels/dynamic_partition_op_gpu.cu.cc b/tensorflow/core/kernels/dynamic_partition_op_gpu.cu.cc -index ae3fe6d140f..737e22e5b9f 100644 ---- a/tensorflow/core/kernels/dynamic_partition_op_gpu.cu.cc -+++ b/tensorflow/core/kernels/dynamic_partition_op_gpu.cu.cc -@@ -410,7 +410,11 @@ class DynamicPartitionOpGPU : public AsyncOpKernel { - num_partitions_); - - #if GOOGLE_CUDA -- cub::ConstantInputIterator values_in(1); -+ #if THRUST_VERSION >= 200802 -+ thrust::constant_iterator values_in(1); -+ #else -+ cub::ConstantInputIterator values_in(1); -+ #endif - #elif TENSORFLOW_USE_ROCM - using ConstantInputIterator = - ::rocprim::constant_iterator; -diff --git a/tensorflow/core/kernels/split_lib_gpu.cu.cc b/tensorflow/core/kernels/split_lib_gpu.cu.cc -index 90b28292ac0..e395d4f12f5 100644 ---- a/tensorflow/core/kernels/split_lib_gpu.cu.cc -+++ b/tensorflow/core/kernels/split_lib_gpu.cu.cc -@@ -120,7 +120,7 @@ __global__ void split_v_kernel(const T* __restrict__ input_ptr, - int num_outputs = output_ptr_data.size; - - // verbose declaration needed due to template -- GPU_DYNAMIC_SHARED_MEM_DECL(sizeof(T), unsigned char, smem); -+ GPU_DYNAMIC_SHARED_MEM_DECL(2, unsigned char, smem); - IntType* smem_col_scan = reinterpret_cast(smem); - - if (useSmem) { -diff --git a/tensorflow/core/kernels/where_op_gpu.cu.h b/tensorflow/core/kernels/where_op_gpu.cu.h -index 5eb03ec60ad..3de25b7a82c 100644 ---- a/tensorflow/core/kernels/where_op_gpu.cu.h -+++ b/tensorflow/core/kernels/where_op_gpu.cu.h -@@ -233,6 +233,17 @@ class WhereOutputIterator { - return *(ptr_ + (valid ? (NDIM * n) : 0)); - } - -+ -+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE reference operator*() const { -+ // Dereference the current pointer -+ return *ptr_; -+ } -+ -+ -+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE self_type operator+(std::ptrdiff_t n) const { -+ return self_type(ptr_ + NDIM * n, max_row_); -+ } -+ - private: - int64* ptr_; - const Eigen::DenseIndex max_row_; diff --git a/recipe/patches/0044-PR-22572-Fix-build-break-in-convolution_thunk_intern.patch b/recipe/patches/0044-PR-22572-Fix-build-break-in-convolution_thunk_intern.patch deleted file mode 100644 index 23e47e01..00000000 --- a/recipe/patches/0044-PR-22572-Fix-build-break-in-convolution_thunk_intern.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 8e1d101acfaed847d292650609839f1a6a1939be Mon Sep 17 00:00:00 2001 -From: mmakevic-amd -Date: Thu, 13 Feb 2025 06:43:50 -0800 -Subject: [PATCH 44/44] PR #22572: Fix build break in - convolution_thunk_internal -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Imported from GitHub PR https://github.com/openxla/xla/pull/22572 - -After this change https://github.com/openxla/xla/commit/8e6b84bd729a1d079ed5035f1ba8afc9d205587e, following build error occurred: - -``` -In file included from xla/backends/cpu/runtime/convolution_thunk_f16.cc:16: -./xla/backends/cpu/runtime/convolution_thunk_internal.h: In lambda function: -./xla/backends/cpu/runtime/convolution_thunk_internal.h:345:71: error: no matching function for call to ‘tsl::CountDownAsyncValueRef::CountDown() const’ - 345 | auto on_done = [count_down]() mutable { count_down.CountDown(); }; - | ~~~~~~~~~~~~~~~~~~~~^~ -In file included from ./xla/backends/cpu/runtime/convolution_thunk_internal.h:26, - from xla/backends/cpu/runtime/convolution_thunk_f16.cc:16: -./xla/tsl/concurrency/async_value_ref.h:867:8: note: candidate: ‘bool tsl::CountDownAsyncValueRef::CountDown(size_t, const absl::lts_20230802::Status&) [with T = tsl::Chain; size_t = long unsigned int]’ - 867 | bool CountDown(size_t count, const absl::Status& status = absl::OkStatus()) { - | ^~~~~~~~~ -./xla/tsl/concurrency/async_value_ref.h:867:8: note: candidate expects 2 arguments, 0 provided -./xla/tsl/concurrency/async_value_ref.h:919:8: note: candidate: ‘bool tsl::CountDownAsyncValueRef::CountDown(absl::lts_20230802::Status) [with T = tsl::Chain]’ (near match) - 919 | bool CountDown(absl::Status status = absl::OkStatus()) { - | ^~~~~~~~~ -./xla/tsl/concurrency/async_value_ref.h:919:8: note: passing ‘const tsl::CountDownAsyncValueRef*’ as ‘this’ argument discards qualifiers -``` -Copybara import of the project: - --- -69268a699eb07efb65be4e42087f75d504f750a6 by Milica Makevic : - -Allow modification of captured variable in nested lambda - -Merging this change closes #22572 - -COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/22572 from ROCm:ci_build_fix_250211 69268a699eb07efb65be4e42087f75d504f750a6 -PiperOrigin-RevId: 726463713 ---- - .../cpu/runtime/convolution_thunk_internal.h | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) - -diff --git a/third_party/xla/xla/backends/cpu/runtime/convolution_thunk_internal.h b/third_party/xla/xla/backends/cpu/runtime/convolution_thunk_internal.h -index 84fed6bb786..7e22492e785 100644 ---- a/third_party/xla/xla/backends/cpu/runtime/convolution_thunk_internal.h -+++ b/third_party/xla/xla/backends/cpu/runtime/convolution_thunk_internal.h -@@ -338,15 +338,16 @@ void EigenGenericConv2D( - auto num_tasks = Eigen::numext::div_ceil(feature_group_count, task_size); - - if (use_thunk_runtime) { -- ScheduleAll(&device, num_tasks, [=, &device](Eigen::Index task_index) { -- Eigen::Index start = task_index * task_size; -- Eigen::Index end = std::min(start + task_size, feature_group_count); -- for (Eigen::Index i = start; i < end; ++i) { -- auto on_done = [count_down]() mutable { count_down.CountDown(); }; -- auto [output, convolved] = convolve_group(i); -- output.device(device, std::move(on_done)) = convolved; -- } -- }); -+ ScheduleAll( -+ &device, num_tasks, [=, &device](Eigen::Index task_index) mutable { -+ Eigen::Index start = task_index * task_size; -+ Eigen::Index end = std::min(start + task_size, feature_group_count); -+ for (Eigen::Index i = start; i < end; ++i) { -+ auto on_done = [count_down]() mutable { count_down.CountDown(); }; -+ auto [output, convolved] = convolve_group(i); -+ output.device(device, std::move(on_done)) = convolved; -+ } -+ }); - } else { - Eigen::Barrier barrier(num_tasks); - ScheduleAll( From 43ba82667eb0378485eac50d928dde7b0e11784b Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 13 Feb 2026 21:34:24 +0000 Subject: [PATCH 2/2] skip cuda, level3 --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1758850e..dc4b17be 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -78,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: