diff mbox series

[meta-tensorflow,13/14] tensorflow: refresh patches for 2.21.0

Message ID 20260325021719.1526525-14-hongxu.jia@windriver.com
State New
Headers show
Series Upgrade tensorflow from 2.19.0 to 2.21.0 | expand

Commit Message

Hongxu Jia March 25, 2026, 2:17 a.m. UTC
- 0001-third_party-tf_runtime-fix-compile-failure.patch
- 0008-make-hermetic-python3-support-offline-build.patch
- 0012-add-yocto-toolchain-to-support-cross-compiling.patch

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...party-tf_runtime-fix-compile-failure.patch | 14 +--
 ...rmetic-python3-support-offline-build.patch | 99 +++++++++----------
 ...toolchain-to-support-cross-compiling.patch | 42 ++++----
 3 files changed, 75 insertions(+), 80 deletions(-)
diff mbox series

Patch

diff --git a/recipes-framework/tensorflow/files/0001-third_party-tf_runtime-fix-compile-failure.patch b/recipes-framework/tensorflow/files/0001-third_party-tf_runtime-fix-compile-failure.patch
index 1eb19b8..de62026 100644
--- a/recipes-framework/tensorflow/files/0001-third_party-tf_runtime-fix-compile-failure.patch
+++ b/recipes-framework/tensorflow/files/0001-third_party-tf_runtime-fix-compile-failure.patch
@@ -1,6 +1,6 @@ 
-From d8b929a5a9d0aa63e709a78af38d7bdaa58a016e Mon Sep 17 00:00:00 2001
+From f9f5feee6779c1a9841d4a3b744fc7eff3802178 Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Mon, 14 Jul 2025 16:13:33 +0800
+Date: Thu, 5 Mar 2026 23:40:00 -0800
 Subject: [PATCH] third_party/tf_runtime: fix compile failure
 
 ...
@@ -15,7 +15,7 @@  external/tf_runtime/include/tfrt/support/forward_decls.h:28:1: note: 'int64_t' i
 ...
 
 Upstream-Status: Pending
-
+Rebase to 2.21
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
  .../tf_runtime/0001-fix-compile-failure.patch | 36 +++++++++++++++++++
@@ -66,12 +66,12 @@  index 00000000000..c05ea5b41e7
 +2.34.1
 +
 diff --git a/third_party/tf_runtime/workspace.bzl b/third_party/tf_runtime/workspace.bzl
-index 69fc0f81f6f..460641dde06 100644
+index 5c8ec13c6f4..3a9a88d3acc 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",
+             "@tsl": "@tsl",
+             "@xla": "@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'.
@@ -81,5 +81,5 @@  index 69fc0f81f6f..460641dde06 100644
 +        ],
      )
 -- 
-2.34.1
+2.49.0
 
diff --git a/recipes-framework/tensorflow/files/0008-make-hermetic-python3-support-offline-build.patch b/recipes-framework/tensorflow/files/0008-make-hermetic-python3-support-offline-build.patch
index 21a9cd4..0908887 100644
--- a/recipes-framework/tensorflow/files/0008-make-hermetic-python3-support-offline-build.patch
+++ b/recipes-framework/tensorflow/files/0008-make-hermetic-python3-support-offline-build.patch
@@ -1,7 +1,7 @@ 
-From 919814dff64170b58084e20fc55cebcb8226a3d1 Mon Sep 17 00:00:00 2001
+From 0ed4abe820951d9f2cbc72a5c49fee85798c0b01 Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Fri, 14 Mar 2025 21:17:31 -0700
-Subject: [PATCH 08/21] make hermetic python3 support offline build
+Date: Thu, 5 Mar 2026 23:04:37 -0800
+Subject: [PATCH] make hermetic python3 support offline build
 
 If environment TS_DL_DIR is set, download python whl from local archive other then
 python index
@@ -10,23 +10,33 @@  If environment TS_DL_DIR is set, save python whl to local dir
 
 Upstream-Status: Inappropriate [Yocto specific]
 
-Rebase to 2.19
+Rebase to 2.21
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
- third_party/0001-support-offline-build.patch  | 51 +++++++++++++++++++
- third_party/py/python_init_rules.bzl          |  2 +-
- .../xla/third_party/py/python_init_rules.bzl  |  2 +-
- .../tsl/third_party/py/python_init_rules.bzl  |  2 +-
- 4 files changed, 54 insertions(+), 3 deletions(-)
- create mode 100644 third_party/0001-support-offline-build.patch
+ third_party/py/python_init_rules.bzl          |  1 +
+ .../py/0001-support-offline-build.patch       | 58 +++++++++++++++++++
+ .../xla/third_party/py/python_init_rules.bzl  |  1 +
+ 3 files changed, 60 insertions(+)
+ create mode 100644 third_party/xla/third_party/py/0001-support-offline-build.patch
 
-diff --git a/third_party/0001-support-offline-build.patch b/third_party/0001-support-offline-build.patch
+diff --git a/third_party/py/python_init_rules.bzl b/third_party/py/python_init_rules.bzl
+index 84370d1dffe..8f27c46dbe5 100644
+--- a/third_party/py/python_init_rules.bzl
++++ b/third_party/py/python_init_rules.bzl
+@@ -41,5 +41,6 @@ def python_init_rules(extra_patches = []):
+             "@xla//third_party/py:rules_python_pip_version.patch",
+             "@xla//third_party/py:rules_python_freethreaded.patch",
+             "@xla//third_party/py:rules_python_versions.patch",
++            "@xla//third_party/py:third_party:0001-support-offline-build.patch",
+         ] + extra_patches,
+     )
+diff --git a/third_party/xla/third_party/py/0001-support-offline-build.patch b/third_party/xla/third_party/py/0001-support-offline-build.patch
 new file mode 100644
-index 00000000000..f30e9a453a6
+index 00000000000..57ad06b001b
 --- /dev/null
-+++ b/third_party/0001-support-offline-build.patch
-@@ -0,0 +1,51 @@
-+From 7cb07f8c690ab460ccf8a12acb52ff6e174cf480 Mon Sep 17 00:00:00 2001
++++ b/third_party/xla/third_party/py/0001-support-offline-build.patch
+@@ -0,0 +1,58 @@
++From e90bf48d67fe91d4881106c16d6229725c75b0fd Mon Sep 17 00:00:00 2001
 +From: Hongxu Jia <hongxu.jia@windriver.com>
 +Date: Fri, 14 Mar 2025 21:13:10 -0700
 +Subject: [PATCH] make hermetic python3 support offline build
@@ -36,19 +46,26 @@  index 00000000000..f30e9a453a6
 +
 +If environment TS_DL_DIR is set, save python whl to local dir
 +
++Configure cache dir of pip
++
 +Upstream-Status: Inappropriate [Yocto specific]
 +
-+Rebase to 2.19
++Rebase to 2.21
 +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 +---
-+ python/private/pypi/whl_installer/wheel_installer.py | 12 ++++++++++++
-+ 1 file changed, 12 insertions(+)
++ .../private/pypi/whl_installer/wheel_installer.py  | 14 +++++++++++++-
++ 1 file changed, 13 insertions(+), 1 deletion(-)
 +
 +diff --git a/python/private/pypi/whl_installer/wheel_installer.py b/python/private/pypi/whl_installer/wheel_installer.py
-+index ef8181c..d886266 100644
++index a6a9dd0..0e233fd 100644
 +--- a/python/private/pypi/whl_installer/wheel_installer.py
 ++++ b/python/private/pypi/whl_installer/wheel_installer.py
-+@@ -173,6 +173,11 @@ def main() -> None:
++@@ -147,10 +147,15 @@ def main() -> None:
++         [sys.executable, "-m", "pip"]
++         + (["--isolated"] if args.isolated else [])
++         + (["download", "--only-binary=:all:"] if args.download_only else ["wheel"])
++-        + ["--no-deps"]
+++        + ["--no-deps", "--cache-dir=${PIP_CACHE_DIR}"]
 +         + deserialized_args["extra_pip_args"]
 +     )
 + 
@@ -60,7 +77,7 @@  index 00000000000..f30e9a453a6
 +     requirement_file = NamedTemporaryFile(mode="wb", delete=False)
 +     try:
 +         requirement_file.write(args.requirement.encode("utf-8"))
-+@@ -195,6 +200,13 @@ def main() -> None:
++@@ -173,6 +178,13 @@ def main() -> None:
 +             if e.errno != errno.ENOENT:
 +                 raise
 + 
@@ -75,41 +92,19 @@  index 00000000000..f30e9a453a6
 + 
 +     with open("whl_file.json", "w") as f:
 +-- 
-+2.25.1
++2.34.1
 +
-diff --git a/third_party/py/python_init_rules.bzl b/third_party/py/python_init_rules.bzl
-index 796ae3d92d9..bfb750ac72d 100644
---- a/third_party/py/python_init_rules.bzl
-+++ b/third_party/py/python_init_rules.bzl
-@@ -9,5 +9,5 @@ def python_init_rules():
-         strip_prefix = "rules_python-0.39.0",
-         url = "https://github.com/bazelbuild/rules_python/releases/download/0.39.0/rules_python-0.39.0.tar.gz",
-         patch_args = ["-p1"],
--        patches = [Label("//third_party/py:rules_python.patch")],
-+        patches = ["//third_party/py:rules_python.patch", "//third_party:0001-support-offline-build.patch"],
-     )
 diff --git a/third_party/xla/third_party/py/python_init_rules.bzl b/third_party/xla/third_party/py/python_init_rules.bzl
-index 796ae3d92d9..bfb750ac72d 100644
+index 84370d1dffe..2fc861b5af7 100644
 --- a/third_party/xla/third_party/py/python_init_rules.bzl
 +++ b/third_party/xla/third_party/py/python_init_rules.bzl
-@@ -9,5 +9,5 @@ def python_init_rules():
-         strip_prefix = "rules_python-0.39.0",
-         url = "https://github.com/bazelbuild/rules_python/releases/download/0.39.0/rules_python-0.39.0.tar.gz",
-         patch_args = ["-p1"],
--        patches = [Label("//third_party/py:rules_python.patch")],
-+        patches = ["//third_party/py:rules_python.patch", "//third_party:0001-support-offline-build.patch"],
-     )
-diff --git a/third_party/xla/third_party/tsl/third_party/py/python_init_rules.bzl b/third_party/xla/third_party/tsl/third_party/py/python_init_rules.bzl
-index 796ae3d92d9..bfb750ac72d 100644
---- a/third_party/xla/third_party/tsl/third_party/py/python_init_rules.bzl
-+++ b/third_party/xla/third_party/tsl/third_party/py/python_init_rules.bzl
-@@ -9,5 +9,5 @@ def python_init_rules():
-         strip_prefix = "rules_python-0.39.0",
-         url = "https://github.com/bazelbuild/rules_python/releases/download/0.39.0/rules_python-0.39.0.tar.gz",
-         patch_args = ["-p1"],
--        patches = [Label("//third_party/py:rules_python.patch")],
-+        patches = ["//third_party/py:rules_python.patch", "//third_party:0001-support-offline-build.patch"],
+@@ -41,5 +41,6 @@ def python_init_rules(extra_patches = []):
+             "@xla//third_party/py:rules_python_pip_version.patch",
+             "@xla//third_party/py:rules_python_freethreaded.patch",
+             "@xla//third_party/py:rules_python_versions.patch",
++            "@xla//third_party/py:0001-support-offline-build.patch",
+         ] + extra_patches,
      )
 -- 
-2.25.1
+2.49.0
 
diff --git a/recipes-framework/tensorflow/files/0012-add-yocto-toolchain-to-support-cross-compiling.patch b/recipes-framework/tensorflow/files/0012-add-yocto-toolchain-to-support-cross-compiling.patch
index 8f5eda7..2fddbcb 100644
--- a/recipes-framework/tensorflow/files/0012-add-yocto-toolchain-to-support-cross-compiling.patch
+++ b/recipes-framework/tensorflow/files/0012-add-yocto-toolchain-to-support-cross-compiling.patch
@@ -1,11 +1,11 @@ 
-From a8439d8d6dc9877d6196eec2065fffab1b74af86 Mon Sep 17 00:00:00 2001
+From 28eb8559b29424eb10dde0fcdec9da1aba26b52c Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Fri, 14 Mar 2025 21:27:41 -0700
-Subject: [PATCH 12/21] add yocto toolchain to support cross compiling
+Date: Tue, 10 Mar 2026 23:54:19 -0700
+Subject: [PATCH] add yocto toolchain to support cross compiling
 
 Upstream-Status: Inappropriate [oe specific]
 
-Rebase to 2.19
+Rebase to 2.21
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
  WORKSPACE                 | 7 +++++++
@@ -14,13 +14,13 @@  Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
  3 files changed, 24 insertions(+)
 
 diff --git a/WORKSPACE b/WORKSPACE
-index 0171c60db38..d6872677ce9 100644
+index 4813611b836..a1fd88befe9 100644
 --- a/WORKSPACE
 +++ b/WORKSPACE
-@@ -117,3 +117,10 @@ load(
+@@ -193,3 +193,10 @@ load(
+ nvshmem_redist_init_repository(
+     nvshmem_redistributions = NVSHMEM_REDISTRIBUTIONS,
  )
- 
- nccl_configure(name = "local_config_nccl")
 +
 +new_local_repository(
 +    name = "yocto_compiler",
@@ -29,10 +29,10 @@  index 0171c60db38..d6872677ce9 100644
 +)
 +
 diff --git a/tensorflow/BUILD b/tensorflow/BUILD
-index 94c9a9721ac..c7d4410cbbd 100644
+index da5ba2a8093..b2b6e6081de 100644
 --- a/tensorflow/BUILD
 +++ b/tensorflow/BUILD
-@@ -356,6 +356,15 @@ config_setting(
+@@ -390,6 +390,15 @@ config_setting(
      visibility = ["//visibility:public"],
  )
  
@@ -47,20 +47,20 @@  index 94c9a9721ac..c7d4410cbbd 100644
 +
  config_setting(
      name = "android_arm",
-     constraint_values = if_google(
+     constraint_values =
 diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
-index 146e7353c3e..48b5b385211 100644
+index 5e634efe5e1..57575f83125 100644
 --- a/tensorflow/workspace2.bzl
 +++ b/tensorflow/workspace2.bzl
-@@ -12,6 +12,7 @@ load("//tensorflow/tools/def_file_filter:def_file_filter_configure.bzl", "def_fi
- load("//tensorflow/tools/toolchains:cpus/aarch64/aarch64_compiler_configure.bzl", "aarch64_compiler_configure")
- load("//tensorflow/tools/toolchains:cpus/arm/arm_compiler_configure.bzl", "arm_compiler_configure")
- load("//tensorflow/tools/toolchains/clang6:repo.bzl", "clang6_configure")
+@@ -44,6 +44,7 @@ load("@xla//tools/def_file_filter:def_file_filter_configure.bzl", "def_file_filt
+ load("@xla//tools/toolchains:cpus/aarch64/aarch64_compiler_configure.bzl", "aarch64_compiler_configure")
+ load("@xla//tools/toolchains:cpus/arm/arm_compiler_configure.bzl", "arm_compiler_configure")
+ load("@xla//tools/toolchains/clang6:repo.bzl", "clang6_configure")
 +load("//third_party/toolchains/yocto:yocto_compiler_configure.bzl", "yocto_compiler_configure")
- load("//tensorflow/tools/toolchains/embedded/arm-linux:arm_linux_toolchain_configure.bzl", "arm_linux_toolchain_configure")
- load("//tensorflow/tools/toolchains/remote:configure.bzl", "remote_execution_configure")
- load("//tensorflow/tools/toolchains/remote_config:configs.bzl", "initialize_rbe_configs")
-@@ -131,6 +132,13 @@ def _tf_toolchains():
+ load("@xla//tools/toolchains/embedded/arm-linux:arm_linux_toolchain_configure.bzl", "arm_linux_toolchain_configure")
+ load("@xla//tools/toolchains/remote:configure.bzl", "remote_execution_configure")
+ load("@xla//tools/toolchains/remote_config:configs.bzl", "initialize_rbe_configs")
+@@ -153,6 +154,13 @@ def _tf_toolchains():
      # Load aarch64 toolchain
      aarch64_compiler_configure()
  
@@ -75,5 +75,5 @@  index 146e7353c3e..48b5b385211 100644
      arm_linux_toolchain_configure(
          name = "local_config_embedded_arm",
 -- 
-2.25.1
+2.49.0