summaryrefslogtreecommitdiff
path: root/sci-libs/tensorflow/files
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/tensorflow/files')
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch38
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch32
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch29
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch35
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch71
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0006-systemlib-Update-targets-for-absl_py.patch27
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0007-systemlibs-Add-well_known_types_py_pb2-target.patch28
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0008-Relax-setup.py-version-requirements.patch55
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0009-fix-sparse-transpose-op2.patch30
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0010-systemlibs-update-targets-for-absl.patch352
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0011-systemlibs-update-targets-for-google_cloud_cpp.patch25
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0012-bump-cudnn-frontend-to-v0.9.patch29
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.13.0-0013-Fixing-build-issue-with-Clang-16-and-GCC-13.patch39
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch37
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch32
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch29
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch35
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch71
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0006-systemlib-Update-targets-for-absl_py.patch24
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0007-systemlib-Add-well_known_types_py_pb2-target.patch28
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0008-Relax-setup.py-version-requirements.patch38
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0009-systemlib-update-targets-for-absl.patch365
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0010-systemlib-fix-missing-osx-in-pybind11.patch25
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch25
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0012-build-use-non-hermetic-python.patch2745
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0013-installation-remove-cp_local_config_python.patch68
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.14.1-0014-Fixing-build-issue-with-Clang-16.patch25
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch37
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch32
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch29
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch35
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch71
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0006-systemlib-Update-targets-for-absl_py.patch24
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0007-systemlib-Add-well_known_types_py_pb2-target.patch28
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0008-Relax-setup.py-version-requirements.patch86
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0009-systemlib-update-targets-for-absl.patch365
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0010-systemlib-fix-missing-osx-in-pybind11.patch25
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch25
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0012-installation-remove-cp_local_config_python.patch68
-rw-r--r--sci-libs/tensorflow/files/tensorflow-2.15.0-0013-build-use-non-hermetic-python.patch990
40 files changed, 6152 insertions, 0 deletions
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch
new file mode 100644
index 000000000000..b6a4dab0313a
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch
@@ -0,0 +1,38 @@
+From 87b5fceaeb9667c47504637462f0b5944661e5fd Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Wed, 11 Sep 2019 12:08:34 +0800
+Subject: [PATCH 01/12] WORKSPACE: add rules-docker http_archive,
+ bazel-toolchains uses git_repo
+
+git_repository() rules cannot pull from --distdir and fail when building
+without internet access. Use http_archive instead and pin the sha256
+hash as well.
+
+Signed-off-by: Jason Zaman <jason@perfinion.com>
+---
+ WORKSPACE | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/WORKSPACE b/WORKSPACE
+index 1286ef9ac03..1a19e5f2e3d 100644
+--- a/WORKSPACE
++++ b/WORKSPACE
+@@ -1,5 +1,15 @@
+ workspace(name = "org_tensorflow")
+
++load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
++http_archive(
++ name = "io_bazel_rules_docker",
++ sha256 = "7d453450e1eb70e238eea6b31f4115607ec1200e91afea01c25f9804f37e39c8",
++ strip_prefix = "rules_docker-0.10.0",
++ urls = [
++ "https://github.com/bazelbuild/rules_docker/releases/download/v0.10.0/rules_docker-v0.10.0.tar.gz",
++ ],
++)
++
+ # Initialize the TensorFlow repository and all dependencies.
+ #
+ # The cascade of load() statements and tf_workspace?() calls works around the
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch
new file mode 100644
index 000000000000..d14e9a7215a9
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch
@@ -0,0 +1,32 @@
+From e3c7880a940711d071747c2494dd8966fad9c63f Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Sun, 6 Feb 2022 00:13:56 -0800
+Subject: [PATCH 02/12] systemlib: Latest absl LTS has split cord libs
+
+---
+ third_party/absl/system.absl.strings.BUILD | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/third_party/absl/system.absl.strings.BUILD b/third_party/absl/system.absl.strings.BUILD
+index fa9a7a84f67..63bac99d71b 100644
+--- a/third_party/absl/system.absl.strings.BUILD
++++ b/third_party/absl/system.absl.strings.BUILD
+@@ -26,7 +26,14 @@ cc_library(
+
+ cc_library(
+ name = "cord",
+- linkopts = ["-labsl_cord"],
++ linkopts = [
++ "-labsl_cord",
++ "-labsl_cord_internal",
++ "-labsl_cordz_functions",
++ "-labsl_cordz_handle",
++ "-labsl_cordz_info",
++ "-labsl_cordz_sample_token",
++ ],
+ deps = [
+ ":str_format",
+ "//absl/container:compressed_tuple",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch
new file mode 100644
index 000000000000..f07c70b8f88e
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch
@@ -0,0 +1,29 @@
+From d508dad1ffe6c6229f912fb7283dc90666a09025 Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Mon, 5 Sep 2022 12:52:44 -0700
+Subject: [PATCH 03/12] mkl_dnn: Must link against libm for round and log2
+
+---
+ third_party/mkl_dnn/mkldnn_v1.BUILD | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/third_party/mkl_dnn/mkldnn_v1.BUILD b/third_party/mkl_dnn/mkldnn_v1.BUILD
+index 6a26ca83b44..c938a8c7a9f 100644
+--- a/third_party/mkl_dnn/mkldnn_v1.BUILD
++++ b/third_party/mkl_dnn/mkldnn_v1.BUILD
+@@ -163,9 +163,9 @@ cc_library(
+ includes = _INCLUDES_LIST,
+ # TODO(penpornk): Use lrt_if_needed from tensorflow.bzl instead.
+ linkopts = select({
+- "@org_tensorflow//tensorflow/tsl:linux_aarch64": ["-lrt"],
+- "@org_tensorflow//tensorflow/tsl:linux_x86_64": ["-lrt"],
+- "@org_tensorflow//tensorflow/tsl:linux_ppc64le": ["-lrt"],
++ "@org_tensorflow//tensorflow/tsl:linux_aarch64": ["-lrt", "-lm"],
++ "@org_tensorflow//tensorflow/tsl:linux_x86_64": ["-lrt", "-lm"],
++ "@org_tensorflow//tensorflow/tsl:linux_ppc64le": ["-lrt", "-lm"],
+ "//conditions:default": [],
+ }),
+ textual_hdrs = _TEXTUAL_HDRS_LIST,
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch
new file mode 100644
index 000000000000..5fe8e7117c66
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch
@@ -0,0 +1,35 @@
+From b87687bace18200785b3f2686791c457f3ef72e7 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:42:48 +0800
+Subject: [PATCH 04/12] tensorflow_cc: Add systemlib nsync linkopts
+
+Linkopts dont get propagated up to the shared library correctly so
+workaround by applying them directly
+---
+ tensorflow/BUILD | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tensorflow/BUILD b/tensorflow/BUILD
+index fce465ff1f2..4c0bd5a148b 100644
+--- a/tensorflow/BUILD
++++ b/tensorflow/BUILD
+@@ -43,6 +43,7 @@ load(
+ "tf_cc_shared_library",
+ )
+ load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
++load("@local_config_syslibs//:build_defs.bzl", "if_system_lib")
+
+ # copybara:uncomment_begin
+ # load("//devtools/copybara/rules:copybara.bzl", "copybara_config_test")
+@@ -1293,7 +1294,7 @@ tf_cc_shared_library(
+ "-z defs",
+ "-Wl,--version-script,$(location //tensorflow:tf_version_script.lds)",
+ ],
+- }),
++ }) + if_system_lib("nsync", ["-lnsync_cpp"]),
+ per_os_targets = True,
+ roots = [
+ "//tensorflow/c:c_api",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch
new file mode 100644
index 000000000000..4395e0dc1180
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch
@@ -0,0 +1,71 @@
+From 11ca00ba2561f6466917a7bbb23fb266e5e31045 Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Tue, 30 May 2023 09:10:03 -0700
+Subject: [PATCH 05/12] systemlib: Updates for Abseil 20220623 LTS
+
+These targets are header-only and just need stub bazel targets
+---
+ third_party/absl/system.absl.functional.BUILD | 22 +++++++++++++++++++
+ third_party/absl/system.absl.random.BUILD | 12 ++++++++++
+ 2 files changed, 34 insertions(+)
+
+diff --git a/third_party/absl/system.absl.functional.BUILD b/third_party/absl/system.absl.functional.BUILD
+index a4f70acf35c..579181dec07 100644
+--- a/third_party/absl/system.absl.functional.BUILD
++++ b/third_party/absl/system.absl.functional.BUILD
+@@ -2,10 +2,32 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
+
+ package(default_visibility = ["//visibility:public"])
+
++cc_library(
++ name = "any_invocable",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/meta:type_traits",
++ "//absl/utility",
++ ],
++)
++
+ cc_library(
+ name = "bind_front",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/container:compressed_tuple",
++ "//absl/meta:type_traits",
++ "//absl/utility",
++ ],
+ )
+
+ cc_library(
+ name = "function_ref",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/base:core_headers",
++ "//absl/meta:type_traits",
++ ],
+ )
+diff --git a/third_party/absl/system.absl.random.BUILD b/third_party/absl/system.absl.random.BUILD
+index 948de07751a..5ebd656be8e 100644
+--- a/third_party/absl/system.absl.random.BUILD
++++ b/third_party/absl/system.absl.random.BUILD
+@@ -51,3 +51,15 @@ cc_library(
+ "//absl/types:span",
+ ],
+ )
++
++cc_library(
++ name = "bit_gen_ref",
++ deps = [
++ ":random",
++ "//absl/base:core_headers",
++ "//absl/base:fast_type_id",
++ "//absl/meta:type_traits",
++ "//absl/random/internal:distribution_caller",
++ "//absl/random/internal:fast_uniform_bits",
++ ],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0006-systemlib-Update-targets-for-absl_py.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0006-systemlib-Update-targets-for-absl_py.patch
new file mode 100644
index 000000000000..683613ced2f2
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0006-systemlib-Update-targets-for-absl_py.patch
@@ -0,0 +1,27 @@
+From cb0eb12a89b18955c75e305f96069aeabf01a5b2 Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Tue, 30 May 2023 09:33:14 -0700
+Subject: [PATCH 06/12] systemlib: Update targets for absl_py
+
+---
+ third_party/systemlibs/absl_py.absl.flags.BUILD | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/third_party/systemlibs/absl_py.absl.flags.BUILD b/third_party/systemlibs/absl_py.absl.flags.BUILD
+index 4049989ae2f..614938fb8c4 100644
+--- a/third_party/systemlibs/absl_py.absl.flags.BUILD
++++ b/third_party/systemlibs/absl_py.absl.flags.BUILD
+@@ -5,3 +5,10 @@ package(default_visibility = ["//visibility:public"])
+ py_library(
+ name = "flags",
+ )
++
++py_library(
++ name = "argparse_flags",
++ deps = [
++ ":flags",
++ ],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0007-systemlibs-Add-well_known_types_py_pb2-target.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0007-systemlibs-Add-well_known_types_py_pb2-target.patch
new file mode 100644
index 000000000000..c7a82e4d8c16
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0007-systemlibs-Add-well_known_types_py_pb2-target.patch
@@ -0,0 +1,28 @@
+From 7c532a426ca473aff233df19baef46fe9a2196a1 Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Sat, 3 Jun 2023 16:23:51 -0700
+Subject: [PATCH 07/12] systemlibs: Add well_known_types_py_pb2 target
+
+Bug: https://github.com/tensorflow/tensorflow/issues/60667
+---
+ third_party/systemlibs/protobuf.BUILD | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
+index 4d05ab28d12..b3d72b0e3ad 100644
+--- a/third_party/systemlibs/protobuf.BUILD
++++ b/third_party/systemlibs/protobuf.BUILD
+@@ -111,3 +111,10 @@ py_library(
+ visibility = ["//visibility:public"],
+ deps = [dep + "_proto" for dep in proto[1][1]],
+ ) for proto in WELL_KNOWN_PROTO_MAP.items()]
++
++py_proto_library(
++ name = "well_known_types_py_pb2",
++ include = ".",
++ srcs = [proto[1][0] for proto in WELL_KNOWN_PROTO_MAP.items()],
++ visibility = ["//visibility:public"],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0008-Relax-setup.py-version-requirements.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0008-Relax-setup.py-version-requirements.patch
new file mode 100644
index 000000000000..c2467776b33a
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0008-Relax-setup.py-version-requirements.patch
@@ -0,0 +1,55 @@
+From fa870249f5629d1e5cc3299c1a42078dd94343c7 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Sun, 26 Nov 2023 10:14:42 +0800
+Subject: [PATCH 08/12] Relax setup.py version requirements
+
+---
+ tensorflow/tools/pip_package/setup.py | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py
+index e64c0d4344b..62315962318 100644
+--- a/tensorflow/tools/pip_package/setup.py
++++ b/tensorflow/tools/pip_package/setup.py
+@@ -86,21 +86,21 @@ REQUIRED_PACKAGES = [
+ 'astunparse >= 1.6.0',
+ 'flatbuffers >= 23.1.21',
+ # TODO(b/213222745) gast versions above 0.4.0 break TF's tests
+- 'gast >= 0.2.1, <= 0.4.0',
++ 'gast',
+ 'google_pasta >= 0.1.1',
+ 'h5py >= 2.9.0',
+- 'libclang >= 13.0.0',
+- 'numpy >= 1.22, <= 1.24.3',
++ # 'libclang >= 13.0.0',
++ 'numpy >= 1.22',
+ 'opt_einsum >= 2.3.2',
+ 'packaging',
+ 'protobuf>=3.20.3,<5.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5',
+ 'setuptools',
+ 'six >= 1.12.0',
+ 'termcolor >= 1.1.0',
+- 'typing_extensions>=3.6.6,<4.6.0',
++ 'typing_extensions>=3.6.6',
+ 'wrapt >= 1.11.0',
+- 'tensorflow-io-gcs-filesystem >= 0.23.1;platform_machine!="arm64" or ' +
+- 'platform_system!="Darwin"',
++ # 'tensorflow-io-gcs-filesystem >= 0.23.1;platform_machine!="arm64" or ' +
++ # 'platform_system!="Darwin"',
+ # grpcio does not build correctly on big-endian machines due to lack of
+ # BoringSSL support.
+ # See https://github.com/tensorflow/tensorflow/issues/17882.
+@@ -134,8 +134,8 @@ FAKE_REQUIRED_PACKAGES = [
+ _VERSION + ';platform_system=="Windows"',
+ ]
+
+-if platform.system() == 'Linux' and platform.machine() == 'x86_64':
+- REQUIRED_PACKAGES.append(FAKE_REQUIRED_PACKAGES)
++# if platform.system() == 'Linux' and platform.machine() == 'x86_64':
++# REQUIRED_PACKAGES.append(FAKE_REQUIRED_PACKAGES)
+
+ if collaborator_build:
+ # If this is a collaborator build, then build an "installer" wheel and
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0009-fix-sparse-transpose-op2.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0009-fix-sparse-transpose-op2.patch
new file mode 100644
index 000000000000..26b61ac3e5fd
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0009-fix-sparse-transpose-op2.patch
@@ -0,0 +1,30 @@
+From 7961afc6f67a4278409f7bdb710180daeb91c106 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Sun, 26 Nov 2023 10:31:31 +0800
+Subject: [PATCH 09/12] fix sparse transpose op2
+
+---
+ tensorflow/core/kernels/sparse/transpose_op.cc | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/tensorflow/core/kernels/sparse/transpose_op.cc b/tensorflow/core/kernels/sparse/transpose_op.cc
+index 4fe99013480..a247d417504 100644
+--- a/tensorflow/core/kernels/sparse/transpose_op.cc
++++ b/tensorflow/core/kernels/sparse/transpose_op.cc
+@@ -208,6 +208,13 @@ Status CSRSparseMatrixTranspose<Device, T>::operator()(
+ return OkStatus();
+ }
+
++#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
++template struct CSRSparseMatrixTranspose<GPUDevice, float>;
++template struct CSRSparseMatrixTranspose<GPUDevice, double>;
++template struct CSRSparseMatrixTranspose<GPUDevice, std::complex<float>>;
++template struct CSRSparseMatrixTranspose<GPUDevice, std::complex<double>>;
++#endif
++
+ // CPU kernel for transposing a single component of a CSR SparseMatrix.
+ template <typename T>
+ struct CSRSparseMatrixTransposeComponent<CPUDevice, T> {
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0010-systemlibs-update-targets-for-absl.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0010-systemlibs-update-targets-for-absl.patch
new file mode 100644
index 000000000000..8ba85f4f1019
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0010-systemlibs-update-targets-for-absl.patch
@@ -0,0 +1,352 @@
+From d224ce2be1a6b67ab53697ae978c1d29e6d3e159 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Sun, 26 Nov 2023 13:12:20 +0800
+Subject: [PATCH 10/12] systemlibs: update targets for absl
+
+---
+ .../distribute/experimental/rpc/kernels/BUILD | 1 +
+ third_party/absl/system.absl.debugging.BUILD | 20 +-
+ third_party/absl/system.absl.log.BUILD | 271 ++++++++++++++++++
+ third_party/absl/workspace.bzl | 1 +
+ 4 files changed, 288 insertions(+), 5 deletions(-)
+ create mode 100644 third_party/absl/system.absl.log.BUILD
+
+diff --git a/tensorflow/distribute/experimental/rpc/kernels/BUILD b/tensorflow/distribute/experimental/rpc/kernels/BUILD
+index f8757df41e0..d168d36cb2a 100644
+--- a/tensorflow/distribute/experimental/rpc/kernels/BUILD
++++ b/tensorflow/distribute/experimental/rpc/kernels/BUILD
+@@ -51,6 +51,7 @@ tf_kernel_library(
+ "//tensorflow/distribute/experimental/rpc/proto:tf_rpc_service_cc_grpc_proto",
+ "//tensorflow/distribute/experimental/rpc/proto:tf_rpc_service_proto_cc",
+ "@com_github_grpc_grpc//:grpc++",
++ "@com_google_absl//absl/log:check",
+ "@com_google_absl//absl/strings",
+ "@com_google_absl//absl/strings:str_format",
+ ],
+diff --git a/third_party/absl/system.absl.debugging.BUILD b/third_party/absl/system.absl.debugging.BUILD
+index 931ffdc9e92..223db7b4c46 100644
+--- a/third_party/absl/system.absl.debugging.BUILD
++++ b/third_party/absl/system.absl.debugging.BUILD
+@@ -26,15 +26,25 @@ cc_library(
+
+ cc_library(
+ name = "failure_signal_handler",
+- linkopts = [
+- "-labsl_failure_signal_handler",
+- "-labsl_examine_stack",
++ linkopts = ["-labsl_failure_signal_handler"],
++ deps = [
++ ":examine_stack",
++ ":stacktrace",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
+ ],
++)
++
++cc_library(
++ name = "examine_stack",
++ linkopts = ["-labsl_examine_stack"],
+ deps = [
+ ":stacktrace",
+ ":symbolize",
+- "//absl/base",
+- "//absl/base:errno_saver",
++ "//absl/base:config",
++ "//absl/base:core_headers",
+ "//absl/base:raw_logging_internal",
+ ],
+ )
+diff --git a/third_party/absl/system.absl.log.BUILD b/third_party/absl/system.absl.log.BUILD
+new file mode 100644
+index 00000000000..9a2a5de657e
+--- /dev/null
++++ b/third_party/absl/system.absl.log.BUILD
+@@ -0,0 +1,271 @@
++load("@rules_cc//cc:defs.bzl", "cc_library")
++
++package(default_visibility = ["//visibility:public"])
++
++cc_library(
++ name = "log",
++ deps = [
++ "//absl/log:internal_log_impl",
++ ],
++)
++
++cc_library(
++ name = "internal_log_impl",
++ deps = [
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ ],
++)
++
++cc_library(
++ name = "internal_conditions",
++ linkopts = ["-labsl_log_internal_conditions"],
++ deps = [
++ ":internal_voidify",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_voidify",
++ deps = ["//absl/base:config"],
++)
++
++cc_library(
++ name = "internal_message",
++ linkopts = ["-labsl_log_internal_message"],
++ deps = [
++ ":entry",
++ ":globals",
++ ":internal_append_truncated",
++ ":internal_format",
++ ":internal_globals",
++ ":internal_log_sink_set",
++ ":internal_nullguard",
++ ":internal_proto",
++ ":severity",
++ ":sink",
++ ":sink_registry",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:errno_saver",
++ "//absl/base:raw_logging_internal",
++ "//absl/base:strerror",
++ "//absl/container:inlined_vector",
++ "//absl/debugging:examine_stack",
++ "//absl/memory",
++ "//absl/strings",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_append_truncated",
++ deps = [
++ "//absl/base:config",
++ "//absl/strings",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_format",
++ linkopts = ["-labsl_log_internal_format"],
++ deps = [
++ ":internal_append_truncated",
++ ":internal_config",
++ ":internal_globals",
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/strings:str_format",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_globals",
++ linkopts = ["-labsl_log_internal_globals"],
++ deps = [
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/strings",
++ "//absl/time",
++ ],
++)
++
++cc_library(
++ name = "internal_proto",
++ linkopts = ["-labsl_log_internal_proto"],
++ deps = [
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_log_sink_set",
++ linkopts = ["-labsl_log_internal_log_sink_set"],
++ deps = [
++ ":entry",
++ ":globals",
++ ":internal_config",
++ ":internal_globals",
++ ":severity",
++ ":sink",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/cleanup",
++ "//absl/strings",
++ "//absl/synchronization",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_config",
++ deps = [
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_nullguard",
++ linkopts = ["-labsl_log_internal_nullguard"],
++ deps = [
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "globals",
++ linkopts = ["-labsl_log_globals"],
++ deps = [
++ ":severity",
++ "//absl/base:atomic_hook",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/hash",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "entry",
++ linkopts = ["-labsl_log_entry"],
++ deps = [
++ ":internal_config",
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "severity",
++ linkopts = ["-labsl_log_severity"],
++ deps = ["//absl/base:core_headers"],
++)
++
++cc_library(
++ name = "sink",
++ linkopts = ["-labsl_log_sink"],
++ deps = [
++ ":entry",
++ "//absl/base:config",
++ ],
++)
++
++cc_library(
++ name = "sink_registry",
++ deps = [
++ ":internal_log_sink_set",
++ ":sink",
++ "//absl/base:config",
++ ],
++)
++
++cc_library(
++ name = "internal_strip",
++ deps = [
++ ":internal_message",
++ ":internal_nullstream",
++ ":severity",
++ ],
++)
++
++cc_library(
++ name = "internal_nullstream",
++ deps = [
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "check",
++ deps = [
++ ":internal_check_impl",
++ ":internal_check_op",
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_check_impl",
++ deps = [
++ ":internal_check_op",
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_check_op",
++ linkopts = ["-labsl_log_internal_check_op"],
++ deps = [
++ ":internal_nullguard",
++ ":internal_nullstream",
++ ":internal_strip",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "absl_check",
++ deps = [":internal_check_impl"],
++)
++
++cc_library(
++ name = "absl_log",
++ deps = [":internal_log_impl"],
++)
+diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl
+index 07f49cebb78..a7f4e5ffc44 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",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0011-systemlibs-update-targets-for-google_cloud_cpp.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0011-systemlibs-update-targets-for-google_cloud_cpp.patch
new file mode 100644
index 000000000000..d6c135cc706d
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0011-systemlibs-update-targets-for-google_cloud_cpp.patch
@@ -0,0 +1,25 @@
+From 0264617528e53e6b9c8f298ec9bec4a064ffdf27 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Wed, 29 Nov 2023 13:35:24 +0800
+Subject: [PATCH 11/12] systemlibs:update targets for google_cloud_cpp
+
+---
+ third_party/systemlibs/google_cloud_cpp.BUILD | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/third_party/systemlibs/google_cloud_cpp.BUILD b/third_party/systemlibs/google_cloud_cpp.BUILD
+index cbe6e10ba5b..fce306a22f1 100644
+--- a/third_party/systemlibs/google_cloud_cpp.BUILD
++++ b/third_party/systemlibs/google_cloud_cpp.BUILD
+@@ -4,3 +4,8 @@ filegroup(
+ name = "LICENSE",
+ visibility = ["//visibility:public"],
+ )
++
++cc_library(
++ name = "storage_client",
++ visibility = ["//visibility:public"],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0012-bump-cudnn-frontend-to-v0.9.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0012-bump-cudnn-frontend-to-v0.9.patch
new file mode 100644
index 000000000000..e564fdbfd185
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0012-bump-cudnn-frontend-to-v0.9.patch
@@ -0,0 +1,29 @@
+From 62c2fc13f69f6ae6a3315f59430018898b37b74f Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Wed, 29 Nov 2023 19:14:28 +0800
+Subject: [PATCH 12/12] bump cudnn frontend to v0.9
+
+---
+ tensorflow/workspace2.bzl | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
+index da9295adaba..86a3df2fe37 100644
+--- a/tensorflow/workspace2.bzl
++++ b/tensorflow/workspace2.bzl
+@@ -174,9 +174,9 @@ def _tf_repositories():
+ name = "cudnn_frontend_archive",
+ build_file = "//third_party:cudnn_frontend.BUILD",
+ patch_file = ["//third_party:cudnn_frontend_header_fix.patch"],
+- sha256 = "bfcf778030831f325cfc13ae5995388cc834fbff2995a297ba580d9ec65ca3b6",
+- strip_prefix = "cudnn-frontend-0.8",
+- urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.8.zip"),
++ sha256 = "d8dba9e2607a0c256aa8eacb45b39986ab6f3f24a4d431d4397047a3cb0cd4fb",
++ strip_prefix = "cudnn-frontend-0.9",
++ urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.9.zip"),
+ )
+
+ tf_http_archive(
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.13.0-0013-Fixing-build-issue-with-Clang-16-and-GCC-13.patch b/sci-libs/tensorflow/files/tensorflow-2.13.0-0013-Fixing-build-issue-with-Clang-16-and-GCC-13.patch
new file mode 100644
index 000000000000..9961d94cd48c
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.13.0-0013-Fixing-build-issue-with-Clang-16-and-GCC-13.patch
@@ -0,0 +1,39 @@
+From 9081d1ccadb7fcd3e2dd01106e85003af2fb7975 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Sun, 21 Jan 2024 00:26:21 +0800
+Subject: [PATCH 13/13] Fixing build issue with Clang 16 and GCC 13
+
+---
+ tensorflow/lite/kernels/internal/spectrogram.cc | 2 ++
+ tensorflow/tsl/lib/io/cache.h | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/tensorflow/lite/kernels/internal/spectrogram.cc b/tensorflow/lite/kernels/internal/spectrogram.cc
+index a832962a38d..9b1f86ba717 100644
+--- a/tensorflow/lite/kernels/internal/spectrogram.cc
++++ b/tensorflow/lite/kernels/internal/spectrogram.cc
+@@ -18,6 +18,8 @@ limitations under the License.
+ #include <assert.h>
+ #include <math.h>
+
++#include <cstdint>
++
+ #include "third_party/fft2d/fft.h"
+
+ namespace tflite {
+diff --git a/tensorflow/tsl/lib/io/cache.h b/tensorflow/tsl/lib/io/cache.h
+index f894c5916d5..e49d09b7450 100644
+--- a/tensorflow/tsl/lib/io/cache.h
++++ b/tensorflow/tsl/lib/io/cache.h
+@@ -16,6 +16,8 @@ limitations under the License.
+ #ifndef TENSORFLOW_TSL_LIB_IO_CACHE_H_
+ #define TENSORFLOW_TSL_LIB_IO_CACHE_H_
+
++#include <cstdint>
++
+ #include "tensorflow/tsl/platform/stringpiece.h"
+
+ // A Cache is an interface that maps keys to values. It has internal
+--
+2.43.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch
new file mode 100644
index 000000000000..9e93b3d5b8f3
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch
@@ -0,0 +1,37 @@
+From 0d3f532325cc39eb816e94e5bae259ea5a5a2304 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:34:44 +0800
+Subject: [PATCH 01/13] WORKSPACE: add rules-docker http_archive,
+ bazel-toolchains uses git_repo
+
+git_repository() rules cannot pull from --distdir and fail when building
+without internet access. Use http_archive instead and pin the sha256
+hash as well.
+---
+ WORKSPACE | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/WORKSPACE b/WORKSPACE
+index fb3af8a2bea..644b731b1dc 100644
+--- a/WORKSPACE
++++ b/WORKSPACE
+@@ -1,5 +1,16 @@
+ workspace(name = "org_tensorflow")
+
++load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
++
++http_archive(
++ name = "io_bazel_rules_docker",
++ sha256 = "7d453450e1eb70e238eea6b31f4115607ec1200e91afea01c25f9804f37e39c8",
++ strip_prefix = "rules_docker-0.10.0",
++ urls = [
++ "https://github.com/bazelbuild/rules_docker/releases/download/v0.10.0/rules_docker-v0.10.0.tar.gz",
++ ],
++)
++
+ # We must initialize hermetic python first.
+ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch
new file mode 100644
index 000000000000..5436744e1275
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch
@@ -0,0 +1,32 @@
+From 33b11df0767ead9a64a65e3ae19e329bba91dd75 Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Sun, 6 Feb 2022 00:13:56 -0800
+Subject: [PATCH 02/13] systemlib: Latest absl LTS has split cord libs
+
+---
+ third_party/absl/system.absl.strings.BUILD | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/third_party/absl/system.absl.strings.BUILD b/third_party/absl/system.absl.strings.BUILD
+index fa9a7a84f67..63bac99d71b 100644
+--- a/third_party/absl/system.absl.strings.BUILD
++++ b/third_party/absl/system.absl.strings.BUILD
+@@ -26,7 +26,14 @@ cc_library(
+
+ cc_library(
+ name = "cord",
+- linkopts = ["-labsl_cord"],
++ linkopts = [
++ "-labsl_cord",
++ "-labsl_cord_internal",
++ "-labsl_cordz_functions",
++ "-labsl_cordz_handle",
++ "-labsl_cordz_info",
++ "-labsl_cordz_sample_token",
++ ],
+ deps = [
+ ":str_format",
+ "//absl/container:compressed_tuple",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch
new file mode 100644
index 000000000000..8cff4a422ee3
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch
@@ -0,0 +1,29 @@
+From e098854ed15caa864b83033a1bc6b1aa7ca93a5c Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Mon, 5 Sep 2022 12:52:44 -0700
+Subject: [PATCH 03/13] mkl_dnn: Must link against libm for round and log2
+
+---
+ third_party/mkl_dnn/mkldnn_v1.BUILD | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/third_party/mkl_dnn/mkldnn_v1.BUILD b/third_party/mkl_dnn/mkldnn_v1.BUILD
+index 263c64eb681..f1860b1e7c3 100644
+--- a/third_party/mkl_dnn/mkldnn_v1.BUILD
++++ b/third_party/mkl_dnn/mkldnn_v1.BUILD
+@@ -165,9 +165,9 @@ cc_library(
+ includes = _INCLUDES_LIST,
+ # TODO(penpornk): Use lrt_if_needed from tensorflow.bzl instead.
+ linkopts = select({
+- "@org_tensorflow//tensorflow/tsl:linux_aarch64": ["-lrt"],
+- "@org_tensorflow//tensorflow/tsl:linux_x86_64": ["-lrt"],
+- "@org_tensorflow//tensorflow/tsl:linux_ppc64le": ["-lrt"],
++ "@org_tensorflow//tensorflow/tsl:linux_aarch64": ["-lrt", "-lm"],
++ "@org_tensorflow//tensorflow/tsl:linux_x86_64": ["-lrt", "-lm"],
++ "@org_tensorflow//tensorflow/tsl:linux_ppc64le": ["-lrt", "-lm"],
+ "//conditions:default": [],
+ }),
+ textual_hdrs = _TEXTUAL_HDRS_LIST,
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch
new file mode 100644
index 000000000000..0fa4d02d4c62
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch
@@ -0,0 +1,35 @@
+From e6645115b8a838b40a49c73cb948dc373c5e98c8 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:42:48 +0800
+Subject: [PATCH 04/13] tensorflow_cc: Add systemlib nsync linkopts
+
+Linkopts dont get propagated up to the shared library correctly so
+workaround by applying them directly
+---
+ tensorflow/BUILD | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tensorflow/BUILD b/tensorflow/BUILD
+index 202553cd531..63ce1e7b385 100644
+--- a/tensorflow/BUILD
++++ b/tensorflow/BUILD
+@@ -39,6 +39,7 @@ load(
+ "tf_cc_shared_library",
+ )
+ load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
++load("@local_config_syslibs//:build_defs.bzl", "if_system_lib")
+
+ # copybara:uncomment_begin
+ # load("//devtools/copybara/rules:copybara.bzl", "copybara_config_test")
+@@ -1312,7 +1313,7 @@ tf_cc_shared_library(
+ "-z defs",
+ "-Wl,--version-script,$(location //tensorflow:tf_version_script.lds)",
+ ],
+- }),
++ }) + if_system_lib("nsync", ["-lnsync_cpp"]),
+ per_os_targets = True,
+ roots = [
+ "//tensorflow/c:c_api",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch
new file mode 100644
index 000000000000..7dadd35bc2b7
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch
@@ -0,0 +1,71 @@
+From c390554addb171439310c00dce2972539ac0e71d Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Tue, 30 May 2023 09:10:03 -0700
+Subject: [PATCH 05/13] systemlib: Updates for Abseil 20220623 LTS
+
+These targets are header-only and just need stub bazel targets
+---
+ third_party/absl/system.absl.functional.BUILD | 22 +++++++++++++++++++
+ third_party/absl/system.absl.random.BUILD | 12 ++++++++++
+ 2 files changed, 34 insertions(+)
+
+diff --git a/third_party/absl/system.absl.functional.BUILD b/third_party/absl/system.absl.functional.BUILD
+index a4f70acf35c..579181dec07 100644
+--- a/third_party/absl/system.absl.functional.BUILD
++++ b/third_party/absl/system.absl.functional.BUILD
+@@ -2,10 +2,32 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
+
+ package(default_visibility = ["//visibility:public"])
+
++cc_library(
++ name = "any_invocable",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/meta:type_traits",
++ "//absl/utility",
++ ],
++)
++
+ cc_library(
+ name = "bind_front",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/container:compressed_tuple",
++ "//absl/meta:type_traits",
++ "//absl/utility",
++ ],
+ )
+
+ cc_library(
+ name = "function_ref",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/base:core_headers",
++ "//absl/meta:type_traits",
++ ],
+ )
+diff --git a/third_party/absl/system.absl.random.BUILD b/third_party/absl/system.absl.random.BUILD
+index 948de07751a..5ebd656be8e 100644
+--- a/third_party/absl/system.absl.random.BUILD
++++ b/third_party/absl/system.absl.random.BUILD
+@@ -51,3 +51,15 @@ cc_library(
+ "//absl/types:span",
+ ],
+ )
++
++cc_library(
++ name = "bit_gen_ref",
++ deps = [
++ ":random",
++ "//absl/base:core_headers",
++ "//absl/base:fast_type_id",
++ "//absl/meta:type_traits",
++ "//absl/random/internal:distribution_caller",
++ "//absl/random/internal:fast_uniform_bits",
++ ],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0006-systemlib-Update-targets-for-absl_py.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0006-systemlib-Update-targets-for-absl_py.patch
new file mode 100644
index 000000000000..fa021358998c
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0006-systemlib-Update-targets-for-absl_py.patch
@@ -0,0 +1,24 @@
+From d2dc4d308a83cb2d1620e7c5213ec570fe3138af Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:48:15 +0800
+Subject: [PATCH 06/13] systemlib: Update targets for absl_py
+
+---
+ third_party/systemlibs/absl_py.absl.flags.BUILD | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/third_party/systemlibs/absl_py.absl.flags.BUILD b/third_party/systemlibs/absl_py.absl.flags.BUILD
+index d92f4949df1..614938fb8c4 100644
+--- a/third_party/systemlibs/absl_py.absl.flags.BUILD
++++ b/third_party/systemlibs/absl_py.absl.flags.BUILD
+@@ -8,4 +8,7 @@ py_library(
+
+ py_library(
+ name = "argparse_flags",
++ deps = [
++ ":flags",
++ ],
+ )
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0007-systemlib-Add-well_known_types_py_pb2-target.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0007-systemlib-Add-well_known_types_py_pb2-target.patch
new file mode 100644
index 000000000000..655be6bc919f
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0007-systemlib-Add-well_known_types_py_pb2-target.patch
@@ -0,0 +1,28 @@
+From e58f5674af07a3853e59c32b92d91e590b0224e2 Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Sat, 3 Jun 2023 16:23:51 -0700
+Subject: [PATCH 07/13] systemlib: Add well_known_types_py_pb2 target
+
+Bug: https://github.com/tensorflow/tensorflow/issues/60667
+---
+ third_party/systemlibs/protobuf.BUILD | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
+index 4d05ab28d12..b3d72b0e3ad 100644
+--- a/third_party/systemlibs/protobuf.BUILD
++++ b/third_party/systemlibs/protobuf.BUILD
+@@ -111,3 +111,10 @@ py_library(
+ visibility = ["//visibility:public"],
+ deps = [dep + "_proto" for dep in proto[1][1]],
+ ) for proto in WELL_KNOWN_PROTO_MAP.items()]
++
++py_proto_library(
++ name = "well_known_types_py_pb2",
++ include = ".",
++ srcs = [proto[1][0] for proto in WELL_KNOWN_PROTO_MAP.items()],
++ visibility = ["//visibility:public"],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0008-Relax-setup.py-version-requirements.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0008-Relax-setup.py-version-requirements.patch
new file mode 100644
index 000000000000..5d1667d75e11
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0008-Relax-setup.py-version-requirements.patch
@@ -0,0 +1,38 @@
+From e6cecad5c2595cb1166a78b698377f12da6e7a09 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:54:18 +0800
+Subject: [PATCH 08/13] Relax setup.py version requirements
+
+---
+ tensorflow/tools/pip_package/setup.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py
+index fdb718d1628..3897d5316ba 100644
+--- a/tensorflow/tools/pip_package/setup.py
++++ b/tensorflow/tools/pip_package/setup.py
+@@ -101,8 +101,8 @@ REQUIRED_PACKAGES = [
+ 'six >= 1.12.0',
+ 'termcolor >= 1.1.0',
+ 'typing_extensions >= 3.6.6',
+- 'wrapt >= 1.11.0, < 1.15',
+- 'tensorflow-io-gcs-filesystem >= 0.23.1',
++ 'wrapt >= 1.11.0',
++ # 'tensorflow-io-gcs-filesystem >= 0.23.1',
+ # grpcio does not build correctly on big-endian machines due to lack of
+ # BoringSSL support.
+ # See https://github.com/tensorflow/tensorflow/issues/17882.
+@@ -140,8 +140,8 @@ FAKE_REQUIRED_PACKAGES = [
+ _VERSION + ';platform_system=="Windows"',
+ ]
+
+-if platform.system() == 'Linux' and platform.machine() == 'x86_64':
+- REQUIRED_PACKAGES.append(FAKE_REQUIRED_PACKAGES)
++# if platform.system() == 'Linux' and platform.machine() == 'x86_64':
++# REQUIRED_PACKAGES.append(FAKE_REQUIRED_PACKAGES)
+
+ if collaborator_build:
+ # If this is a collaborator build, then build an "installer" wheel and
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0009-systemlib-update-targets-for-absl.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0009-systemlib-update-targets-for-absl.patch
new file mode 100644
index 000000000000..6b946461fba6
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0009-systemlib-update-targets-for-absl.patch
@@ -0,0 +1,365 @@
+From 1a72b50ed5054cb025c0aa2a39ce2499417f2d76 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Sun, 26 Nov 2023 13:12:20 +0800
+Subject: [PATCH 09/13] systemlib: update targets for absl
+
+---
+ .../compiler/mlir/tools/kernel_gen/BUILD | 1 +
+ .../distribute/experimental/rpc/kernels/BUILD | 1 +
+ third_party/absl/system.absl.debugging.BUILD | 20 +-
+ third_party/absl/system.absl.log.BUILD | 271 ++++++++++++++++++
+ third_party/absl/workspace.bzl | 1 +
+ 5 files changed, 289 insertions(+), 5 deletions(-)
+ create mode 100644 third_party/absl/system.absl.log.BUILD
+
+diff --git a/tensorflow/compiler/mlir/tools/kernel_gen/BUILD b/tensorflow/compiler/mlir/tools/kernel_gen/BUILD
+index 71d85d2c96e..f4a479a9daf 100644
+--- a/tensorflow/compiler/mlir/tools/kernel_gen/BUILD
++++ b/tensorflow/compiler/mlir/tools/kernel_gen/BUILD
+@@ -107,6 +107,7 @@ tf_cc_binary(
+ "//tensorflow/compiler/mlir:init_mlir",
+ "//tensorflow/compiler/mlir/tensorflow",
+ "//tensorflow/core:lib",
++ "@com_google_absl//absl/log:check",
+ "@com_google_absl//absl/strings",
+ "@llvm-project//llvm:AArch64CodeGen", # fixdeps: keep
+ "@llvm-project//llvm:ARMCodeGen", # fixdeps: keep
+diff --git a/tensorflow/distribute/experimental/rpc/kernels/BUILD b/tensorflow/distribute/experimental/rpc/kernels/BUILD
+index f9a525364c5..8b7f7b54761 100644
+--- a/tensorflow/distribute/experimental/rpc/kernels/BUILD
++++ b/tensorflow/distribute/experimental/rpc/kernels/BUILD
+@@ -65,6 +65,7 @@ tf_kernel_library(
+ "//tensorflow/distribute/experimental/rpc/proto:tf_rpc_service_proto_cc",
+ "@com_github_grpc_grpc//:grpc++",
+ "@com_google_absl//absl/status",
++ "@com_google_absl//absl/log:check",
+ "@com_google_absl//absl/strings",
+ "@com_google_absl//absl/strings:str_format",
+ ],
+diff --git a/third_party/absl/system.absl.debugging.BUILD b/third_party/absl/system.absl.debugging.BUILD
+index 931ffdc9e92..223db7b4c46 100644
+--- a/third_party/absl/system.absl.debugging.BUILD
++++ b/third_party/absl/system.absl.debugging.BUILD
+@@ -26,15 +26,25 @@ cc_library(
+
+ cc_library(
+ name = "failure_signal_handler",
+- linkopts = [
+- "-labsl_failure_signal_handler",
+- "-labsl_examine_stack",
++ linkopts = ["-labsl_failure_signal_handler"],
++ deps = [
++ ":examine_stack",
++ ":stacktrace",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
+ ],
++)
++
++cc_library(
++ name = "examine_stack",
++ linkopts = ["-labsl_examine_stack"],
+ deps = [
+ ":stacktrace",
+ ":symbolize",
+- "//absl/base",
+- "//absl/base:errno_saver",
++ "//absl/base:config",
++ "//absl/base:core_headers",
+ "//absl/base:raw_logging_internal",
+ ],
+ )
+diff --git a/third_party/absl/system.absl.log.BUILD b/third_party/absl/system.absl.log.BUILD
+new file mode 100644
+index 00000000000..9a2a5de657e
+--- /dev/null
++++ b/third_party/absl/system.absl.log.BUILD
+@@ -0,0 +1,271 @@
++load("@rules_cc//cc:defs.bzl", "cc_library")
++
++package(default_visibility = ["//visibility:public"])
++
++cc_library(
++ name = "log",
++ deps = [
++ "//absl/log:internal_log_impl",
++ ],
++)
++
++cc_library(
++ name = "internal_log_impl",
++ deps = [
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ ],
++)
++
++cc_library(
++ name = "internal_conditions",
++ linkopts = ["-labsl_log_internal_conditions"],
++ deps = [
++ ":internal_voidify",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_voidify",
++ deps = ["//absl/base:config"],
++)
++
++cc_library(
++ name = "internal_message",
++ linkopts = ["-labsl_log_internal_message"],
++ deps = [
++ ":entry",
++ ":globals",
++ ":internal_append_truncated",
++ ":internal_format",
++ ":internal_globals",
++ ":internal_log_sink_set",
++ ":internal_nullguard",
++ ":internal_proto",
++ ":severity",
++ ":sink",
++ ":sink_registry",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:errno_saver",
++ "//absl/base:raw_logging_internal",
++ "//absl/base:strerror",
++ "//absl/container:inlined_vector",
++ "//absl/debugging:examine_stack",
++ "//absl/memory",
++ "//absl/strings",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_append_truncated",
++ deps = [
++ "//absl/base:config",
++ "//absl/strings",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_format",
++ linkopts = ["-labsl_log_internal_format"],
++ deps = [
++ ":internal_append_truncated",
++ ":internal_config",
++ ":internal_globals",
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/strings:str_format",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_globals",
++ linkopts = ["-labsl_log_internal_globals"],
++ deps = [
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/strings",
++ "//absl/time",
++ ],
++)
++
++cc_library(
++ name = "internal_proto",
++ linkopts = ["-labsl_log_internal_proto"],
++ deps = [
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_log_sink_set",
++ linkopts = ["-labsl_log_internal_log_sink_set"],
++ deps = [
++ ":entry",
++ ":globals",
++ ":internal_config",
++ ":internal_globals",
++ ":severity",
++ ":sink",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/cleanup",
++ "//absl/strings",
++ "//absl/synchronization",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_config",
++ deps = [
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_nullguard",
++ linkopts = ["-labsl_log_internal_nullguard"],
++ deps = [
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "globals",
++ linkopts = ["-labsl_log_globals"],
++ deps = [
++ ":severity",
++ "//absl/base:atomic_hook",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/hash",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "entry",
++ linkopts = ["-labsl_log_entry"],
++ deps = [
++ ":internal_config",
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "severity",
++ linkopts = ["-labsl_log_severity"],
++ deps = ["//absl/base:core_headers"],
++)
++
++cc_library(
++ name = "sink",
++ linkopts = ["-labsl_log_sink"],
++ deps = [
++ ":entry",
++ "//absl/base:config",
++ ],
++)
++
++cc_library(
++ name = "sink_registry",
++ deps = [
++ ":internal_log_sink_set",
++ ":sink",
++ "//absl/base:config",
++ ],
++)
++
++cc_library(
++ name = "internal_strip",
++ deps = [
++ ":internal_message",
++ ":internal_nullstream",
++ ":severity",
++ ],
++)
++
++cc_library(
++ name = "internal_nullstream",
++ deps = [
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "check",
++ deps = [
++ ":internal_check_impl",
++ ":internal_check_op",
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_check_impl",
++ deps = [
++ ":internal_check_op",
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_check_op",
++ linkopts = ["-labsl_log_internal_check_op"],
++ deps = [
++ ":internal_nullguard",
++ ":internal_nullstream",
++ ":internal_strip",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "absl_check",
++ deps = [":internal_check_impl"],
++)
++
++cc_library(
++ name = "absl_log",
++ deps = [":internal_log_impl"],
++)
+diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl
+index 07f49cebb78..a7f4e5ffc44 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",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0010-systemlib-fix-missing-osx-in-pybind11.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0010-systemlib-fix-missing-osx-in-pybind11.patch
new file mode 100644
index 000000000000..24b7cf4eec90
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0010-systemlib-fix-missing-osx-in-pybind11.patch
@@ -0,0 +1,25 @@
+From ce5e7c9b7f0a667514a65dc58ca67b61fa591c8f Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Thu, 21 Dec 2023 22:22:35 +0800
+Subject: [PATCH 10/13] systemlib: fix missing `:osx` in pybind11
+
+---
+ third_party/systemlibs/pybind11.BUILD | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/third_party/systemlibs/pybind11.BUILD b/third_party/systemlibs/pybind11.BUILD
+index 79a483d7b5d..cda63fbd019 100644
+--- a/third_party/systemlibs/pybind11.BUILD
++++ b/third_party/systemlibs/pybind11.BUILD
+@@ -6,3 +6,8 @@ cc_library(
+ "@org_tensorflow//third_party/python_runtime:headers",
+ ],
+ )
++
++config_setting(
++ name = "osx",
++ constraint_values = ["@platforms//os:osx"],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch
new file mode 100644
index 000000000000..acd46106115f
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch
@@ -0,0 +1,25 @@
+From 084723bca84ba51f7f67209618b5a4e064c1576a Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Thu, 21 Dec 2023 22:24:24 +0800
+Subject: [PATCH 11/13] systemlib: fix missing `LICENSE` in flatbuffers
+
+---
+ third_party/flatbuffers/BUILD.system | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/third_party/flatbuffers/BUILD.system b/third_party/flatbuffers/BUILD.system
+index 8fe4d7a5907..b1d63b4ca0f 100644
+--- a/third_party/flatbuffers/BUILD.system
++++ b/third_party/flatbuffers/BUILD.system
+@@ -1,7 +1,7 @@
+ licenses(["notice"]) # Apache 2.0
+
+ filegroup(
+- name = "LICENSE.txt",
++ name = "LICENSE",
+ visibility = ["//visibility:public"],
+ )
+
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0012-build-use-non-hermetic-python.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0012-build-use-non-hermetic-python.patch
new file mode 100644
index 000000000000..67108a290e13
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0012-build-use-non-hermetic-python.patch
@@ -0,0 +1,2745 @@
+From 3f0e4685b47f71c80b18bc5b6cba1afd56070604 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Thu, 21 Dec 2023 22:25:46 +0800
+Subject: [PATCH 12/13] build: use non-hermetic python
+
+---
+ WORKSPACE | 65 --
+ tensorflow/BUILD | 2 -
+ tensorflow/compiler/mlir/glob_lit_test.bzl | 1 -
+ tensorflow/compiler/xla/glob_lit_test.bzl | 5 -
+ tensorflow/compiler/xla/mlir_hlo/tests/BUILD | 1 -
+ tensorflow/dtensor/python/tests/BUILD | 1 -
+ tensorflow/lite/python/BUILD | 1 -
+ tensorflow/python/BUILD | 1 -
+ tensorflow/python/compiler/tensorrt/BUILD | 1 -
+ .../experimental/kernel_tests/service/BUILD | 1 -
+ tensorflow/python/debug/lib/BUILD | 1 -
+ .../python/distribute/experimental/rpc/BUILD | 1 -
+ .../python/distribute/failure_handling/BUILD | 1 -
+ tensorflow/python/eager/BUILD | 1 -
+ tensorflow/python/estimator/BUILD | 5 +-
+ tensorflow/python/framework/BUILD | 2 -
+ tensorflow/python/keras/BUILD | 1 -
+ tensorflow/python/keras/engine/BUILD | 1 -
+ tensorflow/python/keras/saving/BUILD | 1 -
+ tensorflow/python/profiler/BUILD | 1 -
+ .../python/profiler/integration_test/BUILD | 1 -
+ tensorflow/python/summary/BUILD | 1 -
+ third_party/py/BUILD.tpl | 39 +-
+ third_party/py/{non_hermetic => }/README | 0
+ third_party/py/non_hermetic/BUILD | 0
+ third_party/py/non_hermetic/BUILD.tpl | 80 --
+ third_party/py/non_hermetic/ml_dtypes/BUILD | 0
+ third_party/py/non_hermetic/ml_dtypes/LICENSE | 202 ----
+ .../py/non_hermetic/ml_dtypes/ml_dtypes.BUILD | 50 -
+ .../ml_dtypes/ml_dtypes.tests.BUILD | 60 --
+ .../py/non_hermetic/ml_dtypes/workspace.bzl | 22 -
+ third_party/py/non_hermetic/numpy/BUILD | 21 -
+ third_party/py/non_hermetic/numpy/README.md | 4 -
+ .../py/non_hermetic/numpy/tf_numpy_api/BUILD | 12 -
+ ...ensorflow.experimental.numpy.ndarray.pbtxt | 51 -
+ .../tensorflow.experimental.numpy.pbtxt | 919 ------------------
+ ...tensorflow.experimental.numpy.random.pbtxt | 35 -
+ .../py/non_hermetic/python_configure.bzl | 315 ------
+ third_party/py/numpy/BUILD | 7 +-
+ third_party/py/numpy/LICENSE | 60 --
+ .../tensorflow.experimental.numpy.pbtxt | 2 +-
+ third_party/py/python_configure.bzl | 252 ++++-
+ 42 files changed, 291 insertions(+), 1936 deletions(-)
+ rename third_party/py/{non_hermetic => }/README (100%)
+ delete mode 100644 third_party/py/non_hermetic/BUILD
+ delete mode 100644 third_party/py/non_hermetic/BUILD.tpl
+ delete mode 100644 third_party/py/non_hermetic/ml_dtypes/BUILD
+ delete mode 100644 third_party/py/non_hermetic/ml_dtypes/LICENSE
+ delete mode 100644 third_party/py/non_hermetic/ml_dtypes/ml_dtypes.BUILD
+ delete mode 100644 third_party/py/non_hermetic/ml_dtypes/ml_dtypes.tests.BUILD
+ delete mode 100644 third_party/py/non_hermetic/ml_dtypes/workspace.bzl
+ delete mode 100644 third_party/py/non_hermetic/numpy/BUILD
+ delete mode 100644 third_party/py/non_hermetic/numpy/README.md
+ delete mode 100644 third_party/py/non_hermetic/numpy/tf_numpy_api/BUILD
+ delete mode 100644 third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.ndarray.pbtxt
+ delete mode 100644 third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt
+ delete mode 100644 third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.random.pbtxt
+ delete mode 100644 third_party/py/non_hermetic/python_configure.bzl
+ delete mode 100644 third_party/py/numpy/LICENSE
+
+diff --git a/WORKSPACE b/WORKSPACE
+index 644b731b1dc..3626ae4e805 100644
+--- a/WORKSPACE
++++ b/WORKSPACE
+@@ -11,71 +11,6 @@ http_archive(
+ ],
+ )
+
+-# We must initialize hermetic python first.
+-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+-
+-http_archive(
+- name = "bazel_skylib",
+- sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
+- urls = [
+- "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
+- "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
+- ],
+-)
+-
+-http_archive(
+- name = "rules_python",
+- sha256 = "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841",
+- strip_prefix = "rules_python-0.23.1",
+- url = "https://github.com/bazelbuild/rules_python/releases/download/0.23.1/rules_python-0.23.1.tar.gz",
+-)
+-
+-load("@rules_python//python:repositories.bzl", "python_register_toolchains")
+-load(
+- "//tensorflow/tools/toolchains/python:python_repo.bzl",
+- "python_repository",
+-)
+-
+-python_repository(name = "python_version_repo")
+-
+-load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION")
+-
+-python_register_toolchains(
+- name = "python",
+- ignore_root_user_error = True,
+- python_version = HERMETIC_PYTHON_VERSION,
+-)
+-
+-load("@python//:defs.bzl", "interpreter")
+-load("@rules_python//python:pip.bzl", "package_annotation", "pip_parse")
+-
+-NUMPY_ANNOTATIONS = {
+- "numpy": package_annotation(
+- additive_build_content = """\
+-filegroup(
+- name = "includes",
+- srcs = glob(["site-packages/numpy/core/include/**/*.h"]),
+-)
+-cc_library(
+- name = "numpy_headers",
+- hdrs = [":includes"],
+- strip_include_prefix="site-packages/numpy/core/include/",
+-)
+-""",
+- ),
+-}
+-
+-pip_parse(
+- name = "pypi",
+- annotations = NUMPY_ANNOTATIONS,
+- python_interpreter_target = interpreter,
+- requirements = "//:requirements_lock_" + HERMETIC_PYTHON_VERSION.replace(".", "_") + ".txt",
+-)
+-
+-load("@pypi//:requirements.bzl", "install_deps")
+-
+-install_deps()
+-
+ # Initialize the TensorFlow repository and all dependencies.
+ #
+ # The cascade of load() statements and tf_workspace?() calls works around the
+diff --git a/tensorflow/BUILD b/tensorflow/BUILD
+index 63ce1e7b385..9573a982298 100644
+--- a/tensorflow/BUILD
++++ b/tensorflow/BUILD
+@@ -1718,8 +1718,6 @@ py_library(
+ "//tensorflow/lite/python:lite",
+ "//tensorflow/lite/python/authoring",
+ "//tensorflow/python:no_contrib",
+- "@pypi_keras//:pkg",
+- "@pypi_tensorboard//:pkg",
+ ],
+ )
+ # copybara:comment_end
+diff --git a/tensorflow/compiler/mlir/glob_lit_test.bzl b/tensorflow/compiler/mlir/glob_lit_test.bzl
+index e689b4c0b31..f65c86b727b 100644
+--- a/tensorflow/compiler/mlir/glob_lit_test.bzl
++++ b/tensorflow/compiler/mlir/glob_lit_test.bzl
+@@ -58,7 +58,6 @@ def _run_lit_test(name, data, size, tags, driver, features, exec_properties):
+ "@llvm-project//llvm:count",
+ "@llvm-project//llvm:not",
+ ],
+- deps = ["@pypi_lit//:pkg"],
+ size = size,
+ main = "lit.py",
+ exec_properties = exec_properties,
+diff --git a/tensorflow/compiler/xla/glob_lit_test.bzl b/tensorflow/compiler/xla/glob_lit_test.bzl
+index 44b838ccb0a..86200b24da1 100644
+--- a/tensorflow/compiler/xla/glob_lit_test.bzl
++++ b/tensorflow/compiler/xla/glob_lit_test.bzl
+@@ -52,10 +52,6 @@ def _run_lit_test(name, data, size, tags, driver, features, exec_properties):
+ # can remove this logic. This is necessary to have these tests run on builds
+ # using Python 3.11, but also to not include `@pypi_lit` in standalone xla
+ # builds where it won't be found.
+- deps = []
+- if xla_root_dir == "tensorflow/compiler/xla/":
+- deps.append("@pypi_lit//:pkg")
+-
+ native.py_test(
+ name = name,
+ srcs = ["@llvm-project//llvm:lit"],
+@@ -69,7 +65,6 @@ def _run_lit_test(name, data, size, tags, driver, features, exec_properties):
+ "@llvm-project//llvm:count",
+ "@llvm-project//llvm:not",
+ ],
+- deps = deps,
+ size = size,
+ main = "lit.py",
+ exec_properties = exec_properties,
+diff --git a/tensorflow/compiler/xla/mlir_hlo/tests/BUILD b/tensorflow/compiler/xla/mlir_hlo/tests/BUILD
+index 3b67c8fdbec..30a3c562f75 100644
+--- a/tensorflow/compiler/xla/mlir_hlo/tests/BUILD
++++ b/tensorflow/compiler/xla/mlir_hlo/tests/BUILD
+@@ -26,7 +26,6 @@ package(
+ tags = [
+ "nomsan", # The execution engine doesn't work with msan, see b/248097619.
+ ],
+- deps = ["@pypi_lit//:pkg"],
+ )
+ for src in glob(["**/*.mlir"])
+ ]
+diff --git a/tensorflow/dtensor/python/tests/BUILD b/tensorflow/dtensor/python/tests/BUILD
+index 615baad3085..9b6c5839b03 100644
+--- a/tensorflow/dtensor/python/tests/BUILD
++++ b/tensorflow/dtensor/python/tests/BUILD
+@@ -303,7 +303,6 @@ pytype_strict_library(
+ ":test_util",
+ "//tensorflow/python/platform:client_testlib",
+ "@absl_py//absl/flags",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/lite/python/BUILD b/tensorflow/lite/python/BUILD
+index cf03dad0ee0..8b771ac20ae 100644
+--- a/tensorflow/lite/python/BUILD
++++ b/tensorflow/lite/python/BUILD
+@@ -266,7 +266,6 @@ py_test(
+ "//tensorflow/python/framework:test_lib",
+ "//tensorflow/python/platform:client_testlib",
+ "//tensorflow/python/platform:resource_loader",
+- "@pypi_jax//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
+index c1b7eb7c0ea..4093f4c5c09 100644
+--- a/tensorflow/python/BUILD
++++ b/tensorflow/python/BUILD
+@@ -550,7 +550,6 @@ py_strict_library(
+ deps = [
+ ":keras_lib",
+ "//third_party/py/numpy",
+- "@pypi_scipy//:pkg",
+ "@six_archive//:six",
+ ],
+ )
+diff --git a/tensorflow/python/compiler/tensorrt/BUILD b/tensorflow/python/compiler/tensorrt/BUILD
+index f3fd845ff53..78a45f4ed25 100644
+--- a/tensorflow/python/compiler/tensorrt/BUILD
++++ b/tensorflow/python/compiler/tensorrt/BUILD
+@@ -69,7 +69,6 @@ py_strict_library(
+ "//tensorflow/python/util:nest",
+ "//tensorflow/python/util:tf_export",
+ "//third_party/py/numpy",
+- "@pypi_packaging//:pkg",
+ "@six_archive//:six",
+ ],
+ )
+diff --git a/tensorflow/python/data/experimental/kernel_tests/service/BUILD b/tensorflow/python/data/experimental/kernel_tests/service/BUILD
+index 8d36d2e3637..2b8a8fd3654 100644
+--- a/tensorflow/python/data/experimental/kernel_tests/service/BUILD
++++ b/tensorflow/python/data/experimental/kernel_tests/service/BUILD
+@@ -143,7 +143,6 @@ tf_py_strict_test(
+ "//tensorflow/python/ops:array_ops",
+ "//tensorflow/python/platform:client_testlib",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/debug/lib/BUILD b/tensorflow/python/debug/lib/BUILD
+index 37c99b30dd2..012e349dffc 100644
+--- a/tensorflow/python/debug/lib/BUILD
++++ b/tensorflow/python/debug/lib/BUILD
+@@ -596,7 +596,6 @@ py_strict_library(
+ "//tensorflow/python/lib/io:lib",
+ "//tensorflow/python/ops:variables",
+ "//tensorflow/python/util:compat",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/distribute/experimental/rpc/BUILD b/tensorflow/python/distribute/experimental/rpc/BUILD
+index 94855205c70..3b3e3f9aee3 100644
+--- a/tensorflow/python/distribute/experimental/rpc/BUILD
++++ b/tensorflow/python/distribute/experimental/rpc/BUILD
+@@ -60,6 +60,5 @@ tf_py_strict_test(
+ "//tensorflow/python/ops:variables",
+ "//tensorflow/python/platform:client_testlib",
+ "//tensorflow/python/util:nest",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/distribute/failure_handling/BUILD b/tensorflow/python/distribute/failure_handling/BUILD
+index 77317019fee..df52d80552e 100644
+--- a/tensorflow/python/distribute/failure_handling/BUILD
++++ b/tensorflow/python/distribute/failure_handling/BUILD
+@@ -47,7 +47,6 @@ py_strict_library(
+ deps = [
+ "//tensorflow/python/eager:context",
+ "//tensorflow/python/platform:tf_logging",
+- "@pypi_requests//:pkg",
+ "@six_archive//:six",
+ ],
+ )
+diff --git a/tensorflow/python/eager/BUILD b/tensorflow/python/eager/BUILD
+index b7bc8350e13..dc5e0ae232f 100644
+--- a/tensorflow/python/eager/BUILD
++++ b/tensorflow/python/eager/BUILD
+@@ -1167,7 +1167,6 @@ cuda_py_strict_test(
+ "//tensorflow/python/training:server_lib",
+ "//tensorflow/python/util:compat",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/estimator/BUILD b/tensorflow/python/estimator/BUILD
+index 73a7c2626bb..0952ccb3154 100644
+--- a/tensorflow/python/estimator/BUILD
++++ b/tensorflow/python/estimator/BUILD
+@@ -380,7 +380,8 @@ py_library(
+ ],
+ )
+
+-alias(
++py_library(
+ name = "expect_tensorflow_estimator_installed",
+- actual = "@pypi_tensorflow_estimator//:pkg",
++ srcs_version = "PY3",
++ visibility = ["//visibility:public"],
+ )
+diff --git a/tensorflow/python/framework/BUILD b/tensorflow/python/framework/BUILD
+index d8ce1f5c0bf..1100c23b562 100644
+--- a/tensorflow/python/framework/BUILD
++++ b/tensorflow/python/framework/BUILD
+@@ -359,7 +359,6 @@ py_strict_library(
+ "//tensorflow/python/util:deprecation",
+ "//tensorflow/python/util:tf_export",
+ "//third_party/py/numpy",
+- "@pypi_packaging//:pkg",
+ ] + if_xla_available([
+ "//tensorflow/python:_pywrap_tfcompile",
+ ]),
+@@ -2036,7 +2035,6 @@ py_strict_library(
+ "//tensorflow/python/util/protobuf",
+ "//third_party/py/numpy",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/keras/BUILD b/tensorflow/python/keras/BUILD
+index c271a5ef77a..d516853a13e 100755
+--- a/tensorflow/python/keras/BUILD
++++ b/tensorflow/python/keras/BUILD
+@@ -42,7 +42,6 @@ py_library(
+ "//tensorflow/python/saved_model",
+ "//tensorflow/python/training",
+ "//tensorflow/python/util:nest",
+- "@pypi_h5py//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/keras/engine/BUILD b/tensorflow/python/keras/engine/BUILD
+index 2098b1650bc..287b1a4aa91 100644
+--- a/tensorflow/python/keras/engine/BUILD
++++ b/tensorflow/python/keras/engine/BUILD
+@@ -93,7 +93,6 @@ py_library(
+ "//tensorflow/python/util:tf_decorator",
+ "//tensorflow/python/util:tf_export",
+ "//tensorflow/tools/docs:doc_controls",
+- "@pypi_h5py//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/keras/saving/BUILD b/tensorflow/python/keras/saving/BUILD
+index d7cb2ccb2fc..b40d979c82d 100644
+--- a/tensorflow/python/keras/saving/BUILD
++++ b/tensorflow/python/keras/saving/BUILD
+@@ -53,6 +53,5 @@ py_library(
+ "//tensorflow/python/platform:tf_logging",
+ "//tensorflow/python/saved_model",
+ "//tensorflow/python/training:saver",
+- "@pypi_h5py//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/profiler/BUILD b/tensorflow/python/profiler/BUILD
+index b1cfd6ea10c..9413aeeab8b 100644
+--- a/tensorflow/python/profiler/BUILD
++++ b/tensorflow/python/profiler/BUILD
+@@ -43,7 +43,6 @@ cuda_py_strict_test(
+ "//tensorflow/python/eager:test",
+ "//tensorflow/python/framework:errors",
+ "//tensorflow/python/framework:test_lib",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/profiler/integration_test/BUILD b/tensorflow/python/profiler/integration_test/BUILD
+index b20698ea6ea..e7060e5a315 100644
+--- a/tensorflow/python/profiler/integration_test/BUILD
++++ b/tensorflow/python/profiler/integration_test/BUILD
+@@ -35,6 +35,5 @@ cuda_py_strict_test(
+ "//tensorflow/python/platform:tf_logging",
+ "//tensorflow/python/profiler:profiler_client",
+ "//tensorflow/python/profiler:profiler_v2",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/summary/BUILD b/tensorflow/python/summary/BUILD
+index 126fb6d31f7..b292e39356f 100644
+--- a/tensorflow/python/summary/BUILD
++++ b/tensorflow/python/summary/BUILD
+@@ -121,6 +121,5 @@ tf_py_strict_test(
+ "//tensorflow/python/ops:summary_ops_v2",
+ "//tensorflow/python/platform:client_testlib",
+ "//tensorflow/python/training:training_util",
+- "@pypi_tensorboard//:pkg",
+ ],
+ )
+diff --git a/third_party/py/BUILD.tpl b/third_party/py/BUILD.tpl
+index 7cc1e085684..45480bd4a31 100644
+--- a/third_party/py/BUILD.tpl
++++ b/third_party/py/BUILD.tpl
+@@ -5,17 +5,16 @@ package(default_visibility = ["//visibility:public"])
+ # Point both runtimes to the same python binary to ensure we always
+ # use the python binary specified by ./configure.py script.
+ load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
+-load("@python//:defs.bzl", "interpreter")
+
+ py_runtime(
+ name = "py2_runtime",
+- interpreter_path = interpreter,
++ interpreter_path = "%{PYTHON_BIN_PATH}",
+ python_version = "PY2",
+ )
+
+ py_runtime(
+ name = "py3_runtime",
+- interpreter_path = interpreter,
++ interpreter_path = "%{PYTHON_BIN_PATH}",
+ python_version = "PY3",
+ )
+
+@@ -33,8 +32,27 @@ toolchain(
+ exec_compatible_with = [%{PLATFORM_CONSTRAINT}],
+ )
+
+-alias(name = "python_headers",
+- actual = "@python//:python_headers")
++# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib
++# See https://docs.python.org/3/extending/windows.html
++cc_import(
++ name = "python_lib",
++ interface_library = select({
++ ":windows": ":python_import_lib",
++ # A placeholder for Unix platforms which makes --no_build happy.
++ "//conditions:default": "not-existing.lib",
++ }),
++ system_provided = 1,
++)
++
++cc_library(
++ name = "python_headers",
++ hdrs = [":python_include"],
++ deps = select({
++ ":windows": [":python_lib"],
++ "//conditions:default": [],
++ }),
++ includes = ["python_include"],
++)
+
+ # This alias is exists for the use of targets in the @llvm-project dependency,
+ # which expect a python_headers target called @python_runtime//:headers. We use
+@@ -45,9 +63,18 @@ alias(
+ actual = ":python_headers",
+ )
+
++cc_library(
++ name = "numpy_headers",
++ hdrs = [":numpy_include"],
++ includes = ["numpy_include"],
++)
+
+ config_setting(
+ name = "windows",
+ values = {"cpu": "x64_windows"},
+ visibility = ["//visibility:public"],
+-)
+\ No newline at end of file
++)
++
++%{PYTHON_INCLUDE_GENRULE}
++%{NUMPY_INCLUDE_GENRULE}
++%{PYTHON_IMPORT_LIB_GENRULE}
+\ No newline at end of file
+diff --git a/third_party/py/non_hermetic/README b/third_party/py/README
+similarity index 100%
+rename from third_party/py/non_hermetic/README
+rename to third_party/py/README
+diff --git a/third_party/py/non_hermetic/BUILD b/third_party/py/non_hermetic/BUILD
+deleted file mode 100644
+index e69de29bb2d..00000000000
+diff --git a/third_party/py/non_hermetic/BUILD.tpl b/third_party/py/non_hermetic/BUILD.tpl
+deleted file mode 100644
+index 45480bd4a31..00000000000
+--- a/third_party/py/non_hermetic/BUILD.tpl
++++ /dev/null
+@@ -1,80 +0,0 @@
+-licenses(["restricted"])
+-
+-package(default_visibility = ["//visibility:public"])
+-
+-# Point both runtimes to the same python binary to ensure we always
+-# use the python binary specified by ./configure.py script.
+-load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
+-
+-py_runtime(
+- name = "py2_runtime",
+- interpreter_path = "%{PYTHON_BIN_PATH}",
+- python_version = "PY2",
+-)
+-
+-py_runtime(
+- name = "py3_runtime",
+- interpreter_path = "%{PYTHON_BIN_PATH}",
+- python_version = "PY3",
+-)
+-
+-py_runtime_pair(
+- name = "py_runtime_pair",
+- py2_runtime = ":py2_runtime",
+- py3_runtime = ":py3_runtime",
+-)
+-
+-toolchain(
+- name = "py_toolchain",
+- toolchain = ":py_runtime_pair",
+- toolchain_type = "@bazel_tools//tools/python:toolchain_type",
+- target_compatible_with = [%{PLATFORM_CONSTRAINT}],
+- exec_compatible_with = [%{PLATFORM_CONSTRAINT}],
+-)
+-
+-# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib
+-# See https://docs.python.org/3/extending/windows.html
+-cc_import(
+- name = "python_lib",
+- interface_library = select({
+- ":windows": ":python_import_lib",
+- # A placeholder for Unix platforms which makes --no_build happy.
+- "//conditions:default": "not-existing.lib",
+- }),
+- system_provided = 1,
+-)
+-
+-cc_library(
+- name = "python_headers",
+- hdrs = [":python_include"],
+- deps = select({
+- ":windows": [":python_lib"],
+- "//conditions:default": [],
+- }),
+- includes = ["python_include"],
+-)
+-
+-# This alias is exists for the use of targets in the @llvm-project dependency,
+-# which expect a python_headers target called @python_runtime//:headers. We use
+-# a repo_mapping to alias python_runtime to this package, and an alias to create
+-# the correct target.
+-alias(
+- name = "headers",
+- actual = ":python_headers",
+-)
+-
+-cc_library(
+- name = "numpy_headers",
+- hdrs = [":numpy_include"],
+- includes = ["numpy_include"],
+-)
+-
+-config_setting(
+- name = "windows",
+- values = {"cpu": "x64_windows"},
+- visibility = ["//visibility:public"],
+-)
+-
+-%{PYTHON_INCLUDE_GENRULE}
+-%{NUMPY_INCLUDE_GENRULE}
+-%{PYTHON_IMPORT_LIB_GENRULE}
+\ No newline at end of file
+diff --git a/third_party/py/non_hermetic/ml_dtypes/BUILD b/third_party/py/non_hermetic/ml_dtypes/BUILD
+deleted file mode 100644
+index e69de29bb2d..00000000000
+diff --git a/third_party/py/non_hermetic/ml_dtypes/LICENSE b/third_party/py/non_hermetic/ml_dtypes/LICENSE
+deleted file mode 100644
+index d6456956733..00000000000
+--- a/third_party/py/non_hermetic/ml_dtypes/LICENSE
++++ /dev/null
+@@ -1,202 +0,0 @@
+-
+- Apache License
+- Version 2.0, January 2004
+- http://www.apache.org/licenses/
+-
+- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+-
+- 1. Definitions.
+-
+- "License" shall mean the terms and conditions for use, reproduction,
+- and distribution as defined by Sections 1 through 9 of this document.
+-
+- "Licensor" shall mean the copyright owner or entity authorized by
+- the copyright owner that is granting the License.
+-
+- "Legal Entity" shall mean the union of the acting entity and all
+- other entities that control, are controlled by, or are under common
+- control with that entity. For the purposes of this definition,
+- "control" means (i) the power, direct or indirect, to cause the
+- direction or management of such entity, whether by contract or
+- otherwise, or (ii) ownership of fifty percent (50%) or more of the
+- outstanding shares, or (iii) beneficial ownership of such entity.
+-
+- "You" (or "Your") shall mean an individual or Legal Entity
+- exercising permissions granted by this License.
+-
+- "Source" form shall mean the preferred form for making modifications,
+- including but not limited to software source code, documentation
+- source, and configuration files.
+-
+- "Object" form shall mean any form resulting from mechanical
+- transformation or translation of a Source form, including but
+- not limited to compiled object code, generated documentation,
+- and conversions to other media types.
+-
+- "Work" shall mean the work of authorship, whether in Source or
+- Object form, made available under the License, as indicated by a
+- copyright notice that is included in or attached to the work
+- (an example is provided in the Appendix below).
+-
+- "Derivative Works" shall mean any work, whether in Source or Object
+- form, that is based on (or derived from) the Work and for which the
+- editorial revisions, annotations, elaborations, or other modifications
+- represent, as a whole, an original work of authorship. For the purposes
+- of this License, Derivative Works shall not include works that remain
+- separable from, or merely link (or bind by name) to the interfaces of,
+- the Work and Derivative Works thereof.
+-
+- "Contribution" shall mean any work of authorship, including
+- the original version of the Work and any modifications or additions
+- to that Work or Derivative Works thereof, that is intentionally
+- submitted to Licensor for inclusion in the Work by the copyright owner
+- or by an individual or Legal Entity authorized to submit on behalf of
+- the copyright owner. For the purposes of this definition, "submitted"
+- means any form of electronic, verbal, or written communication sent
+- to the Licensor or its representatives, including but not limited to
+- communication on electronic mailing lists, source code control systems,
+- and issue tracking systems that are managed by, or on behalf of, the
+- Licensor for the purpose of discussing and improving the Work, but
+- excluding communication that is conspicuously marked or otherwise
+- designated in writing by the copyright owner as "Not a Contribution."
+-
+- "Contributor" shall mean Licensor and any individual or Legal Entity
+- on behalf of whom a Contribution has been received by Licensor and
+- subsequently incorporated within the Work.
+-
+- 2. Grant of Copyright License. Subject to the terms and conditions of
+- this License, each Contributor hereby grants to You a perpetual,
+- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+- copyright license to reproduce, prepare Derivative Works of,
+- publicly display, publicly perform, sublicense, and distribute the
+- Work and such Derivative Works in Source or Object form.
+-
+- 3. Grant of Patent License. Subject to the terms and conditions of
+- this License, each Contributor hereby grants to You a perpetual,
+- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+- (except as stated in this section) patent license to make, have made,
+- use, offer to sell, sell, import, and otherwise transfer the Work,
+- where such license applies only to those patent claims licensable
+- by such Contributor that are necessarily infringed by their
+- Contribution(s) alone or by combination of their Contribution(s)
+- with the Work to which such Contribution(s) was submitted. If You
+- institute patent litigation against any entity (including a
+- cross-claim or counterclaim in a lawsuit) alleging that the Work
+- or a Contribution incorporated within the Work constitutes direct
+- or contributory patent infringement, then any patent licenses
+- granted to You under this License for that Work shall terminate
+- as of the date such litigation is filed.
+-
+- 4. Redistribution. You may reproduce and distribute copies of the
+- Work or Derivative Works thereof in any medium, with or without
+- modifications, and in Source or Object form, provided that You
+- meet the following conditions:
+-
+- (a) You must give any other recipients of the Work or
+- Derivative Works a copy of this License; and
+-
+- (b) You must cause any modified files to carry prominent notices
+- stating that You changed the files; and
+-
+- (c) You must retain, in the Source form of any Derivative Works
+- that You distribute, all copyright, patent, trademark, and
+- attribution notices from the Source form of the Work,
+- excluding those notices that do not pertain to any part of
+- the Derivative Works; and
+-
+- (d) If the Work includes a "NOTICE" text file as part of its
+- distribution, then any Derivative Works that You distribute must
+- include a readable copy of the attribution notices contained
+- within such NOTICE file, excluding those notices that do not
+- pertain to any part of the Derivative Works, in at least one
+- of the following places: within a NOTICE text file distributed
+- as part of the Derivative Works; within the Source form or
+- documentation, if provided along with the Derivative Works; or,
+- within a display generated by the Derivative Works, if and
+- wherever such third-party notices normally appear. The contents
+- of the NOTICE file are for informational purposes only and
+- do not modify the License. You may add Your own attribution
+- notices within Derivative Works that You distribute, alongside
+- or as an addendum to the NOTICE text from the Work, provided
+- that such additional attribution notices cannot be construed
+- as modifying the License.
+-
+- You may add Your own copyright statement to Your modifications and
+- may provide additional or different license terms and conditions
+- for use, reproduction, or distribution of Your modifications, or
+- for any such Derivative Works as a whole, provided Your use,
+- reproduction, and distribution of the Work otherwise complies with
+- the conditions stated in this License.
+-
+- 5. Submission of Contributions. Unless You explicitly state otherwise,
+- any Contribution intentionally submitted for inclusion in the Work
+- by You to the Licensor shall be under the terms and conditions of
+- this License, without any additional terms or conditions.
+- Notwithstanding the above, nothing herein shall supersede or modify
+- the terms of any separate license agreement you may have executed
+- with Licensor regarding such Contributions.
+-
+- 6. Trademarks. This License does not grant permission to use the trade
+- names, trademarks, service marks, or product names of the Licensor,
+- except as required for reasonable and customary use in describing the
+- origin of the Work and reproducing the content of the NOTICE file.
+-
+- 7. Disclaimer of Warranty. Unless required by applicable law or
+- agreed to in writing, Licensor provides the Work (and each
+- Contributor provides its Contributions) on an "AS IS" BASIS,
+- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+- implied, including, without limitation, any warranties or conditions
+- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+- PARTICULAR PURPOSE. You are solely responsible for determining the
+- appropriateness of using or redistributing the Work and assume any
+- risks associated with Your exercise of permissions under this License.
+-
+- 8. Limitation of Liability. In no event and under no legal theory,
+- whether in tort (including negligence), contract, or otherwise,
+- unless required by applicable law (such as deliberate and grossly
+- negligent acts) or agreed to in writing, shall any Contributor be
+- liable to You for damages, including any direct, indirect, special,
+- incidental, or consequential damages of any character arising as a
+- result of this License or out of the use or inability to use the
+- Work (including but not limited to damages for loss of goodwill,
+- work stoppage, computer failure or malfunction, or any and all
+- other commercial damages or losses), even if such Contributor
+- has been advised of the possibility of such damages.
+-
+- 9. Accepting Warranty or Additional Liability. While redistributing
+- the Work or Derivative Works thereof, You may choose to offer,
+- and charge a fee for, acceptance of support, warranty, indemnity,
+- or other liability obligations and/or rights consistent with this
+- License. However, in accepting such obligations, You may act only
+- on Your own behalf and on Your sole responsibility, not on behalf
+- of any other Contributor, and only if You agree to indemnify,
+- defend, and hold each Contributor harmless for any liability
+- incurred by, or claims asserted against, such Contributor by reason
+- of your accepting any such warranty or additional liability.
+-
+- END OF TERMS AND CONDITIONS
+-
+- APPENDIX: How to apply the Apache License to your work.
+-
+- To apply the Apache License to your work, attach the following
+- boilerplate notice, with the fields enclosed by brackets "[]"
+- replaced with your own identifying information. (Don't include
+- the brackets!) The text should be enclosed in the appropriate
+- comment syntax for the file format. We also recommend that a
+- file or class name and description of purpose be included on the
+- same "printed page" as the copyright notice for easier
+- identification within third-party archives.
+-
+- Copyright [yyyy] [name of copyright owner]
+-
+- Licensed under the Apache License, Version 2.0 (the "License");
+- you may not use this file except in compliance with the License.
+- You may obtain a copy of the License at
+-
+- http://www.apache.org/licenses/LICENSE-2.0
+-
+- Unless required by applicable law or agreed to in writing, software
+- distributed under the License is distributed on an "AS IS" BASIS,
+- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+- See the License for the specific language governing permissions and
+- limitations under the License.
+diff --git a/third_party/py/non_hermetic/ml_dtypes/ml_dtypes.BUILD b/third_party/py/non_hermetic/ml_dtypes/ml_dtypes.BUILD
+deleted file mode 100644
+index 95f58d3c476..00000000000
+--- a/third_party/py/non_hermetic/ml_dtypes/ml_dtypes.BUILD
++++ /dev/null
+@@ -1,50 +0,0 @@
+-load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
+-
+-package(
+- default_visibility = ["//visibility:public"],
+- licenses = ["notice"],
+-)
+-
+-exports_files(["LICENSE"])
+-
+-cc_library(
+- name = "float8",
+- hdrs = ["include/float8.h"],
+- # Internal headers are all relative to , but other packages
+- # include these headers with the prefix.
+- includes = [
+- ".",
+- "ml_dtypes",
+- ],
+- deps = ["@org_tensorflow//third_party/eigen3"],
+-)
+-
+-pybind_extension(
+- name = "_custom_floats",
+- srcs = [
+- "_src/common.h",
+- "_src/custom_float.h",
+- "_src/dtypes.cc",
+- "_src/int4.h",
+- "_src/numpy.cc",
+- "_src/numpy.h",
+- "_src/ufuncs.h",
+- ],
+- includes = ["ml_dtypes"],
+- visibility = [":__subpackages__"],
+- deps = [
+- ":float8",
+- "@org_tensorflow//third_party/eigen3",
+- "@org_tensorflow//third_party/py/numpy:headers",
+- ],
+-)
+-
+-py_library(
+- name = "ml_dtypes",
+- srcs = [
+- "__init__.py",
+- "_finfo.py",
+- "_iinfo.py",
+- ],
+- deps = [":_custom_floats"],
+-)
+diff --git a/third_party/py/non_hermetic/ml_dtypes/ml_dtypes.tests.BUILD b/third_party/py/non_hermetic/ml_dtypes/ml_dtypes.tests.BUILD
+deleted file mode 100644
+index fde5f2eaccf..00000000000
+--- a/third_party/py/non_hermetic/ml_dtypes/ml_dtypes.tests.BUILD
++++ /dev/null
+@@ -1,60 +0,0 @@
+-package(
+- default_visibility = ["//visibility:public"],
+-)
+-
+-py_library(
+- name = "testing_base",
+- deps = [
+- "//:ml_dtypes",
+- "@absl_py//absl/testing:absltest",
+- "@absl_py//absl/testing:parameterized",
+- "@org_tensorflow//third_party/py/numpy",
+- ],
+-)
+-
+-py_test(
+- name = "custom_float_test",
+- srcs = ["custom_float_test.py"],
+- main = "custom_float_test.py",
+- deps = [":testing_base"],
+-)
+-
+-py_test(
+- name = "int4_test",
+- srcs = ["int4_test.py"],
+- main = "int4_test.py",
+- deps = [":testing_base"],
+-)
+-
+-py_test(
+- name = "iinfo_test",
+- srcs = ["iinfo_test.py"],
+- main = "iinfo_test.py",
+- deps = [":testing_base"],
+-)
+-
+-py_test(
+- name = "finfo_test",
+- srcs = ["finfo_test.py"],
+- main = "finfo_test.py",
+- deps = [":testing_base"],
+-)
+-
+-py_test(
+- name = "metadata_test",
+- srcs = ["metadata_test.py"],
+- main = "metadata_test.py",
+- deps = [":testing_base"],
+-)
+-
+-cc_test(
+- name = "float8_test",
+- srcs = ["float8_test.cc"],
+- linkstatic = 1,
+- deps = [
+- "//:float8",
+- "@com_google_absl//absl/strings",
+- "@com_google_googletest//:gtest_main",
+- "@org_tensorflow//third_party/eigen3",
+- ],
+-)
+diff --git a/third_party/py/non_hermetic/ml_dtypes/workspace.bzl b/third_party/py/non_hermetic/ml_dtypes/workspace.bzl
+deleted file mode 100644
+index 2c34f494c34..00000000000
+--- a/third_party/py/non_hermetic/ml_dtypes/workspace.bzl
++++ /dev/null
+@@ -1,22 +0,0 @@
+-"""Provides the repo macro to import ml_dtypes.
+-
+-ml_dtypes provides machine-learning-specific data-types like bfloat16,
+-float8 varieties, and int4.
+-"""
+-
+-load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
+-
+-def repo():
+- ML_DTYPES_COMMIT = "5b9fc9ad978757654843f4a8d899715dbea30e88"
+- ML_DTYPES_SHA256 = "9662811d9ab3823a56f8fa91b5a67fd82062b6dd4f187169b41e82a44e526455"
+- tf_http_archive(
+- name = "ml_dtypes",
+- build_file = "//third_party/py/ml_dtypes:ml_dtypes.BUILD",
+- link_files = {
+- "//third_party/py/ml_dtypes:ml_dtypes.tests.BUILD": "tests/BUILD.bazel",
+- "//third_party/py/ml_dtypes:LICENSE": "LICENSE",
+- },
+- sha256 = ML_DTYPES_SHA256,
+- strip_prefix = "ml_dtypes-{commit}/ml_dtypes".format(commit = ML_DTYPES_COMMIT),
+- urls = tf_mirror_urls("https://github.com/jax-ml/ml_dtypes/archive/{commit}/ml_dtypes-{commit}.tar.gz".format(commit = ML_DTYPES_COMMIT)),
+- )
+diff --git a/third_party/py/non_hermetic/numpy/BUILD b/third_party/py/non_hermetic/numpy/BUILD
+deleted file mode 100644
+index c80cc5287bc..00000000000
+--- a/third_party/py/non_hermetic/numpy/BUILD
++++ /dev/null
+@@ -1,21 +0,0 @@
+-licenses(["restricted"])
+-
+-package(default_visibility = ["//visibility:public"])
+-
+-py_library(
+- name = "numpy",
+- srcs = ["tf_numpy_dummy.py"],
+- srcs_version = "PY3",
+-)
+-
+-alias(
+- name = "headers",
+- actual = "@local_config_python//:numpy_headers",
+-)
+-
+-genrule(
+- name = "dummy",
+- outs = ["tf_numpy_dummy.py"],
+- cmd = "touch $@",
+- visibility = ["//visibility:private"],
+-)
+diff --git a/third_party/py/non_hermetic/numpy/README.md b/third_party/py/non_hermetic/numpy/README.md
+deleted file mode 100644
+index 4e58b9df87b..00000000000
+--- a/third_party/py/non_hermetic/numpy/README.md
++++ /dev/null
+@@ -1,4 +0,0 @@
+-# numpy_ops
+-
+-The folder tf_numpy_api/ contains lists of NumPy API symbols that the
+-`numpy_ops` internal module in TensorFlow implements.
+diff --git a/third_party/py/non_hermetic/numpy/tf_numpy_api/BUILD b/third_party/py/non_hermetic/numpy/tf_numpy_api/BUILD
+deleted file mode 100644
+index 070f8ab8a65..00000000000
+--- a/third_party/py/non_hermetic/numpy/tf_numpy_api/BUILD
++++ /dev/null
+@@ -1,12 +0,0 @@
+-# TensorFlow API backwards compatibility test goldens for tf.experimental.numpy.
+-
+-package(
+- # copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
+- default_visibility = ["//visibility:public"],
+- licenses = ["notice"],
+-)
+-
+-filegroup(
+- name = "api_golden",
+- srcs = glob(["*.pbtxt"]),
+-)
+diff --git a/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.ndarray.pbtxt b/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.ndarray.pbtxt
+deleted file mode 100644
+index 9198264c029..00000000000
+--- a/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.ndarray.pbtxt
++++ /dev/null
+@@ -1,51 +0,0 @@
+-path: "tensorflow.experimental.numpy.ndarray"
+-tf_class {
+- is_instance: "<class \'tensorflow.python.framework.tensor.Tensor\'>"
+- is_instance: "<class \'tensorflow.python.types.internal.NativeObject\'>"
+- is_instance: "<class \'tensorflow.python.types.core.Symbol\'>"
+- is_instance: "<class \'tensorflow.python.types.core.Tensor\'>"
+- is_instance: "<type \'object\'>"
+- member {
+- name: "OVERLOADABLE_OPERATORS"
+- mtype: "<type \'set\'>"
+- }
+- member {
+- name: "dtype"
+- mtype: "<type \'property\'>"
+- }
+- member {
+- name: "name"
+- mtype: "<type \'property\'>"
+- }
+- member {
+- name: "ndim"
+- mtype: "<type \'property\'>"
+- }
+- member {
+- name: "shape"
+- mtype: "<type \'property\'>"
+- }
+- member_method {
+- name: "__init__"
+- }
+- member_method {
+- name: "eval"
+- argspec: "args=[\'self\', \'feed_dict\', \'session\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "experimental_ref"
+- argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "get_shape"
+- argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "ref"
+- argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "set_shape"
+- argspec: "args=[\'self\', \'shape\'], varargs=None, keywords=None, defaults=None"
+- }
+-}
+diff --git a/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt b/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt
+deleted file mode 100644
+index 2f5490ad0c9..00000000000
+--- a/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt
++++ /dev/null
+@@ -1,919 +0,0 @@
+-path: "tensorflow.experimental.numpy"
+-tf_module {
+- member {
+- name: "bool_"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "complex128"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "complex64"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "complex_"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "e"
+- mtype: "<class \'float\'>"
+- }
+- member {
+- name: "float16"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "float32"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "float64"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "float_"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "iinfo"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "inexact"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "inf"
+- mtype: "<class \'float\'>"
+- }
+- member {
+- name: "int16"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "int32"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "int64"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "int8"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "int_"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "ndarray"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "newaxis"
+- mtype: "<type \'NoneType\'>"
+- }
+- member {
+- name: "object_"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "pi"
+- mtype: "<class \'float\'>"
+- }
+- member {
+- name: "random"
+- mtype: "<type \'module\'>"
+- }
+- member {
+- name: "string_"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "uint16"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "uint32"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "uint64"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "uint8"
+- mtype: "<type \'type\'>"
+- }
+- member {
+- name: "unicode_"
+- mtype: "<type \'type\'>"
+- }
+- member_method {
+- name: "abs"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "absolute"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "add"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "all"
+- argspec: "args=[\'a\', \'axis\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "allclose"
+- argspec: "args=[\'a\', \'b\', \'rtol\', \'atol\', \'equal_nan\'], varargs=None, keywords=None, defaults=[\'1e-05\', \'1e-08\', \'False\'], "
+- }
+- member_method {
+- name: "amax"
+- argspec: "args=[\'a\', \'axis\', \'out\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], "
+- }
+- member_method {
+- name: "amin"
+- argspec: "args=[\'a\', \'axis\', \'out\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], "
+- }
+- member_method {
+- name: "angle"
+- argspec: "args=[\'z\', \'deg\'], varargs=None, keywords=None, defaults=[\'False\'], "
+- }
+- member_method {
+- name: "any"
+- argspec: "args=[\'a\', \'axis\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "append"
+- argspec: "args=[\'arr\', \'values\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "arange"
+- argspec: "args=[\'start\', \'stop\', \'step\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\', \'1\', \'None\'], "
+- }
+- member_method {
+- name: "arccos"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "arccosh"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "arcsin"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "arcsinh"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "arctan"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "arctan2"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "arctanh"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "argmax"
+- argspec: "args=[\'a\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "argmin"
+- argspec: "args=[\'a\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "argsort"
+- argspec: "args=[\'a\', \'axis\', \'kind\', \'order\'], varargs=None, keywords=None, defaults=[\'-1\', \'quicksort\', \'None\'], "
+- }
+- member_method {
+- name: "around"
+- argspec: "args=[\'a\', \'decimals\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "array"
+- argspec: "args=[\'val\', \'dtype\', \'copy\', \'ndmin\'], varargs=None, keywords=None, defaults=[\'None\', \'True\', \'0\'], "
+- }
+- member_method {
+- name: "array_equal"
+- argspec: "args=[\'a1\', \'a2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "asanyarray"
+- argspec: "args=[\'a\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "asarray"
+- argspec: "args=[\'a\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "ascontiguousarray"
+- argspec: "args=[\'a\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "atleast_1d"
+- argspec: "args=[], varargs=arys, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "atleast_2d"
+- argspec: "args=[], varargs=arys, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "atleast_3d"
+- argspec: "args=[], varargs=arys, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "average"
+- argspec: "args=[\'a\', \'axis\', \'weights\', \'returned\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'False\'], "
+- }
+- member_method {
+- name: "bitwise_and"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "bitwise_not"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "bitwise_or"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "bitwise_xor"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "broadcast_arrays"
+- argspec: "args=[], varargs=args, keywords=kwargs, defaults=None"
+- }
+- member_method {
+- name: "broadcast_to"
+- argspec: "args=[\'array\', \'shape\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "cbrt"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "ceil"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "clip"
+- argspec: "args=[\'a\', \'a_min\', \'a_max\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "compress"
+- argspec: "args=[\'condition\', \'a\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "concatenate"
+- argspec: "args=[\'arys\', \'axis\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "conj"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "conjugate"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "copy"
+- argspec: "args=[\'a\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "cos"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "cosh"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "count_nonzero"
+- argspec: "args=[\'a\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "cross"
+- argspec: "args=[\'a\', \'b\', \'axisa\', \'axisb\', \'axisc\', \'axis\'], varargs=None, keywords=None, defaults=[\'-1\', \'-1\', \'-1\', \'None\'], "
+- }
+- member_method {
+- name: "cumprod"
+- argspec: "args=[\'a\', \'axis\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "cumsum"
+- argspec: "args=[\'a\', \'axis\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "deg2rad"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "diag"
+- argspec: "args=[\'v\', \'k\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "diag_indices"
+- argspec: "args=[\'n\', \'ndim\'], varargs=None, keywords=None, defaults=[\'2\'], "
+- }
+- member_method {
+- name: "diagflat"
+- argspec: "args=[\'v\', \'k\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "diagonal"
+- argspec: "args=[\'a\', \'offset\', \'axis1\', \'axis2\'], varargs=None, keywords=None, defaults=[\'0\', \'0\', \'1\'], "
+- }
+- member_method {
+- name: "diff"
+- argspec: "args=[\'a\', \'n\', \'axis\'], varargs=None, keywords=None, defaults=[\'1\', \'-1\'], "
+- }
+- member_method {
+- name: "divide"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "divmod"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "dot"
+- argspec: "args=[\'a\', \'b\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "dsplit"
+- argspec: "args=[\'ary\', \'indices_or_sections\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "dstack"
+- argspec: "args=[\'tup\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "einsum"
+- argspec: "args=[\'subscripts\'], varargs=operands, keywords=kwargs, defaults=None"
+- }
+- member_method {
+- name: "empty"
+- argspec: "args=[\'shape\', \'dtype\'], varargs=None, keywords=None, defaults=[\"<class \'float\'>\"], "
+- }
+- member_method {
+- name: "empty_like"
+- argspec: "args=[\'a\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "equal"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "exp"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "exp2"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "expand_dims"
+- argspec: "args=[\'a\', \'axis\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "experimental_enable_numpy_behavior"
+- argspec: "args=[\'prefer_float32\'], varargs=None, keywords=None, defaults=[\'False\'], "
+- }
+- member_method {
+- name: "expm1"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "eye"
+- argspec: "args=[\'N\', \'M\', \'k\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \"<class \'float\'>\"], "
+- }
+- member_method {
+- name: "fabs"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "finfo"
+- argspec: "args=[\'dtype\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "fix"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "flatten"
+- argspec: "args=[\'a\', \'order\'], varargs=None, keywords=None, defaults=[\'C\'], "
+- }
+- member_method {
+- name: "flip"
+- argspec: "args=[\'m\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "fliplr"
+- argspec: "args=[\'m\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "flipud"
+- argspec: "args=[\'m\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "float_power"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "floor"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "floor_divide"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "full"
+- argspec: "args=[\'shape\', \'fill_value\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "full_like"
+- argspec: "args=[\'a\', \'fill_value\', \'dtype\', \'order\', \'subok\', \'shape\'], varargs=None, keywords=None, defaults=[\'None\', \'K\', \'True\', \'None\'], "
+- }
+- member_method {
+- name: "gcd"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "geomspace"
+- argspec: "args=[\'start\', \'stop\', \'num\', \'endpoint\', \'dtype\', \'axis\'], varargs=None, keywords=None, defaults=[\'50\', \'True\', \'None\', \'0\'], "
+- }
+- member_method {
+- name: "greater"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "greater_equal"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "heaviside"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "hsplit"
+- argspec: "args=[\'ary\', \'indices_or_sections\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "hstack"
+- argspec: "args=[\'tup\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "hypot"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "identity"
+- argspec: "args=[\'n\', \'dtype\'], varargs=None, keywords=None, defaults=[\"<class \'float\'>\"], "
+- }
+- member_method {
+- name: "imag"
+- argspec: "args=[\'val\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "inner"
+- argspec: "args=[\'a\', \'b\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isclose"
+- argspec: "args=[\'a\', \'b\', \'rtol\', \'atol\', \'equal_nan\'], varargs=None, keywords=None, defaults=[\'1e-05\', \'1e-08\', \'False\'], "
+- }
+- member_method {
+- name: "iscomplex"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "iscomplexobj"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isfinite"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isinf"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isnan"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isneginf"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isposinf"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isreal"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isrealobj"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "isscalar"
+- argspec: "args=[\'num\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "issubdtype"
+- argspec: "args=[\'arg1\', \'arg2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "ix_"
+- argspec: "args=[], varargs=args, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "kron"
+- argspec: "args=[\'a\', \'b\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "lcm"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "less"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "less_equal"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "linspace"
+- argspec: "args=[\'start\', \'stop\', \'num\', \'endpoint\', \'retstep\', \'dtype\', \'axis\'], varargs=None, keywords=None, defaults=[\'50\', \'True\', \'False\', \"<class \'float\'>\", \'0\'], "
+- }
+- member_method {
+- name: "log"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "log10"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "log1p"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "log2"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "logaddexp"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "logaddexp2"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "logical_and"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "logical_not"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "logical_or"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "logical_xor"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "logspace"
+- argspec: "args=[\'start\', \'stop\', \'num\', \'endpoint\', \'base\', \'dtype\', \'axis\'], varargs=None, keywords=None, defaults=[\'50\', \'True\', \'10.0\', \'None\', \'0\'], "
+- }
+- member_method {
+- name: "matmul"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "max"
+- argspec: "args=[\'a\', \'axis\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "maximum"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "mean"
+- argspec: "args=[\'a\', \'axis\', \'dtype\', \'out\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], "
+- }
+- member_method {
+- name: "meshgrid"
+- argspec: "args=[], varargs=xi, keywords=kwargs, defaults=None"
+- }
+- member_method {
+- name: "min"
+- argspec: "args=[\'a\', \'axis\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "minimum"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "mod"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "moveaxis"
+- argspec: "args=[\'a\', \'source\', \'destination\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "multiply"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "nanmean"
+- argspec: "args=[\'a\', \'axis\', \'dtype\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], "
+- }
+- member_method {
+- name: "nanprod"
+- argspec: "args=[\'a\', \'axis\', \'dtype\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'False\'], "
+- }
+- member_method {
+- name: "nansum"
+- argspec: "args=[\'a\', \'axis\', \'dtype\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'False\'], "
+- }
+- member_method {
+- name: "ndim"
+- argspec: "args=[\'a\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "negative"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "nextafter"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "nonzero"
+- argspec: "args=[\'a\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "not_equal"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "ones"
+- argspec: "args=[\'shape\', \'dtype\'], varargs=None, keywords=None, defaults=[\"<class \'float\'>\"], "
+- }
+- member_method {
+- name: "ones_like"
+- argspec: "args=[\'a\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "outer"
+- argspec: "args=[\'a\', \'b\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "pad"
+- argspec: "args=[\'array\', \'pad_width\', \'mode\'], varargs=None, keywords=kwargs, defaults=None"
+- }
+- member_method {
+- name: "polyval"
+- argspec: "args=[\'p\', \'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "positive"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "power"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "prod"
+- argspec: "args=[\'a\', \'axis\', \'dtype\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], "
+- }
+- member_method {
+- name: "promote_types"
+- argspec: "args=[\'type1\', \'type2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "ptp"
+- argspec: "args=[\'a\', \'axis\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "rad2deg"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "ravel"
+- argspec: "args=[\'a\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "real"
+- argspec: "args=[\'val\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "reciprocal"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "remainder"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "repeat"
+- argspec: "args=[\'a\', \'repeats\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "reshape"
+- argspec: "args=[\'a\', \'newshape\', \'order\'], varargs=None, keywords=None, defaults=[\'C\'], "
+- }
+- member_method {
+- name: "result_type"
+- argspec: "args=[], varargs=arrays_and_dtypes, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "roll"
+- argspec: "args=[\'a\', \'shift\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "rot90"
+- argspec: "args=[\'m\', \'k\', \'axes\'], varargs=None, keywords=None, defaults=[\'1\', \'(0, 1)\'], "
+- }
+- member_method {
+- name: "round"
+- argspec: "args=[\'a\', \'decimals\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "select"
+- argspec: "args=[\'condlist\', \'choicelist\', \'default\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "shape"
+- argspec: "args=[\'a\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "sign"
+- argspec: "args=[\'x\', \'out\', \'where\'], varargs=None, keywords=kwargs, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "signbit"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "sin"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "sinc"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "sinh"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "size"
+- argspec: "args=[\'x\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "sort"
+- argspec: "args=[\'a\', \'axis\', \'kind\', \'order\'], varargs=None, keywords=None, defaults=[\'-1\', \'quicksort\', \'None\'], "
+- }
+- member_method {
+- name: "split"
+- argspec: "args=[\'ary\', \'indices_or_sections\', \'axis\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "sqrt"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "square"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "squeeze"
+- argspec: "args=[\'a\', \'axis\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "stack"
+- argspec: "args=[\'arrays\', \'axis\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "std"
+- argspec: "args=[\'a\', \'axis\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "subtract"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "sum"
+- argspec: "args=[\'a\', \'axis\', \'dtype\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], "
+- }
+- member_method {
+- name: "swapaxes"
+- argspec: "args=[\'a\', \'axis1\', \'axis2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "take"
+- argspec: "args=[\'a\', \'indices\', \'axis\', \'out\', \'mode\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'clip\'], "
+- }
+- member_method {
+- name: "take_along_axis"
+- argspec: "args=[\'arr\', \'indices\', \'axis\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "tan"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "tanh"
+- argspec: "args=[\'x\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "tensordot"
+- argspec: "args=[\'a\', \'b\', \'axes\'], varargs=None, keywords=None, defaults=[\'2\'], "
+- }
+- member_method {
+- name: "tile"
+- argspec: "args=[\'a\', \'reps\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "trace"
+- argspec: "args=[\'a\', \'offset\', \'axis1\', \'axis2\', \'dtype\'], varargs=None, keywords=None, defaults=[\'0\', \'0\', \'1\', \'None\'], "
+- }
+- member_method {
+- name: "transpose"
+- argspec: "args=[\'a\', \'axes\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "tri"
+- argspec: "args=[\'N\', \'M\', \'k\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'None\'], "
+- }
+- member_method {
+- name: "tril"
+- argspec: "args=[\'m\', \'k\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "triu"
+- argspec: "args=[\'m\', \'k\'], varargs=None, keywords=None, defaults=[\'0\'], "
+- }
+- member_method {
+- name: "true_divide"
+- argspec: "args=[\'x1\', \'x2\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "vander"
+- argspec: "args=[\'x\', \'N\', \'increasing\'], varargs=None, keywords=None, defaults=[\'None\', \'False\'], "
+- }
+- member_method {
+- name: "var"
+- argspec: "args=[\'a\', \'axis\', \'dtype\', \'out\', \'ddof\', \'keepdims\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'0\', \'None\'], "
+- }
+- member_method {
+- name: "vdot"
+- argspec: "args=[\'a\', \'b\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "vsplit"
+- argspec: "args=[\'ary\', \'indices_or_sections\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "vstack"
+- argspec: "args=[\'tup\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "where"
+- argspec: "args=[\'condition\', \'x\', \'y\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
+- }
+- member_method {
+- name: "zeros"
+- argspec: "args=[\'shape\', \'dtype\'], varargs=None, keywords=None, defaults=[\"<class \'float\'>\"], "
+- }
+- member_method {
+- name: "zeros_like"
+- argspec: "args=[\'a\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+-}
+diff --git a/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.random.pbtxt b/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.random.pbtxt
+deleted file mode 100644
+index 61a4766f3f8..00000000000
+--- a/third_party/py/non_hermetic/numpy/tf_numpy_api/tensorflow.experimental.numpy.random.pbtxt
++++ /dev/null
+@@ -1,35 +0,0 @@
+-path: "tensorflow.experimental.numpy.random"
+-tf_module {
+- member_method {
+- name: "poisson"
+- argspec: "args=[\'lam\', \'size\'], varargs=None, keywords=None, defaults=[\'1.0\', \'None\'], "
+- }
+- member_method {
+- name: "rand"
+- argspec: "args=[], varargs=size, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "randint"
+- argspec: "args=[\'low\', \'high\', \'size\', \'dtype\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \"<class \'numpy.int64\'>\"], "
+- }
+- member_method {
+- name: "randn"
+- argspec: "args=[], varargs=args, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "random"
+- argspec: "args=[\'size\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "seed"
+- argspec: "args=[\'s\'], varargs=None, keywords=None, defaults=None"
+- }
+- member_method {
+- name: "standard_normal"
+- argspec: "args=[\'size\'], varargs=None, keywords=None, defaults=[\'None\'], "
+- }
+- member_method {
+- name: "uniform"
+- argspec: "args=[\'low\', \'high\', \'size\'], varargs=None, keywords=None, defaults=[\'0.0\', \'1.0\', \'None\'], "
+- }
+-}
+diff --git a/third_party/py/non_hermetic/python_configure.bzl b/third_party/py/non_hermetic/python_configure.bzl
+deleted file mode 100644
+index 300cbfb6c71..00000000000
+--- a/third_party/py/non_hermetic/python_configure.bzl
++++ /dev/null
+@@ -1,315 +0,0 @@
+-"""Repository rule for Python autoconfiguration.
+-
+-`python_configure` depends on the following environment variables:
+-
+- * `PYTHON_BIN_PATH`: location of python binary.
+- * `PYTHON_LIB_PATH`: Location of python libraries.
+-"""
+-
+-load(
+- "//third_party/remote_config:common.bzl",
+- "BAZEL_SH",
+- "PYTHON_BIN_PATH",
+- "PYTHON_LIB_PATH",
+- "TF_PYTHON_CONFIG_REPO",
+- "auto_config_fail",
+- "config_repo_label",
+- "execute",
+- "get_bash_bin",
+- "get_host_environ",
+- "get_python_bin",
+- "is_windows",
+- "raw_exec",
+- "read_dir",
+-)
+-
+-def _genrule(src_dir, genrule_name, command, outs):
+- """Returns a string with a genrule.
+-
+- Genrule executes the given command and produces the given outputs.
+- """
+- return (
+- "genrule(\n" +
+- ' name = "' +
+- genrule_name + '",\n' +
+- " outs = [\n" +
+- outs +
+- "\n ],\n" +
+- ' cmd = """\n' +
+- command +
+- '\n """,\n' +
+- ")\n"
+- )
+-
+-def _norm_path(path):
+- """Returns a path with '/' and remove the trailing slash."""
+- path = path.replace("\\", "/")
+- if path[-1] == "/":
+- path = path[:-1]
+- return path
+-
+-def _symlink_genrule_for_dir(
+- repository_ctx,
+- src_dir,
+- dest_dir,
+- genrule_name,
+- src_files = [],
+- dest_files = []):
+- """Returns a genrule to symlink(or copy if on Windows) a set of files.
+-
+- If src_dir is passed, files will be read from the given directory; otherwise
+- we assume files are in src_files and dest_files
+- """
+- if src_dir != None:
+- src_dir = _norm_path(src_dir)
+- dest_dir = _norm_path(dest_dir)
+- files = "\n".join(read_dir(repository_ctx, src_dir))
+-
+- # Create a list with the src_dir stripped to use for outputs.
+- dest_files = files.replace(src_dir, "").splitlines()
+- src_files = files.splitlines()
+- command = []
+- outs = []
+- for i in range(len(dest_files)):
+- if dest_files[i] != "":
+- # If we have only one file to link we do not want to use the dest_dir, as
+- # $(@D) will include the full path to the file.
+- dest = "$(@D)/" + dest_dir + dest_files[i] if len(dest_files) != 1 else "$(@D)/" + dest_files[i]
+-
+- # Copy the headers to create a sandboxable setup.
+- cmd = "cp -f"
+- command.append(cmd + ' "%s" "%s"' % (src_files[i], dest))
+- outs.append(' "' + dest_dir + dest_files[i] + '",')
+- genrule = _genrule(
+- src_dir,
+- genrule_name,
+- " && ".join(command),
+- "\n".join(outs),
+- )
+- return genrule
+-
+-def _get_python_lib(repository_ctx, python_bin):
+- """Gets the python lib path."""
+- python_lib = get_host_environ(repository_ctx, PYTHON_LIB_PATH)
+- if python_lib != None:
+- return python_lib
+-
+- # The interesting program to execute.
+- print_lib = [
+- "from __future__ import print_function",
+- "import site",
+- "import os",
+- "python_paths = []",
+- "if os.getenv('PYTHONPATH') is not None:",
+- " python_paths = os.getenv('PYTHONPATH').split(':')",
+- "try:",
+- " library_paths = site.getsitepackages()",
+- "except AttributeError:",
+- " from distutils.sysconfig import get_python_lib",
+- " library_paths = [get_python_lib()]",
+- "all_paths = set(python_paths + library_paths)",
+- "paths = []",
+- "for path in all_paths:",
+- " if os.path.isdir(path):",
+- " paths.append(path)",
+- "if len(paths) >=1:",
+- " print(paths[0])",
+- ]
+-
+- # The below script writes the above program to a file
+- # and executes it. This is to work around the limitation
+- # of not being able to upload files as part of execute.
+- cmd = "from os import linesep;"
+- cmd += "f = open('script.py', 'w');"
+- for line in print_lib:
+- cmd += "f.write(\"%s\" + linesep);" % line
+- cmd += "f.close();"
+- cmd += "from subprocess import call;"
+- cmd += "call([\"%s\", \"script.py\"]);" % python_bin
+-
+- result = execute(repository_ctx, [python_bin, "-c", cmd])
+- return result.stdout.strip()
+-
+-def _check_python_lib(repository_ctx, python_lib):
+- """Checks the python lib path."""
+- cmd = 'test -d "%s" -a -x "%s"' % (python_lib, python_lib)
+- result = raw_exec(repository_ctx, [get_bash_bin(repository_ctx), "-c", cmd])
+- if result.return_code == 1:
+- auto_config_fail("Invalid python library path: %s" % python_lib)
+-
+-def _check_python_bin(repository_ctx, python_bin):
+- """Checks the python bin path."""
+- cmd = '[[ -x "%s" ]] && [[ ! -d "%s" ]]' % (python_bin, python_bin)
+- result = raw_exec(repository_ctx, [get_bash_bin(repository_ctx), "-c", cmd])
+- if result.return_code == 1:
+- auto_config_fail("--define %s='%s' is not executable. Is it the python binary?" % (
+- PYTHON_BIN_PATH,
+- python_bin,
+- ))
+-
+-def _get_python_include(repository_ctx, python_bin):
+- """Gets the python include path."""
+- result = execute(
+- repository_ctx,
+- [
+- python_bin,
+- "-Wignore",
+- "-c",
+- "import importlib; " +
+- "import importlib.util; " +
+- "print(importlib.import_module('distutils.sysconfig').get_python_inc() " +
+- "if importlib.util.find_spec('distutils.sysconfig') " +
+- "else importlib.import_module('sysconfig').get_path('include'))",
+- ],
+- error_msg = "Problem getting python include path.",
+- error_details = ("Is the Python binary path set up right? " +
+- "(See ./configure or " + PYTHON_BIN_PATH + ".) " +
+- "Is distutils installed?"),
+- )
+- return result.stdout.splitlines()[0]
+-
+-def _get_python_import_lib_name(repository_ctx, python_bin):
+- """Get Python import library name (pythonXY.lib) on Windows."""
+- result = execute(
+- repository_ctx,
+- [
+- python_bin,
+- "-c",
+- "import sys;" +
+- 'print("python" + str(sys.version_info[0]) + ' +
+- ' str(sys.version_info[1]) + ".lib")',
+- ],
+- error_msg = "Problem getting python import library.",
+- error_details = ("Is the Python binary path set up right? " +
+- "(See ./configure or " + PYTHON_BIN_PATH + ".) "),
+- )
+- return result.stdout.splitlines()[0]
+-
+-def _get_numpy_include(repository_ctx, python_bin):
+- """Gets the numpy include path."""
+- return execute(
+- repository_ctx,
+- [
+- python_bin,
+- "-c",
+- "from __future__ import print_function;" +
+- "import numpy;" +
+- " print(numpy.get_include());",
+- ],
+- error_msg = "Problem getting numpy include path.",
+- error_details = "Is numpy installed?",
+- ).stdout.splitlines()[0]
+-
+-def _create_local_python_repository(repository_ctx):
+- """Creates the repository containing files set up to build with Python."""
+-
+- # Resolve all labels before doing any real work. Resolving causes the
+- # function to be restarted with all previous state being lost. This
+- # can easily lead to a O(n^2) runtime in the number of labels.
+- build_tpl = repository_ctx.path(Label("//third_party/py:BUILD.tpl"))
+-
+- python_bin = get_python_bin(repository_ctx)
+- _check_python_bin(repository_ctx, python_bin)
+- python_lib = _get_python_lib(repository_ctx, python_bin)
+- _check_python_lib(repository_ctx, python_lib)
+- python_include = _get_python_include(repository_ctx, python_bin)
+- numpy_include = _get_numpy_include(repository_ctx, python_bin) + "/numpy"
+- python_include_rule = _symlink_genrule_for_dir(
+- repository_ctx,
+- python_include,
+- "python_include",
+- "python_include",
+- )
+- python_import_lib_genrule = ""
+-
+- # To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib
+- # See https://docs.python.org/3/extending/windows.html
+- if is_windows(repository_ctx):
+- python_bin = python_bin.replace("\\", "/")
+- python_include = _norm_path(python_include)
+- python_import_lib_name = _get_python_import_lib_name(repository_ctx, python_bin)
+- python_import_lib_src = python_include.rsplit("/", 1)[0] + "/libs/" + python_import_lib_name
+- python_import_lib_genrule = _symlink_genrule_for_dir(
+- repository_ctx,
+- None,
+- "",
+- "python_import_lib",
+- [python_import_lib_src],
+- [python_import_lib_name],
+- )
+- numpy_include_rule = _symlink_genrule_for_dir(
+- repository_ctx,
+- numpy_include,
+- "numpy_include/numpy",
+- "numpy_include",
+- )
+-
+- platform_constraint = ""
+- if repository_ctx.attr.platform_constraint:
+- platform_constraint = "\"%s\"" % repository_ctx.attr.platform_constraint
+- repository_ctx.template("BUILD", build_tpl, {
+- "%{PYTHON_BIN_PATH}": python_bin,
+- "%{PYTHON_INCLUDE_GENRULE}": python_include_rule,
+- "%{PYTHON_IMPORT_LIB_GENRULE}": python_import_lib_genrule,
+- "%{NUMPY_INCLUDE_GENRULE}": numpy_include_rule,
+- "%{PLATFORM_CONSTRAINT}": platform_constraint,
+- })
+-
+-def _create_remote_python_repository(repository_ctx, remote_config_repo):
+- """Creates pointers to a remotely configured repo set up to build with Python.
+- """
+- repository_ctx.template("BUILD", config_repo_label(remote_config_repo, ":BUILD"), {})
+-
+-def _python_autoconf_impl(repository_ctx):
+- """Implementation of the python_autoconf repository rule."""
+- if get_host_environ(repository_ctx, TF_PYTHON_CONFIG_REPO) != None:
+- _create_remote_python_repository(
+- repository_ctx,
+- get_host_environ(repository_ctx, TF_PYTHON_CONFIG_REPO),
+- )
+- else:
+- _create_local_python_repository(repository_ctx)
+-
+-_ENVIRONS = [
+- BAZEL_SH,
+- PYTHON_BIN_PATH,
+- PYTHON_LIB_PATH,
+-]
+-
+-local_python_configure = repository_rule(
+- implementation = _create_local_python_repository,
+- environ = _ENVIRONS,
+- attrs = {
+- "environ": attr.string_dict(),
+- "platform_constraint": attr.string(),
+- },
+-)
+-
+-remote_python_configure = repository_rule(
+- implementation = _create_local_python_repository,
+- environ = _ENVIRONS,
+- remotable = True,
+- attrs = {
+- "environ": attr.string_dict(),
+- "platform_constraint": attr.string(),
+- },
+-)
+-
+-python_configure = repository_rule(
+- implementation = _python_autoconf_impl,
+- environ = _ENVIRONS + [TF_PYTHON_CONFIG_REPO],
+- attrs = {
+- "platform_constraint": attr.string(),
+- },
+-)
+-"""Detects and configures the local Python.
+-
+-Add the following to your WORKSPACE FILE:
+-
+-```python
+-python_configure(name = "local_config_python")
+-```
+-
+-Args:
+- name: A unique name for this workspace rule.
+-"""
+diff --git a/third_party/py/numpy/BUILD b/third_party/py/numpy/BUILD
+index 97c7907fc38..c80cc5287bc 100644
+--- a/third_party/py/numpy/BUILD
++++ b/third_party/py/numpy/BUILD
+@@ -2,14 +2,15 @@ licenses(["restricted"])
+
+ package(default_visibility = ["//visibility:public"])
+
+-alias(
++py_library(
+ name = "numpy",
+- actual = "@pypi_numpy//:pkg",
++ srcs = ["tf_numpy_dummy.py"],
++ srcs_version = "PY3",
+ )
+
+ alias(
+ name = "headers",
+- actual = "@pypi_numpy//:numpy_headers",
++ actual = "@local_config_python//:numpy_headers",
+ )
+
+ genrule(
+diff --git a/third_party/py/numpy/LICENSE b/third_party/py/numpy/LICENSE
+deleted file mode 100644
+index b9731f734f5..00000000000
+--- a/third_party/py/numpy/LICENSE
++++ /dev/null
+@@ -1,60 +0,0 @@
+-Copyright (c) 2005-2019, NumPy Developers.
+-All rights reserved.
+-
+-Redistribution and use in source and binary forms, with or without
+-modification, are permitted provided that the following conditions are
+-met:
+-
+- * Redistributions of source code must retain the above copyright
+- notice, this list of conditions and the following disclaimer.
+-
+- * Redistributions in binary form must reproduce the above
+- copyright notice, this list of conditions and the following
+- disclaimer in the documentation and/or other materials provided
+- with the distribution.
+-
+- * Neither the name of the NumPy Developers nor the names of any
+- contributors may be used to endorse or promote products derived
+- from this software without specific prior written permission.
+-
+-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-
+-
+-
+-The NumPy repository and source distributions bundle several libraries that are
+-compatibly licensed. We list these here.
+-
+-Name: Numpydoc
+-Files: doc/sphinxext/numpydoc/*
+-License: 2-clause BSD
+- For details, see doc/sphinxext/LICENSE.txt
+-
+-Name: scipy-sphinx-theme
+-Files: doc/scipy-sphinx-theme/*
+-License: 3-clause BSD, PSF and Apache 2.0
+- For details, see doc/scipy-sphinx-theme/LICENSE.txt
+-
+-Name: lapack-lite
+-Files: numpy/linalg/lapack_lite/*
+-License: 3-clause BSD
+- For details, see numpy/linalg/lapack_lite/LICENSE.txt
+-
+-Name: tempita
+-Files: tools/npy_tempita/*
+-License: BSD derived
+- For details, see tools/npy_tempita/license.txt
+-
+-Name: dragon4
+-Files: numpy/core/src/multiarray/dragon4.c
+-License: One of a kind
+- For license text, see numpy/core/src/multiarray/dragon4.c
+diff --git a/third_party/py/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt b/third_party/py/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt
+index 05939b53b5f..2f5490ad0c9 100644
+--- a/third_party/py/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt
++++ b/third_party/py/numpy/tf_numpy_api/tensorflow.experimental.numpy.pbtxt
+@@ -390,7 +390,7 @@ tf_module {
+ }
+ member_method {
+ name: "experimental_enable_numpy_behavior"
+- argspec: "args=[\'prefer_float32\', \'dtype_conversion_mode\'], varargs=None, keywords=None, defaults=[\'False\', \'legacy\'], "
++ argspec: "args=[\'prefer_float32\'], varargs=None, keywords=None, defaults=[\'False\'], "
+ }
+ member_method {
+ name: "expm1"
+diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl
+index 3728a91b931..300cbfb6c71 100644
+--- a/third_party/py/python_configure.bzl
++++ b/third_party/py/python_configure.bzl
+@@ -1,4 +1,9 @@
+ """Repository rule for Python autoconfiguration.
++
++`python_configure` depends on the following environment variables:
++
++ * `PYTHON_BIN_PATH`: location of python binary.
++ * `PYTHON_LIB_PATH`: Location of python libraries.
+ """
+
+ load(
+@@ -6,8 +11,195 @@ load(
+ "BAZEL_SH",
+ "PYTHON_BIN_PATH",
+ "PYTHON_LIB_PATH",
++ "TF_PYTHON_CONFIG_REPO",
++ "auto_config_fail",
++ "config_repo_label",
++ "execute",
++ "get_bash_bin",
++ "get_host_environ",
++ "get_python_bin",
++ "is_windows",
++ "raw_exec",
++ "read_dir",
+ )
+
++def _genrule(src_dir, genrule_name, command, outs):
++ """Returns a string with a genrule.
++
++ Genrule executes the given command and produces the given outputs.
++ """
++ return (
++ "genrule(\n" +
++ ' name = "' +
++ genrule_name + '",\n' +
++ " outs = [\n" +
++ outs +
++ "\n ],\n" +
++ ' cmd = """\n' +
++ command +
++ '\n """,\n' +
++ ")\n"
++ )
++
++def _norm_path(path):
++ """Returns a path with '/' and remove the trailing slash."""
++ path = path.replace("\\", "/")
++ if path[-1] == "/":
++ path = path[:-1]
++ return path
++
++def _symlink_genrule_for_dir(
++ repository_ctx,
++ src_dir,
++ dest_dir,
++ genrule_name,
++ src_files = [],
++ dest_files = []):
++ """Returns a genrule to symlink(or copy if on Windows) a set of files.
++
++ If src_dir is passed, files will be read from the given directory; otherwise
++ we assume files are in src_files and dest_files
++ """
++ if src_dir != None:
++ src_dir = _norm_path(src_dir)
++ dest_dir = _norm_path(dest_dir)
++ files = "\n".join(read_dir(repository_ctx, src_dir))
++
++ # Create a list with the src_dir stripped to use for outputs.
++ dest_files = files.replace(src_dir, "").splitlines()
++ src_files = files.splitlines()
++ command = []
++ outs = []
++ for i in range(len(dest_files)):
++ if dest_files[i] != "":
++ # If we have only one file to link we do not want to use the dest_dir, as
++ # $(@D) will include the full path to the file.
++ dest = "$(@D)/" + dest_dir + dest_files[i] if len(dest_files) != 1 else "$(@D)/" + dest_files[i]
++
++ # Copy the headers to create a sandboxable setup.
++ cmd = "cp -f"
++ command.append(cmd + ' "%s" "%s"' % (src_files[i], dest))
++ outs.append(' "' + dest_dir + dest_files[i] + '",')
++ genrule = _genrule(
++ src_dir,
++ genrule_name,
++ " && ".join(command),
++ "\n".join(outs),
++ )
++ return genrule
++
++def _get_python_lib(repository_ctx, python_bin):
++ """Gets the python lib path."""
++ python_lib = get_host_environ(repository_ctx, PYTHON_LIB_PATH)
++ if python_lib != None:
++ return python_lib
++
++ # The interesting program to execute.
++ print_lib = [
++ "from __future__ import print_function",
++ "import site",
++ "import os",
++ "python_paths = []",
++ "if os.getenv('PYTHONPATH') is not None:",
++ " python_paths = os.getenv('PYTHONPATH').split(':')",
++ "try:",
++ " library_paths = site.getsitepackages()",
++ "except AttributeError:",
++ " from distutils.sysconfig import get_python_lib",
++ " library_paths = [get_python_lib()]",
++ "all_paths = set(python_paths + library_paths)",
++ "paths = []",
++ "for path in all_paths:",
++ " if os.path.isdir(path):",
++ " paths.append(path)",
++ "if len(paths) >=1:",
++ " print(paths[0])",
++ ]
++
++ # The below script writes the above program to a file
++ # and executes it. This is to work around the limitation
++ # of not being able to upload files as part of execute.
++ cmd = "from os import linesep;"
++ cmd += "f = open('script.py', 'w');"
++ for line in print_lib:
++ cmd += "f.write(\"%s\" + linesep);" % line
++ cmd += "f.close();"
++ cmd += "from subprocess import call;"
++ cmd += "call([\"%s\", \"script.py\"]);" % python_bin
++
++ result = execute(repository_ctx, [python_bin, "-c", cmd])
++ return result.stdout.strip()
++
++def _check_python_lib(repository_ctx, python_lib):
++ """Checks the python lib path."""
++ cmd = 'test -d "%s" -a -x "%s"' % (python_lib, python_lib)
++ result = raw_exec(repository_ctx, [get_bash_bin(repository_ctx), "-c", cmd])
++ if result.return_code == 1:
++ auto_config_fail("Invalid python library path: %s" % python_lib)
++
++def _check_python_bin(repository_ctx, python_bin):
++ """Checks the python bin path."""
++ cmd = '[[ -x "%s" ]] && [[ ! -d "%s" ]]' % (python_bin, python_bin)
++ result = raw_exec(repository_ctx, [get_bash_bin(repository_ctx), "-c", cmd])
++ if result.return_code == 1:
++ auto_config_fail("--define %s='%s' is not executable. Is it the python binary?" % (
++ PYTHON_BIN_PATH,
++ python_bin,
++ ))
++
++def _get_python_include(repository_ctx, python_bin):
++ """Gets the python include path."""
++ result = execute(
++ repository_ctx,
++ [
++ python_bin,
++ "-Wignore",
++ "-c",
++ "import importlib; " +
++ "import importlib.util; " +
++ "print(importlib.import_module('distutils.sysconfig').get_python_inc() " +
++ "if importlib.util.find_spec('distutils.sysconfig') " +
++ "else importlib.import_module('sysconfig').get_path('include'))",
++ ],
++ error_msg = "Problem getting python include path.",
++ error_details = ("Is the Python binary path set up right? " +
++ "(See ./configure or " + PYTHON_BIN_PATH + ".) " +
++ "Is distutils installed?"),
++ )
++ return result.stdout.splitlines()[0]
++
++def _get_python_import_lib_name(repository_ctx, python_bin):
++ """Get Python import library name (pythonXY.lib) on Windows."""
++ result = execute(
++ repository_ctx,
++ [
++ python_bin,
++ "-c",
++ "import sys;" +
++ 'print("python" + str(sys.version_info[0]) + ' +
++ ' str(sys.version_info[1]) + ".lib")',
++ ],
++ error_msg = "Problem getting python import library.",
++ error_details = ("Is the Python binary path set up right? " +
++ "(See ./configure or " + PYTHON_BIN_PATH + ".) "),
++ )
++ return result.stdout.splitlines()[0]
++
++def _get_numpy_include(repository_ctx, python_bin):
++ """Gets the numpy include path."""
++ return execute(
++ repository_ctx,
++ [
++ python_bin,
++ "-c",
++ "from __future__ import print_function;" +
++ "import numpy;" +
++ " print(numpy.get_include());",
++ ],
++ error_msg = "Problem getting numpy include path.",
++ error_details = "Is numpy installed?",
++ ).stdout.splitlines()[0]
++
+ def _create_local_python_repository(repository_ctx):
+ """Creates the repository containing files set up to build with Python."""
+
+@@ -15,14 +207,68 @@ def _create_local_python_repository(repository_ctx):
+ # function to be restarted with all previous state being lost. This
+ # can easily lead to a O(n^2) runtime in the number of labels.
+ build_tpl = repository_ctx.path(Label("//third_party/py:BUILD.tpl"))
++
++ python_bin = get_python_bin(repository_ctx)
++ _check_python_bin(repository_ctx, python_bin)
++ python_lib = _get_python_lib(repository_ctx, python_bin)
++ _check_python_lib(repository_ctx, python_lib)
++ python_include = _get_python_include(repository_ctx, python_bin)
++ numpy_include = _get_numpy_include(repository_ctx, python_bin) + "/numpy"
++ python_include_rule = _symlink_genrule_for_dir(
++ repository_ctx,
++ python_include,
++ "python_include",
++ "python_include",
++ )
++ python_import_lib_genrule = ""
++
++ # To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib
++ # See https://docs.python.org/3/extending/windows.html
++ if is_windows(repository_ctx):
++ python_bin = python_bin.replace("\\", "/")
++ python_include = _norm_path(python_include)
++ python_import_lib_name = _get_python_import_lib_name(repository_ctx, python_bin)
++ python_import_lib_src = python_include.rsplit("/", 1)[0] + "/libs/" + python_import_lib_name
++ python_import_lib_genrule = _symlink_genrule_for_dir(
++ repository_ctx,
++ None,
++ "",
++ "python_import_lib",
++ [python_import_lib_src],
++ [python_import_lib_name],
++ )
++ numpy_include_rule = _symlink_genrule_for_dir(
++ repository_ctx,
++ numpy_include,
++ "numpy_include/numpy",
++ "numpy_include",
++ )
++
+ platform_constraint = ""
+ if repository_ctx.attr.platform_constraint:
+ platform_constraint = "\"%s\"" % repository_ctx.attr.platform_constraint
+- repository_ctx.template("BUILD", build_tpl, {"%{PLATFORM_CONSTRAINT}": platform_constraint})
++ repository_ctx.template("BUILD", build_tpl, {
++ "%{PYTHON_BIN_PATH}": python_bin,
++ "%{PYTHON_INCLUDE_GENRULE}": python_include_rule,
++ "%{PYTHON_IMPORT_LIB_GENRULE}": python_import_lib_genrule,
++ "%{NUMPY_INCLUDE_GENRULE}": numpy_include_rule,
++ "%{PLATFORM_CONSTRAINT}": platform_constraint,
++ })
++
++def _create_remote_python_repository(repository_ctx, remote_config_repo):
++ """Creates pointers to a remotely configured repo set up to build with Python.
++ """
++ repository_ctx.template("BUILD", config_repo_label(remote_config_repo, ":BUILD"), {})
+
+ def _python_autoconf_impl(repository_ctx):
+ """Implementation of the python_autoconf repository rule."""
+- _create_local_python_repository(repository_ctx)
++ if get_host_environ(repository_ctx, TF_PYTHON_CONFIG_REPO) != None:
++ _create_remote_python_repository(
++ repository_ctx,
++ get_host_environ(repository_ctx, TF_PYTHON_CONFIG_REPO),
++ )
++ else:
++ _create_local_python_repository(repository_ctx)
+
+ _ENVIRONS = [
+ BAZEL_SH,
+@@ -32,6 +278,7 @@ _ENVIRONS = [
+
+ local_python_configure = repository_rule(
+ implementation = _create_local_python_repository,
++ environ = _ENVIRONS,
+ attrs = {
+ "environ": attr.string_dict(),
+ "platform_constraint": attr.string(),
+@@ -50,6 +297,7 @@ remote_python_configure = repository_rule(
+
+ python_configure = repository_rule(
+ implementation = _python_autoconf_impl,
++ environ = _ENVIRONS + [TF_PYTHON_CONFIG_REPO],
+ attrs = {
+ "platform_constraint": attr.string(),
+ },
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0013-installation-remove-cp_local_config_python.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0013-installation-remove-cp_local_config_python.patch
new file mode 100644
index 000000000000..d6c502878849
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0013-installation-remove-cp_local_config_python.patch
@@ -0,0 +1,68 @@
+From 9a0eb9b34277229370d8df8407e4b99c13a6da0f Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 22 Dec 2023 20:25:52 +0800
+Subject: [PATCH 13/13] installation: remove `cp_local_config_python`
+
+Revert https://github.com/tensorflow/tensorflow/commit/a034b3d48a9d3dbccff22800ab4b435a89f45103
+---
+ .../tools/pip_package/build_pip_package.sh | 25 -------------------
+ 1 file changed, 25 deletions(-)
+
+diff --git a/tensorflow/tools/pip_package/build_pip_package.sh b/tensorflow/tools/pip_package/build_pip_package.sh
+index 4a2d42bba58..af76ca4d978 100755
+--- a/tensorflow/tools/pip_package/build_pip_package.sh
++++ b/tensorflow/tools/pip_package/build_pip_package.sh
+@@ -47,22 +47,6 @@ function cp_external() {
+ cp "${src_dir}/local_config_cuda/cuda/cuda/cuda_config.h" "${dest_dir}/local_config_cuda/cuda/cuda/"
+ }
+
+-function cp_local_config_python() {
+- local src_dir=$1
+- local dest_dir=$2
+- pushd .
+- cd "$src_dir"
+- mkdir -p "${dest_dir}/local_config_python/numpy_include/"
+- cp -r "pypi_numpy/site-packages/numpy/core/include/numpy" "${dest_dir}/local_config_python/numpy_include/"
+- mkdir -p "${dest_dir}/local_config_python/python_include/"
+- if is_windows; then
+- cp -r python_*/include/* "${dest_dir}/local_config_python/python_include/"
+- else
+- cp -r python_*/include/python*/* "${dest_dir}/local_config_python/python_include/"
+- fi
+- popd
+-}
+-
+ function copy_xla_aot_runtime_sources() {
+ local src_dir=$1
+ local dst_dir=$2
+@@ -174,9 +158,6 @@ function prepare_src() {
+ cp_external \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.exe.runfiles \
+ "${EXTERNAL_INCLUDES}/"
+- cp_local_config_python \
+- bazel-bin/tensorflow/tools/pip_package/build_pip_package.exe.runfiles \
+- "${EXTERNAL_INCLUDES}/"
+ copy_xla_aot_runtime_sources \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.exe.runfiles/org_tensorflow \
+ "${XLA_AOT_RUNTIME_SOURCES}/"
+@@ -220,17 +201,11 @@ function prepare_src() {
+ cp_external \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
+ "${EXTERNAL_INCLUDES}"
+- cp_local_config_python \
+- bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
+- "${EXTERNAL_INCLUDES}"
+ else
+ # New-style runfiles structure (--nolegacy_external_runfiles).
+ cp_external \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
+ "${EXTERNAL_INCLUDES}"
+- cp_local_config_python \
+- bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
+- "${EXTERNAL_INCLUDES}"
+ fi
+ copy_xla_aot_runtime_sources \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow \
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.14.1-0014-Fixing-build-issue-with-Clang-16.patch b/sci-libs/tensorflow/files/tensorflow-2.14.1-0014-Fixing-build-issue-with-Clang-16.patch
new file mode 100644
index 000000000000..379aa7385df1
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.14.1-0014-Fixing-build-issue-with-Clang-16.patch
@@ -0,0 +1,25 @@
+From 9db05c2eb25372b3be4badb15aa67d19298aeaf4 Mon Sep 17 00:00:00 2001
+From: Ben Olson <matthew.olson@intel.com>
+Date: Tue, 8 Aug 2023 17:15:50 -0500
+Subject: [PATCH 14/14] Fixing build issue with Clang 16
+
+---
+ tensorflow/tsl/lib/io/cache.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tensorflow/tsl/lib/io/cache.h b/tensorflow/tsl/lib/io/cache.h
+index f894c5916d5..e49d09b7450 100644
+--- a/tensorflow/tsl/lib/io/cache.h
++++ b/tensorflow/tsl/lib/io/cache.h
+@@ -16,6 +16,8 @@ limitations under the License.
+ #ifndef TENSORFLOW_TSL_LIB_IO_CACHE_H_
+ #define TENSORFLOW_TSL_LIB_IO_CACHE_H_
+
++#include <cstdint>
++
+ #include "tensorflow/tsl/platform/stringpiece.h"
+
+ // A Cache is an interface that maps keys to values. It has internal
+--
+2.43.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch
new file mode 100644
index 000000000000..0143ea01cab7
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0001-WORKSPACE-add-rules-docker-http_archive-bazel-toolch.patch
@@ -0,0 +1,37 @@
+From c49a30cc3e2d96cbe97a7012ef89800af7a0c5e0 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:34:44 +0800
+Subject: [PATCH 01/13] WORKSPACE: add rules-docker http_archive,
+ bazel-toolchains uses git_repo
+
+git_repository() rules cannot pull from --distdir and fail when building
+without internet access. Use http_archive instead and pin the sha256
+hash as well.
+---
+ WORKSPACE | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/WORKSPACE b/WORKSPACE
+index 6a85ffeb29a..c10a2c4a482 100644
+--- a/WORKSPACE
++++ b/WORKSPACE
+@@ -1,5 +1,16 @@
+ workspace(name = "org_tensorflow")
+
++load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
++
++http_archive(
++ name = "io_bazel_rules_docker",
++ sha256 = "7d453450e1eb70e238eea6b31f4115607ec1200e91afea01c25f9804f37e39c8",
++ strip_prefix = "rules_docker-0.10.0",
++ urls = [
++ "https://github.com/bazelbuild/rules_docker/releases/download/v0.10.0/rules_docker-v0.10.0.tar.gz",
++ ],
++)
++
+ # We must initialize hermetic python first.
+ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch
new file mode 100644
index 000000000000..d3f1471f6dff
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0002-systemlib-Latest-absl-LTS-has-split-cord-libs.patch
@@ -0,0 +1,32 @@
+From 79f6530e6beb5ca25fd07245f251897bf60c85e2 Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Sun, 6 Feb 2022 00:13:56 -0800
+Subject: [PATCH 02/13] systemlib: Latest absl LTS has split cord libs
+
+---
+ third_party/absl/system.absl.strings.BUILD | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/third_party/absl/system.absl.strings.BUILD b/third_party/absl/system.absl.strings.BUILD
+index fa9a7a84f67..63bac99d71b 100644
+--- a/third_party/absl/system.absl.strings.BUILD
++++ b/third_party/absl/system.absl.strings.BUILD
+@@ -26,7 +26,14 @@ cc_library(
+
+ cc_library(
+ name = "cord",
+- linkopts = ["-labsl_cord"],
++ linkopts = [
++ "-labsl_cord",
++ "-labsl_cord_internal",
++ "-labsl_cordz_functions",
++ "-labsl_cordz_handle",
++ "-labsl_cordz_info",
++ "-labsl_cordz_sample_token",
++ ],
+ deps = [
+ ":str_format",
+ "//absl/container:compressed_tuple",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch
new file mode 100644
index 000000000000..5ffab1f6c269
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0003-mkl_dnn-Must-link-against-libm-for-round-and-log2.patch
@@ -0,0 +1,29 @@
+From 51b47cec16b0818d47086b629fb361f90cca284a Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Mon, 5 Sep 2022 12:52:44 -0700
+Subject: [PATCH 03/13] mkl_dnn: Must link against libm for round and log2
+
+---
+ third_party/mkl_dnn/mkldnn_v1.BUILD | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/third_party/mkl_dnn/mkldnn_v1.BUILD b/third_party/mkl_dnn/mkldnn_v1.BUILD
+index e25a66db664..4185df77f3d 100644
+--- a/third_party/mkl_dnn/mkldnn_v1.BUILD
++++ b/third_party/mkl_dnn/mkldnn_v1.BUILD
+@@ -165,9 +165,9 @@ cc_library(
+ includes = _INCLUDES_LIST,
+ # TODO(penpornk): Use lrt_if_needed from tensorflow.bzl instead.
+ linkopts = select({
+- "@local_tsl//tsl:linux_aarch64": ["-lrt"],
+- "@local_tsl//tsl:linux_x86_64": ["-lrt"],
+- "@local_tsl//tsl:linux_ppc64le": ["-lrt"],
++ "@local_tsl//tsl:linux_aarch64": ["-lrt", "-lm"],
++ "@local_tsl//tsl:linux_x86_64": ["-lrt", "-lm"],
++ "@local_tsl//tsl:linux_ppc64le": ["-lrt", "-lm"],
+ "//conditions:default": [],
+ }),
+ textual_hdrs = _TEXTUAL_HDRS_LIST,
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch
new file mode 100644
index 000000000000..d540ee2c03ce
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0004-tensorflow_cc-Add-systemlib-nsync-linkopts.patch
@@ -0,0 +1,35 @@
+From e9d513bbb40004ff25a9809eb99e32958e8e3b82 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:42:48 +0800
+Subject: [PATCH 04/13] tensorflow_cc: Add systemlib nsync linkopts
+
+Linkopts dont get propagated up to the shared library correctly so
+workaround by applying them directly
+---
+ tensorflow/BUILD | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tensorflow/BUILD b/tensorflow/BUILD
+index f72931217b3..ffbe65fdc61 100644
+--- a/tensorflow/BUILD
++++ b/tensorflow/BUILD
+@@ -6,6 +6,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
+ load("@bazel_skylib//lib:selects.bzl", "selects")
+ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "bool_setting")
+ load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
++load("@local_config_syslibs//:build_defs.bzl", "if_system_lib")
+ load(
+ "//tensorflow:tensorflow.bzl",
+ "VERSION",
+@@ -1324,7 +1325,7 @@ tf_cc_shared_library(
+ "-z defs",
+ "-Wl,--version-script,$(location //tensorflow:tf_version_script.lds)",
+ ],
+- }),
++ }) + if_system_lib("nsync", ["-lnsync_cpp"]),
+ per_os_targets = True,
+ roots = [
+ "//tensorflow/c:c_api",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch
new file mode 100644
index 000000000000..520f4bcf9a68
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0005-systemlib-Updates-for-Abseil-20220623-LTS.patch
@@ -0,0 +1,71 @@
+From b43d73336a9209717adb038ca1fe3a808d3ce36e Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Tue, 30 May 2023 09:10:03 -0700
+Subject: [PATCH 05/13] systemlib: Updates for Abseil 20220623 LTS
+
+These targets are header-only and just need stub bazel targets
+---
+ third_party/absl/system.absl.functional.BUILD | 22 +++++++++++++++++++
+ third_party/absl/system.absl.random.BUILD | 12 ++++++++++
+ 2 files changed, 34 insertions(+)
+
+diff --git a/third_party/absl/system.absl.functional.BUILD b/third_party/absl/system.absl.functional.BUILD
+index a4f70acf35c..579181dec07 100644
+--- a/third_party/absl/system.absl.functional.BUILD
++++ b/third_party/absl/system.absl.functional.BUILD
+@@ -2,10 +2,32 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
+
+ package(default_visibility = ["//visibility:public"])
+
++cc_library(
++ name = "any_invocable",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/meta:type_traits",
++ "//absl/utility",
++ ],
++)
++
+ cc_library(
+ name = "bind_front",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/container:compressed_tuple",
++ "//absl/meta:type_traits",
++ "//absl/utility",
++ ],
+ )
+
+ cc_library(
+ name = "function_ref",
++ deps = [
++ "//absl/base:base_internal",
++ "//absl/base:core_headers",
++ "//absl/meta:type_traits",
++ ],
+ )
+diff --git a/third_party/absl/system.absl.random.BUILD b/third_party/absl/system.absl.random.BUILD
+index 948de07751a..5ebd656be8e 100644
+--- a/third_party/absl/system.absl.random.BUILD
++++ b/third_party/absl/system.absl.random.BUILD
+@@ -51,3 +51,15 @@ cc_library(
+ "//absl/types:span",
+ ],
+ )
++
++cc_library(
++ name = "bit_gen_ref",
++ deps = [
++ ":random",
++ "//absl/base:core_headers",
++ "//absl/base:fast_type_id",
++ "//absl/meta:type_traits",
++ "//absl/random/internal:distribution_caller",
++ "//absl/random/internal:fast_uniform_bits",
++ ],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0006-systemlib-Update-targets-for-absl_py.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0006-systemlib-Update-targets-for-absl_py.patch
new file mode 100644
index 000000000000..79c9773e2b5a
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0006-systemlib-Update-targets-for-absl_py.patch
@@ -0,0 +1,24 @@
+From d12cf2b464f129c8aeb513c34304c117e5384ffd Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:48:15 +0800
+Subject: [PATCH 06/13] systemlib: Update targets for absl_py
+
+---
+ third_party/systemlibs/absl_py.absl.flags.BUILD | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/third_party/systemlibs/absl_py.absl.flags.BUILD b/third_party/systemlibs/absl_py.absl.flags.BUILD
+index d92f4949df1..614938fb8c4 100644
+--- a/third_party/systemlibs/absl_py.absl.flags.BUILD
++++ b/third_party/systemlibs/absl_py.absl.flags.BUILD
+@@ -8,4 +8,7 @@ py_library(
+
+ py_library(
+ name = "argparse_flags",
++ deps = [
++ ":flags",
++ ],
+ )
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0007-systemlib-Add-well_known_types_py_pb2-target.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0007-systemlib-Add-well_known_types_py_pb2-target.patch
new file mode 100644
index 000000000000..6a6c722da38f
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0007-systemlib-Add-well_known_types_py_pb2-target.patch
@@ -0,0 +1,28 @@
+From e5c0870dda44361c1d3ffdf8a0adc549ba16444a Mon Sep 17 00:00:00 2001
+From: Jason Zaman <jason@perfinion.com>
+Date: Sat, 3 Jun 2023 16:23:51 -0700
+Subject: [PATCH 07/13] systemlib: Add well_known_types_py_pb2 target
+
+Bug: https://github.com/tensorflow/tensorflow/issues/60667
+---
+ third_party/systemlibs/protobuf.BUILD | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
+index 4d05ab28d12..b3d72b0e3ad 100644
+--- a/third_party/systemlibs/protobuf.BUILD
++++ b/third_party/systemlibs/protobuf.BUILD
+@@ -111,3 +111,10 @@ py_library(
+ visibility = ["//visibility:public"],
+ deps = [dep + "_proto" for dep in proto[1][1]],
+ ) for proto in WELL_KNOWN_PROTO_MAP.items()]
++
++py_proto_library(
++ name = "well_known_types_py_pb2",
++ include = ".",
++ srcs = [proto[1][0] for proto in WELL_KNOWN_PROTO_MAP.items()],
++ visibility = ["//visibility:public"],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0008-Relax-setup.py-version-requirements.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0008-Relax-setup.py-version-requirements.patch
new file mode 100644
index 000000000000..949805fd77e7
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0008-Relax-setup.py-version-requirements.patch
@@ -0,0 +1,86 @@
+From fada9b72dc55a016cc702e50fd688a6e9d53793e Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 24 Nov 2023 16:54:18 +0800
+Subject: [PATCH 08/13] Relax setup.py version requirements
+
+---
+ tensorflow/tools/pip_package/setup.py | 42 +++++++++++++--------------
+ 1 file changed, 21 insertions(+), 21 deletions(-)
+
+diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py
+index b416731380f..a21f566ee4d 100644
+--- a/tensorflow/tools/pip_package/setup.py
++++ b/tensorflow/tools/pip_package/setup.py
+@@ -88,8 +88,8 @@ REQUIRED_PACKAGES = [
+ 'gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2',
+ 'google_pasta >= 0.1.1',
+ 'h5py >= 2.9.0',
+- 'libclang >= 13.0.0',
+- 'ml_dtypes ~= 0.2.0',
++ # 'libclang >= 13.0.0',
++ 'ml_dtypes >= 0.2.0',
+ 'numpy >= 1.23.5, < 2.0.0',
+ 'opt_einsum >= 2.3.2',
+ 'packaging',
+@@ -101,8 +101,8 @@ REQUIRED_PACKAGES = [
+ 'six >= 1.12.0',
+ 'termcolor >= 1.1.0',
+ 'typing_extensions >= 3.6.6',
+- 'wrapt >= 1.11.0, < 1.15',
+- 'tensorflow-io-gcs-filesystem >= 0.23.1',
++ 'wrapt >= 1.11.0',
++ # 'tensorflow-io-gcs-filesystem >= 0.23.1',
+ # grpcio does not build correctly on big-endian machines due to lack of
+ # BoringSSL support.
+ # See https://github.com/tensorflow/tensorflow/issues/17882.
+@@ -135,8 +135,8 @@ FAKE_REQUIRED_PACKAGES = [
+ _VERSION + ';platform_system=="Windows"',
+ ]
+
+-if platform.system() == 'Linux' and platform.machine() == 'x86_64':
+- REQUIRED_PACKAGES.append(FAKE_REQUIRED_PACKAGES)
++# if platform.system() == 'Linux' and platform.machine() == 'x86_64':
++# REQUIRED_PACKAGES.append(FAKE_REQUIRED_PACKAGES)
+
+ if collaborator_build:
+ # If this is a collaborator build, then build an "installer" wheel and
+@@ -163,21 +163,21 @@ if collaborator_build:
+ EXTRA_PACKAGES = {}
+ EXTRA_PACKAGES['and-cuda'] = [
+ # TODO(nluehr): set nvidia-* versions based on build components.
+- 'nvidia-cublas-cu12 == 12.2.5.6',
+- 'nvidia-cuda-cupti-cu12 == 12.2.142',
+- 'nvidia-cuda-nvcc-cu12 == 12.2.140',
+- 'nvidia-cuda-nvrtc-cu12 == 12.2.140',
+- 'nvidia-cuda-runtime-cu12 == 12.2.140',
+- 'nvidia-cudnn-cu12 == 8.9.4.25',
+- 'nvidia-cufft-cu12 == 11.0.8.103',
+- 'nvidia-curand-cu12 == 10.3.3.141',
+- 'nvidia-cusolver-cu12 == 11.5.2.141',
+- 'nvidia-cusparse-cu12 == 12.1.2.141',
+- 'nvidia-nccl-cu12 == 2.16.5',
+- 'nvidia-nvjitlink-cu12 == 12.2.140',
+- 'tensorrt == 8.6.1.post1',
+- 'tensorrt-bindings == 8.6.1',
+- 'tensorrt-libs == 8.6.1',
++ 'nvidia-cublas-cu12 >= 12.2.5.6',
++ 'nvidia-cuda-cupti-cu12 >= 12.2.142',
++ 'nvidia-cuda-nvcc-cu12 >= 12.2.140',
++ 'nvidia-cuda-nvrtc-cu12 >= 12.2.140',
++ 'nvidia-cuda-runtime-cu12 >= 12.2.140',
++ 'nvidia-cudnn-cu12 >= 8.9.4.25',
++ 'nvidia-cufft-cu12 >= 11.0.8.103',
++ 'nvidia-curand-cu12 >= 10.3.3.141',
++ 'nvidia-cusolver-cu12 >= 11.5.2.141',
++ 'nvidia-cusparse-cu12 >= 12.1.2.141',
++ 'nvidia-nccl-cu12 >= 2.16.5',
++ 'nvidia-nvjitlink-cu12 >= 12.2.140',
++ 'tensorrt >= 8.6.1.post1',
++ 'tensorrt-bindings >= 8.6.1',
++ 'tensorrt-libs >= 8.6.1',
+ ]
+
+ DOCLINES = __doc__.split('\n')
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0009-systemlib-update-targets-for-absl.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0009-systemlib-update-targets-for-absl.patch
new file mode 100644
index 000000000000..4cbce75b96de
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0009-systemlib-update-targets-for-absl.patch
@@ -0,0 +1,365 @@
+From de3fc37567b3b135ee45c2ca8bd2256ea53812e8 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Sun, 26 Nov 2023 13:12:20 +0800
+Subject: [PATCH 09/13] systemlib: update targets for absl
+
+---
+ .../compiler/mlir/tools/kernel_gen/BUILD | 1 +
+ .../distribute/experimental/rpc/kernels/BUILD | 1 +
+ third_party/absl/system.absl.debugging.BUILD | 20 +-
+ third_party/absl/system.absl.log.BUILD | 271 ++++++++++++++++++
+ third_party/absl/workspace.bzl | 1 +
+ 5 files changed, 289 insertions(+), 5 deletions(-)
+ create mode 100644 third_party/absl/system.absl.log.BUILD
+
+diff --git a/tensorflow/compiler/mlir/tools/kernel_gen/BUILD b/tensorflow/compiler/mlir/tools/kernel_gen/BUILD
+index e6ce181074d..ff3f65fb551 100644
+--- a/tensorflow/compiler/mlir/tools/kernel_gen/BUILD
++++ b/tensorflow/compiler/mlir/tools/kernel_gen/BUILD
+@@ -107,6 +107,7 @@ tf_cc_binary(
+ "//tensorflow/compiler/mlir/tensorflow",
+ "//tensorflow/core:lib",
+ "@com_google_absl//absl/status",
++ "@com_google_absl//absl/log:check",
+ "@com_google_absl//absl/strings",
+ "@llvm-project//llvm:AArch64CodeGen", # fixdeps: keep
+ "@llvm-project//llvm:ARMCodeGen", # fixdeps: keep
+diff --git a/tensorflow/distribute/experimental/rpc/kernels/BUILD b/tensorflow/distribute/experimental/rpc/kernels/BUILD
+index 60fa55c7702..6527914c51d 100644
+--- a/tensorflow/distribute/experimental/rpc/kernels/BUILD
++++ b/tensorflow/distribute/experimental/rpc/kernels/BUILD
+@@ -64,6 +64,7 @@ tf_kernel_library(
+ "//tensorflow/distribute/experimental/rpc/proto:tf_rpc_service_proto_cc",
+ "@com_github_grpc_grpc//:grpc++",
+ "@com_google_absl//absl/status",
++ "@com_google_absl//absl/log:check",
+ "@com_google_absl//absl/strings",
+ "@com_google_absl//absl/strings:str_format",
+ "@local_xla//xla/stream_executor/platform",
+diff --git a/third_party/absl/system.absl.debugging.BUILD b/third_party/absl/system.absl.debugging.BUILD
+index 931ffdc9e92..223db7b4c46 100644
+--- a/third_party/absl/system.absl.debugging.BUILD
++++ b/third_party/absl/system.absl.debugging.BUILD
+@@ -26,15 +26,25 @@ cc_library(
+
+ cc_library(
+ name = "failure_signal_handler",
+- linkopts = [
+- "-labsl_failure_signal_handler",
+- "-labsl_examine_stack",
++ linkopts = ["-labsl_failure_signal_handler"],
++ deps = [
++ ":examine_stack",
++ ":stacktrace",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
+ ],
++)
++
++cc_library(
++ name = "examine_stack",
++ linkopts = ["-labsl_examine_stack"],
+ deps = [
+ ":stacktrace",
+ ":symbolize",
+- "//absl/base",
+- "//absl/base:errno_saver",
++ "//absl/base:config",
++ "//absl/base:core_headers",
+ "//absl/base:raw_logging_internal",
+ ],
+ )
+diff --git a/third_party/absl/system.absl.log.BUILD b/third_party/absl/system.absl.log.BUILD
+new file mode 100644
+index 00000000000..9a2a5de657e
+--- /dev/null
++++ b/third_party/absl/system.absl.log.BUILD
+@@ -0,0 +1,271 @@
++load("@rules_cc//cc:defs.bzl", "cc_library")
++
++package(default_visibility = ["//visibility:public"])
++
++cc_library(
++ name = "log",
++ deps = [
++ "//absl/log:internal_log_impl",
++ ],
++)
++
++cc_library(
++ name = "internal_log_impl",
++ deps = [
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ ],
++)
++
++cc_library(
++ name = "internal_conditions",
++ linkopts = ["-labsl_log_internal_conditions"],
++ deps = [
++ ":internal_voidify",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_voidify",
++ deps = ["//absl/base:config"],
++)
++
++cc_library(
++ name = "internal_message",
++ linkopts = ["-labsl_log_internal_message"],
++ deps = [
++ ":entry",
++ ":globals",
++ ":internal_append_truncated",
++ ":internal_format",
++ ":internal_globals",
++ ":internal_log_sink_set",
++ ":internal_nullguard",
++ ":internal_proto",
++ ":severity",
++ ":sink",
++ ":sink_registry",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:errno_saver",
++ "//absl/base:raw_logging_internal",
++ "//absl/base:strerror",
++ "//absl/container:inlined_vector",
++ "//absl/debugging:examine_stack",
++ "//absl/memory",
++ "//absl/strings",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_append_truncated",
++ deps = [
++ "//absl/base:config",
++ "//absl/strings",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_format",
++ linkopts = ["-labsl_log_internal_format"],
++ deps = [
++ ":internal_append_truncated",
++ ":internal_config",
++ ":internal_globals",
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/strings:str_format",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_globals",
++ linkopts = ["-labsl_log_internal_globals"],
++ deps = [
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/strings",
++ "//absl/time",
++ ],
++)
++
++cc_library(
++ name = "internal_proto",
++ linkopts = ["-labsl_log_internal_proto"],
++ deps = [
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_log_sink_set",
++ linkopts = ["-labsl_log_internal_log_sink_set"],
++ deps = [
++ ":entry",
++ ":globals",
++ ":internal_config",
++ ":internal_globals",
++ ":severity",
++ ":sink",
++ "//absl/base",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/cleanup",
++ "//absl/strings",
++ "//absl/synchronization",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "internal_config",
++ deps = [
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_nullguard",
++ linkopts = ["-labsl_log_internal_nullguard"],
++ deps = [
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "globals",
++ linkopts = ["-labsl_log_globals"],
++ deps = [
++ ":severity",
++ "//absl/base:atomic_hook",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/base:raw_logging_internal",
++ "//absl/hash",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "entry",
++ linkopts = ["-labsl_log_entry"],
++ deps = [
++ ":internal_config",
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ "//absl/time",
++ "//absl/types:span",
++ ],
++)
++
++cc_library(
++ name = "severity",
++ linkopts = ["-labsl_log_severity"],
++ deps = ["//absl/base:core_headers"],
++)
++
++cc_library(
++ name = "sink",
++ linkopts = ["-labsl_log_sink"],
++ deps = [
++ ":entry",
++ "//absl/base:config",
++ ],
++)
++
++cc_library(
++ name = "sink_registry",
++ deps = [
++ ":internal_log_sink_set",
++ ":sink",
++ "//absl/base:config",
++ ],
++)
++
++cc_library(
++ name = "internal_strip",
++ deps = [
++ ":internal_message",
++ ":internal_nullstream",
++ ":severity",
++ ],
++)
++
++cc_library(
++ name = "internal_nullstream",
++ deps = [
++ ":severity",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "check",
++ deps = [
++ ":internal_check_impl",
++ ":internal_check_op",
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_check_impl",
++ deps = [
++ ":internal_check_op",
++ ":internal_conditions",
++ ":internal_message",
++ ":internal_strip",
++ "//absl/base:core_headers",
++ ],
++)
++
++cc_library(
++ name = "internal_check_op",
++ linkopts = ["-labsl_log_internal_check_op"],
++ deps = [
++ ":internal_nullguard",
++ ":internal_nullstream",
++ ":internal_strip",
++ "//absl/base:config",
++ "//absl/base:core_headers",
++ "//absl/strings",
++ ],
++)
++
++cc_library(
++ name = "absl_check",
++ deps = [":internal_check_impl"],
++)
++
++cc_library(
++ name = "absl_log",
++ deps = [":internal_log_impl"],
++)
+diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl
+index 07f49cebb78..a7f4e5ffc44 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",
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0010-systemlib-fix-missing-osx-in-pybind11.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0010-systemlib-fix-missing-osx-in-pybind11.patch
new file mode 100644
index 000000000000..4e77e14577d1
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0010-systemlib-fix-missing-osx-in-pybind11.patch
@@ -0,0 +1,25 @@
+From 0c2e7e4e987aea6759e66f49b471b89d1cc01269 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Thu, 21 Dec 2023 22:22:35 +0800
+Subject: [PATCH 10/13] systemlib: fix missing `:osx` in pybind11
+
+---
+ third_party/systemlibs/pybind11.BUILD | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/third_party/systemlibs/pybind11.BUILD b/third_party/systemlibs/pybind11.BUILD
+index 79a483d7b5d..cda63fbd019 100644
+--- a/third_party/systemlibs/pybind11.BUILD
++++ b/third_party/systemlibs/pybind11.BUILD
+@@ -6,3 +6,8 @@ cc_library(
+ "@org_tensorflow//third_party/python_runtime:headers",
+ ],
+ )
++
++config_setting(
++ name = "osx",
++ constraint_values = ["@platforms//os:osx"],
++)
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch
new file mode 100644
index 000000000000..ec6e9ef3e36f
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0011-systemlib-fix-missing-LICENSE-in-flatbuffers.patch
@@ -0,0 +1,25 @@
+From c582286b732a820b29f1c03e2fa2c4aa61a4af03 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Thu, 21 Dec 2023 22:24:24 +0800
+Subject: [PATCH 11/13] systemlib: fix missing `LICENSE` in flatbuffers
+
+---
+ third_party/flatbuffers/BUILD.system | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/third_party/flatbuffers/BUILD.system b/third_party/flatbuffers/BUILD.system
+index 8fe4d7a5907..b1d63b4ca0f 100644
+--- a/third_party/flatbuffers/BUILD.system
++++ b/third_party/flatbuffers/BUILD.system
+@@ -1,7 +1,7 @@
+ licenses(["notice"]) # Apache 2.0
+
+ filegroup(
+- name = "LICENSE.txt",
++ name = "LICENSE",
+ visibility = ["//visibility:public"],
+ )
+
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0012-installation-remove-cp_local_config_python.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0012-installation-remove-cp_local_config_python.patch
new file mode 100644
index 000000000000..e78efd2e9944
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0012-installation-remove-cp_local_config_python.patch
@@ -0,0 +1,68 @@
+From 90ad87a2d71522412ec80f7f7025d828354a6e20 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 22 Dec 2023 20:25:52 +0800
+Subject: [PATCH 12/13] installation: remove `cp_local_config_python`
+
+Revert https://github.com/tensorflow/tensorflow/commit/a034b3d48a9d3dbccff22800ab4b435a89f45103
+---
+ .../tools/pip_package/build_pip_package.sh | 25 -------------------
+ 1 file changed, 25 deletions(-)
+
+diff --git a/tensorflow/tools/pip_package/build_pip_package.sh b/tensorflow/tools/pip_package/build_pip_package.sh
+index 423a79bff78..d8ae485803c 100755
+--- a/tensorflow/tools/pip_package/build_pip_package.sh
++++ b/tensorflow/tools/pip_package/build_pip_package.sh
+@@ -47,22 +47,6 @@ function cp_external() {
+ cp "${src_dir}/local_config_cuda/cuda/cuda/cuda_config.h" "${dest_dir}/local_config_cuda/cuda/cuda/"
+ }
+
+-function cp_local_config_python() {
+- local src_dir=$1
+- local dest_dir=$2
+- pushd .
+- cd "$src_dir"
+- mkdir -p "${dest_dir}/local_config_python/numpy_include/"
+- cp -r "pypi_numpy/site-packages/numpy/core/include/numpy" "${dest_dir}/local_config_python/numpy_include/"
+- mkdir -p "${dest_dir}/local_config_python/python_include/"
+- if is_windows; then
+- cp -r python_*/include/* "${dest_dir}/local_config_python/python_include/"
+- else
+- cp -r python_*/include/python*/* "${dest_dir}/local_config_python/python_include/"
+- fi
+- popd
+-}
+-
+ function copy_xla_aot_runtime_sources() {
+ local src_dir=$1
+ local dst_dir=$2
+@@ -179,9 +163,6 @@ function prepare_src() {
+ cp_external \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.exe.runfiles \
+ "${EXTERNAL_INCLUDES}/"
+- cp_local_config_python \
+- bazel-bin/tensorflow/tools/pip_package/build_pip_package.exe.runfiles \
+- "${EXTERNAL_INCLUDES}/"
+ copy_xla_aot_runtime_sources \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.exe.runfiles/org_tensorflow \
+ "${XLA_AOT_RUNTIME_SOURCES}/"
+@@ -242,17 +223,11 @@ function prepare_src() {
+ cp_external \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
+ "${EXTERNAL_INCLUDES}"
+- cp_local_config_python \
+- bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
+- "${EXTERNAL_INCLUDES}"
+ else
+ # New-style runfiles structure (--nolegacy_external_runfiles).
+ cp_external \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
+ "${EXTERNAL_INCLUDES}"
+- cp_local_config_python \
+- bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
+- "${EXTERNAL_INCLUDES}"
+ fi
+ copy_xla_aot_runtime_sources \
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow \
+--
+2.41.0
+
diff --git a/sci-libs/tensorflow/files/tensorflow-2.15.0-0013-build-use-non-hermetic-python.patch b/sci-libs/tensorflow/files/tensorflow-2.15.0-0013-build-use-non-hermetic-python.patch
new file mode 100644
index 000000000000..e36a3a0617be
--- /dev/null
+++ b/sci-libs/tensorflow/files/tensorflow-2.15.0-0013-build-use-non-hermetic-python.patch
@@ -0,0 +1,990 @@
+From 0b56f871d620371e1deb66822aa8fb6df68dc568 Mon Sep 17 00:00:00 2001
+From: wangjiezhe <wangjiezhe@gmail.com>
+Date: Fri, 22 Dec 2023 21:23:14 +0800
+Subject: [PATCH 13/13] build: use non-hermetic python
+
+---
+ WORKSPACE | 69 -------------------
+ tensorflow/BUILD | 2 -
+ tensorflow/compiler/mlir/glob_lit_test.bzl | 1 -
+ tensorflow/compiler/mlir/tfr/BUILD | 2 -
+ tensorflow/dtensor/python/tests/BUILD | 1 -
+ tensorflow/lite/python/BUILD | 1 -
+ tensorflow/python/BUILD | 1 -
+ tensorflow/python/autograph/converters/BUILD | 11 ---
+ tensorflow/python/autograph/core/BUILD | 1 -
+ tensorflow/python/autograph/pyct/BUILD | 23 -------
+ .../autograph/pyct/common_transformers/BUILD | 2 -
+ .../autograph/pyct/static_analysis/BUILD | 6 --
+ .../python/autograph/pyct/testing/BUILD | 1 -
+ tensorflow/python/client/BUILD | 1 -
+ tensorflow/python/compiler/tensorrt/BUILD | 1 -
+ .../experimental/kernel_tests/service/BUILD | 1 -
+ tensorflow/python/data/util/BUILD | 2 -
+ tensorflow/python/debug/lib/BUILD | 1 -
+ tensorflow/python/distribute/BUILD | 5 --
+ .../python/distribute/experimental/rpc/BUILD | 1 -
+ .../python/distribute/failure_handling/BUILD | 2 -
+ tensorflow/python/eager/BUILD | 2 -
+ tensorflow/python/estimator/BUILD | 4 +-
+ tensorflow/python/framework/BUILD | 7 --
+ tensorflow/python/keras/BUILD | 1 -
+ tensorflow/python/keras/engine/BUILD | 1 -
+ tensorflow/python/keras/saving/BUILD | 1 -
+ tensorflow/python/ops/BUILD | 2 -
+ tensorflow/python/profiler/BUILD | 1 -
+ .../python/profiler/integration_test/BUILD | 1 -
+ tensorflow/python/summary/BUILD | 1 -
+ tensorflow/python/trackable/BUILD | 1 -
+ tensorflow/python/types/BUILD | 2 -
+ tensorflow/python/util/BUILD | 3 -
+ tensorflow/tools/docs/BUILD | 3 -
+ third_party/xla/xla/glob_lit_test.bzl | 5 --
+ third_party/xla/xla/mlir_hlo/tests/BUILD | 1 -
+ 37 files changed, 2 insertions(+), 169 deletions(-)
+
+diff --git a/WORKSPACE b/WORKSPACE
+index c10a2c4a482..3626ae4e805 100644
+--- a/WORKSPACE
++++ b/WORKSPACE
+@@ -11,75 +11,6 @@ http_archive(
+ ],
+ )
+
+-# We must initialize hermetic python first.
+-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+-
+-http_archive(
+- name = "bazel_skylib",
+- sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
+- urls = [
+- "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
+- "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
+- ],
+-)
+-
+-http_archive(
+- name = "rules_python",
+- sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b",
+- strip_prefix = "rules_python-0.26.0",
+- url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
+-)
+-
+-load("@rules_python//python:repositories.bzl", "py_repositories")
+-
+-py_repositories()
+-
+-load("@rules_python//python:repositories.bzl", "python_register_toolchains")
+-load(
+- "//tensorflow/tools/toolchains/python:python_repo.bzl",
+- "python_repository",
+-)
+-
+-python_repository(name = "python_version_repo")
+-
+-load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION")
+-
+-python_register_toolchains(
+- name = "python",
+- ignore_root_user_error = True,
+- python_version = HERMETIC_PYTHON_VERSION,
+-)
+-
+-load("@python//:defs.bzl", "interpreter")
+-load("@rules_python//python:pip.bzl", "package_annotation", "pip_parse")
+-
+-NUMPY_ANNOTATIONS = {
+- "numpy": package_annotation(
+- additive_build_content = """\
+-filegroup(
+- name = "includes",
+- srcs = glob(["site-packages/numpy/core/include/**/*.h"]),
+-)
+-cc_library(
+- name = "numpy_headers",
+- hdrs = [":includes"],
+- strip_include_prefix="site-packages/numpy/core/include/",
+-)
+-""",
+- ),
+-}
+-
+-pip_parse(
+- name = "pypi",
+- annotations = NUMPY_ANNOTATIONS,
+- python_interpreter_target = interpreter,
+- requirements = "//:requirements_lock_" + HERMETIC_PYTHON_VERSION.replace(".", "_") + ".txt",
+-)
+-
+-load("@pypi//:requirements.bzl", "install_deps")
+-
+-install_deps()
+-
+ # Initialize the TensorFlow repository and all dependencies.
+ #
+ # The cascade of load() statements and tf_workspace?() calls works around the
+diff --git a/tensorflow/BUILD b/tensorflow/BUILD
+index ffbe65fdc61..cd9d61797e8 100644
+--- a/tensorflow/BUILD
++++ b/tensorflow/BUILD
+@@ -1712,8 +1712,6 @@ py_library(
+ "//tensorflow/lite/python:lite",
+ "//tensorflow/lite/python/authoring",
+ "//tensorflow/python:no_contrib",
+- "@pypi_keras//:pkg",
+- "@pypi_tensorboard//:pkg",
+ ],
+ )
+ # copybara:comment_end
+diff --git a/tensorflow/compiler/mlir/glob_lit_test.bzl b/tensorflow/compiler/mlir/glob_lit_test.bzl
+index e689b4c0b31..f65c86b727b 100644
+--- a/tensorflow/compiler/mlir/glob_lit_test.bzl
++++ b/tensorflow/compiler/mlir/glob_lit_test.bzl
+@@ -58,7 +58,6 @@ def _run_lit_test(name, data, size, tags, driver, features, exec_properties):
+ "@llvm-project//llvm:count",
+ "@llvm-project//llvm:not",
+ ],
+- deps = ["@pypi_lit//:pkg"],
+ size = size,
+ main = "lit.py",
+ exec_properties = exec_properties,
+diff --git a/tensorflow/compiler/mlir/tfr/BUILD b/tensorflow/compiler/mlir/tfr/BUILD
+index f8dfcd1c0a6..9f13d2eb068 100644
+--- a/tensorflow/compiler/mlir/tfr/BUILD
++++ b/tensorflow/compiler/mlir/tfr/BUILD
+@@ -387,7 +387,6 @@ py_strict_library(
+ "//tensorflow/python/framework:op_def_registry",
+ "//tensorflow/python/platform:tf_logging",
+ "//tensorflow/python/util:tf_inspect",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -421,7 +420,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:transpiler",
+ "//tensorflow/python/framework:op_def_registry",
+ "//tensorflow/python/util:tf_inspect",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/dtensor/python/tests/BUILD b/tensorflow/dtensor/python/tests/BUILD
+index 498642cb5ff..e4482821869 100644
+--- a/tensorflow/dtensor/python/tests/BUILD
++++ b/tensorflow/dtensor/python/tests/BUILD
+@@ -326,7 +326,6 @@ pytype_strict_library(
+ ":test_util",
+ "//tensorflow/python/platform:client_testlib",
+ "@absl_py//absl/flags",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/lite/python/BUILD b/tensorflow/lite/python/BUILD
+index 3ac3bb20eba..c37bbc385f1 100644
+--- a/tensorflow/lite/python/BUILD
++++ b/tensorflow/lite/python/BUILD
+@@ -310,7 +310,6 @@ py_strict_test(
+ "//tensorflow/python/trackable:autotrackable",
+ "//third_party/py/numpy",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_jax//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
+index 9810f8acd2e..056534591a3 100644
+--- a/tensorflow/python/BUILD
++++ b/tensorflow/python/BUILD
+@@ -589,7 +589,6 @@ py_strict_library(
+ deps = [
+ ":keras_lib",
+ "//third_party/py/numpy",
+- "@pypi_scipy//:pkg",
+ "@six_archive//:six",
+ ],
+ )
+diff --git a/tensorflow/python/autograph/converters/BUILD b/tensorflow/python/autograph/converters/BUILD
+index 5624f7611f3..11bc2cd9deb 100644
+--- a/tensorflow/python/autograph/converters/BUILD
++++ b/tensorflow/python/autograph/converters/BUILD
+@@ -13,7 +13,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/core:converter",
+ "//tensorflow/python/autograph/lang:directives",
+ "//tensorflow/python/autograph/pyct:templates",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -39,7 +38,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/core:converter",
+ "//tensorflow/python/autograph/pyct:parser",
+ "//tensorflow/python/autograph/pyct:templates",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -65,7 +63,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/core:converter",
+ "//tensorflow/python/autograph/pyct:parser",
+ "//tensorflow/python/autograph/pyct:templates",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -80,7 +77,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:qual_names",
+ "//tensorflow/python/autograph/pyct:templates",
+ "//tensorflow/python/autograph/utils:ag_logging",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -93,7 +89,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/lang:directives",
+ "//tensorflow/python/autograph/pyct:anno",
+ "//tensorflow/python/util:tf_inspect",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -105,7 +100,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/core:converter",
+ "//tensorflow/python/autograph/pyct:anno",
+ "//tensorflow/python/autograph/pyct:templates",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -127,7 +121,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct/static_analysis:liveness",
+ "//tensorflow/python/autograph/pyct/static_analysis:reaching_definitions",
+ "//tensorflow/python/autograph/pyct/static_analysis:reaching_fndefs",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -143,7 +136,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:templates",
+ "//tensorflow/python/autograph/pyct/static_analysis:activity",
+ "//tensorflow/python/autograph/pyct/static_analysis:annos",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -160,7 +152,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:templates",
+ "//tensorflow/python/autograph/pyct/static_analysis:activity",
+ "//tensorflow/python/autograph/pyct/static_analysis:annos",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -176,7 +167,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:templates",
+ "//tensorflow/python/autograph/pyct/static_analysis:activity",
+ "//tensorflow/python/autograph/pyct/static_analysis:annos",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -187,7 +177,6 @@ py_strict_library(
+ deps = [
+ "//tensorflow/python/autograph/core:converter",
+ "//tensorflow/python/autograph/pyct:templates",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/autograph/core/BUILD b/tensorflow/python/autograph/core/BUILD
+index 46983ab39f0..3ccdc20293c 100644
+--- a/tensorflow/python/autograph/core/BUILD
++++ b/tensorflow/python/autograph/core/BUILD
+@@ -37,7 +37,6 @@ py_strict_library(
+ visibility = ["//tensorflow:__subpackages__"],
+ deps = [
+ "//tensorflow/python/autograph/pyct:errors",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/autograph/pyct/BUILD b/tensorflow/python/autograph/pyct/BUILD
+index 949d841e00c..31d4b026460 100644
+--- a/tensorflow/python/autograph/pyct/BUILD
++++ b/tensorflow/python/autograph/pyct/BUILD
+@@ -14,7 +14,6 @@ py_strict_library(
+ ":ast_util",
+ ":parser",
+ ":qual_names",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -32,7 +31,6 @@ py_strict_library(
+ ":templates",
+ ":transformer",
+ "//tensorflow/python/autograph/utils:ag_logging",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -44,7 +42,6 @@ py_strict_library(
+ ":anno",
+ ":parser",
+ ":qual_names",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -62,7 +59,6 @@ py_strict_library(
+ name = "gast_util",
+ srcs = ["gast_util.py"],
+ visibility = ["//visibility:public"],
+- deps = ["@pypi_gast//:pkg"],
+ )
+
+ py_strict_library(
+@@ -79,8 +75,6 @@ py_strict_library(
+ ":errors",
+ ":inspect_utils",
+ "//tensorflow/python/util:tf_inspect",
+- "@pypi_astunparse//:pkg",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -108,7 +102,6 @@ py_strict_library(
+ ":parser",
+ ":pretty_printer",
+ "//tensorflow/python/util:tf_inspect",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -116,7 +109,6 @@ py_strict_library(
+ name = "anno",
+ srcs = ["anno.py"],
+ visibility = ["//visibility:public"],
+- deps = ["@pypi_gast//:pkg"],
+ )
+
+ py_strict_library(
+@@ -134,7 +126,6 @@ py_strict_library(
+ ":parser",
+ ":pretty_printer",
+ ":templates",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -145,7 +136,6 @@ py_strict_library(
+ deps = [
+ ":anno",
+ ":parser",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -155,8 +145,6 @@ py_strict_library(
+ visibility = ["//visibility:public"],
+ deps = [
+ ":anno",
+- "@pypi_astunparse//:pkg",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -180,10 +168,6 @@ py_strict_library(
+ name = "pretty_printer",
+ srcs = ["pretty_printer.py"],
+ visibility = ["//visibility:public"],
+- deps = [
+- "@pypi_gast//:pkg",
+- "@pypi_termcolor//:pkg",
+- ],
+ )
+
+ py_strict_test(
+@@ -210,7 +194,6 @@ py_strict_test(
+ ":pretty_printer",
+ ":qual_names",
+ "//tensorflow/python/platform:client_testlib",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -234,7 +217,6 @@ py_strict_test(
+ ":cfg",
+ ":parser",
+ "//tensorflow/python/platform:client_testlib",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -250,7 +232,6 @@ py_strict_test(
+ ":pretty_printer",
+ "//tensorflow/python/platform:client_testlib",
+ "//tensorflow/python/util:tf_inspect",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -325,7 +306,6 @@ py_strict_test(
+ ":parser",
+ ":pretty_printer",
+ "//tensorflow/python/platform:client_testlib",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -365,7 +345,6 @@ py_strict_test(
+ ":templates",
+ "//tensorflow/python/platform:client_testlib",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -380,7 +359,6 @@ py_strict_test(
+ ":parser",
+ ":transformer",
+ "//tensorflow/python/platform:client_testlib",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -393,6 +371,5 @@ py_strict_test(
+ ":transformer",
+ ":transpiler",
+ "//tensorflow/python/platform:client_testlib",
+- "@pypi_gast//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/autograph/pyct/common_transformers/BUILD b/tensorflow/python/autograph/pyct/common_transformers/BUILD
+index 2be00498cf7..b9da2f210c9 100644
+--- a/tensorflow/python/autograph/pyct/common_transformers/BUILD
++++ b/tensorflow/python/autograph/pyct/common_transformers/BUILD
+@@ -16,7 +16,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:gast_util",
+ "//tensorflow/python/autograph/pyct:templates",
+ "//tensorflow/python/autograph/pyct:transformer",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -32,6 +31,5 @@ py_strict_test(
+ "//tensorflow/python/autograph/pyct:parser",
+ "//tensorflow/python/autograph/pyct:transformer",
+ "//tensorflow/python/platform:client_testlib",
+- "@pypi_gast//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/autograph/pyct/static_analysis/BUILD b/tensorflow/python/autograph/pyct/static_analysis/BUILD
+index 4329523b056..9c643ccd63c 100644
+--- a/tensorflow/python/autograph/pyct/static_analysis/BUILD
++++ b/tensorflow/python/autograph/pyct/static_analysis/BUILD
+@@ -14,7 +14,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:anno",
+ "//tensorflow/python/autograph/pyct:cfg",
+ "//tensorflow/python/autograph/pyct:transformer",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -26,7 +25,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:anno",
+ "//tensorflow/python/autograph/pyct:cfg",
+ "//tensorflow/python/autograph/pyct:transformer",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -56,7 +54,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:anno",
+ "//tensorflow/python/autograph/pyct:qual_names",
+ "//tensorflow/python/autograph/pyct:transformer",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -71,7 +68,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:cfg",
+ "//tensorflow/python/autograph/pyct:qual_names",
+ "//tensorflow/python/autograph/pyct:transformer",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -83,7 +79,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct:anno",
+ "//tensorflow/python/autograph/pyct:cfg",
+ "//tensorflow/python/autograph/pyct:transformer",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+@@ -107,7 +102,6 @@ py_strict_test(
+ "//tensorflow/python/autograph/pyct:qual_names",
+ "//tensorflow/python/autograph/pyct:transformer",
+ "//tensorflow/python/platform:client_testlib",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/autograph/pyct/testing/BUILD b/tensorflow/python/autograph/pyct/testing/BUILD
+index 21a6775b0fb..fcac2065ca0 100644
+--- a/tensorflow/python/autograph/pyct/testing/BUILD
++++ b/tensorflow/python/autograph/pyct/testing/BUILD
+@@ -15,7 +15,6 @@ py_strict_library(
+ deps = [
+ "//tensorflow/python/autograph/pyct:templates",
+ "//third_party/py/numpy",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/client/BUILD b/tensorflow/python/client/BUILD
+index c13a6122f41..77bc522a758 100644
+--- a/tensorflow/python/client/BUILD
++++ b/tensorflow/python/client/BUILD
+@@ -294,7 +294,6 @@ py_strict_library(
+ "//tensorflow/python/util:nest",
+ "//tensorflow/python/util:tf_export",
+ "//third_party/py/numpy",
+- "@pypi_wrapt//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/compiler/tensorrt/BUILD b/tensorflow/python/compiler/tensorrt/BUILD
+index f3ca24c9a4b..ee086bdaed2 100644
+--- a/tensorflow/python/compiler/tensorrt/BUILD
++++ b/tensorflow/python/compiler/tensorrt/BUILD
+@@ -69,7 +69,6 @@ py_strict_library(
+ "//tensorflow/python/util:nest",
+ "//tensorflow/python/util:tf_export",
+ "//third_party/py/numpy",
+- "@pypi_packaging//:pkg",
+ "@six_archive//:six",
+ ],
+ )
+diff --git a/tensorflow/python/data/experimental/kernel_tests/service/BUILD b/tensorflow/python/data/experimental/kernel_tests/service/BUILD
+index cfac30fe0db..355a558bc93 100644
+--- a/tensorflow/python/data/experimental/kernel_tests/service/BUILD
++++ b/tensorflow/python/data/experimental/kernel_tests/service/BUILD
+@@ -143,7 +143,6 @@ tf_py_strict_test(
+ "//tensorflow/python/ops:array_ops",
+ "//tensorflow/python/platform:client_testlib",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/data/util/BUILD b/tensorflow/python/data/util/BUILD
+index f7298a6f66b..cef29c3d992 100644
+--- a/tensorflow/python/data/util/BUILD
++++ b/tensorflow/python/data/util/BUILD
+@@ -94,7 +94,6 @@ py_strict_library(
+ "//tensorflow/python/util:deprecation",
+ "//tensorflow/python/util:nest_util",
+ "//tensorflow/python/util:tf_export",
+- "@pypi_wrapt//:pkg",
+ ],
+ )
+
+@@ -125,7 +124,6 @@ py_strict_test(
+ "//tensorflow/python/util:compat",
+ "//third_party/py/numpy",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_wrapt//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/debug/lib/BUILD b/tensorflow/python/debug/lib/BUILD
+index 37c99b30dd2..012e349dffc 100644
+--- a/tensorflow/python/debug/lib/BUILD
++++ b/tensorflow/python/debug/lib/BUILD
+@@ -596,7 +596,6 @@ py_strict_library(
+ "//tensorflow/python/lib/io:lib",
+ "//tensorflow/python/ops:variables",
+ "//tensorflow/python/util:compat",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/distribute/BUILD b/tensorflow/python/distribute/BUILD
+index 0c233b2b4a4..19b496f427a 100644
+--- a/tensorflow/python/distribute/BUILD
++++ b/tensorflow/python/distribute/BUILD
+@@ -523,7 +523,6 @@ cuda_py_strict_test(
+ "//tensorflow/python/ops:variable_scope",
+ "//third_party/py/numpy",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_dill//:pkg", # build_cleaner: keep
+ ],
+ )
+
+@@ -1440,7 +1439,6 @@ cuda_py_strict_test(
+ "//tensorflow/python/ops:math_ops",
+ "//tensorflow/python/util:nest",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_dill//:pkg", # build_cleaner: keep
+ ],
+ )
+
+@@ -1764,7 +1762,6 @@ distribute_py_strict_test(
+ "//tensorflow/python/ops:variable_v1",
+ "//tensorflow/python/saved_model/model_utils:mode_keys",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_wrapt//:pkg",
+ ],
+ )
+
+@@ -2295,8 +2292,6 @@ py_strict_library(
+ "//tensorflow/python/framework:test_lib",
+ "//tensorflow/python/util:tf_export",
+ "@absl_py//absl/logging",
+- "@pypi_dill//:pkg", # build_cleaner: keep
+- "@pypi_tblib//:pkg", # build_cleaner: keep
+ "@six_archive//:six",
+ ],
+ )
+diff --git a/tensorflow/python/distribute/experimental/rpc/BUILD b/tensorflow/python/distribute/experimental/rpc/BUILD
+index 3a3682cd6cf..8ed343db636 100644
+--- a/tensorflow/python/distribute/experimental/rpc/BUILD
++++ b/tensorflow/python/distribute/experimental/rpc/BUILD
+@@ -60,6 +60,5 @@ tf_py_strict_test(
+ "//tensorflow/python/ops:variables",
+ "//tensorflow/python/platform:client_testlib",
+ "//tensorflow/python/util:nest",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/distribute/failure_handling/BUILD b/tensorflow/python/distribute/failure_handling/BUILD
+index c9af884fbb7..3aaad5eced1 100644
+--- a/tensorflow/python/distribute/failure_handling/BUILD
++++ b/tensorflow/python/distribute/failure_handling/BUILD
+@@ -47,7 +47,6 @@ py_strict_library(
+ deps = [
+ "//tensorflow/python/eager:context",
+ "//tensorflow/python/platform:tf_logging",
+- "@pypi_requests//:pkg",
+ "@six_archive//:six",
+ ],
+ )
+@@ -134,7 +133,6 @@ tf_py_strict_test(
+ "//tensorflow/python/platform:tf_logging",
+ "//tensorflow/python/training:server_lib",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_dill//:pkg", # build_cleaner: keep
+ ],
+ )
+
+diff --git a/tensorflow/python/eager/BUILD b/tensorflow/python/eager/BUILD
+index e72f54c48fd..057bce876fd 100644
+--- a/tensorflow/python/eager/BUILD
++++ b/tensorflow/python/eager/BUILD
+@@ -1180,7 +1180,6 @@ cuda_py_strict_test(
+ "//tensorflow/python/training:server_lib",
+ "//tensorflow/python/util:compat",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+@@ -1320,7 +1319,6 @@ py_strict_library(
+ "//tensorflow/python/autograph/pyct/static_analysis:reaching_fndefs",
+ "//tensorflow/python/framework:op_def_registry",
+ "//tensorflow/python/framework:ops",
+- "@pypi_gast//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/estimator/BUILD b/tensorflow/python/estimator/BUILD
+index 73afdd8b239..7e58789cee5 100644
+--- a/tensorflow/python/estimator/BUILD
++++ b/tensorflow/python/estimator/BUILD
+@@ -382,7 +382,7 @@ py_library(
+ ],
+ )
+
+-alias(
++py_library(
+ name = "expect_tensorflow_estimator_installed",
+- actual = "@pypi_tensorflow_estimator//:pkg",
++ srcs_version = "PY3",
+ )
+diff --git a/tensorflow/python/framework/BUILD b/tensorflow/python/framework/BUILD
+index 9bfb9d2d9dd..19b43eab9ac 100644
+--- a/tensorflow/python/framework/BUILD
++++ b/tensorflow/python/framework/BUILD
+@@ -279,7 +279,6 @@ py_strict_library(
+ "//tensorflow/python/eager:execute",
+ "//tensorflow/security/fuzzing/py:annotation_types",
+ "//tensorflow/tools/docs:doc_controls",
+- "@pypi_typing_extensions//:pkg",
+ ],
+ )
+
+@@ -365,7 +364,6 @@ py_strict_library(
+ "//tensorflow/python/util:deprecation",
+ "//tensorflow/python/util:tf_export",
+ "//third_party/py/numpy",
+- "@pypi_packaging//:pkg",
+ ] + if_xla_available([
+ "//tensorflow/python:_pywrap_tfcompile",
+ ]),
+@@ -1760,7 +1758,6 @@ py_strict_library(
+ deps = [
+ ":composite_tensor",
+ "//tensorflow/python/util:nest",
+- "@pypi_typing_extensions//:pkg",
+ ],
+ )
+
+@@ -1788,7 +1785,6 @@ py_strict_library(
+ "//tensorflow/python/util:nest",
+ "//tensorflow/python/util:tf_decorator",
+ "//tensorflow/python/util:tf_export",
+- "@pypi_typing_extensions//:pkg",
+ ],
+ )
+
+@@ -1932,7 +1928,6 @@ pytype_strict_library(
+ "//tensorflow/python/lib/io:lib",
+ "//tensorflow/python/platform:tf_logging",
+ "//tensorflow/python/util:compat",
+- "@pypi_packaging//:pkg",
+ ],
+ )
+
+@@ -2185,7 +2180,6 @@ py_strict_library(
+ "//tensorflow/python/util/protobuf",
+ "//third_party/py/numpy",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+@@ -2781,7 +2775,6 @@ tf_py_strict_test(
+ "//tensorflow/python/util:nest",
+ "//tensorflow/python/util:tf_decorator",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_typing_extensions//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/keras/BUILD b/tensorflow/python/keras/BUILD
+index f9e31edae67..011cc3a73b8 100755
+--- a/tensorflow/python/keras/BUILD
++++ b/tensorflow/python/keras/BUILD
+@@ -44,7 +44,6 @@ py_library(
+ "//tensorflow/python/saved_model",
+ "//tensorflow/python/training",
+ "//tensorflow/python/util:nest",
+- "@pypi_h5py//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/keras/engine/BUILD b/tensorflow/python/keras/engine/BUILD
+index a24dc27b25f..1b95ca18d06 100644
+--- a/tensorflow/python/keras/engine/BUILD
++++ b/tensorflow/python/keras/engine/BUILD
+@@ -95,7 +95,6 @@ py_library(
+ "//tensorflow/python/util:tf_decorator",
+ "//tensorflow/python/util:tf_export",
+ "//tensorflow/tools/docs:doc_controls",
+- "@pypi_h5py//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/keras/saving/BUILD b/tensorflow/python/keras/saving/BUILD
+index db1d2d814ca..b37abc164b3 100644
+--- a/tensorflow/python/keras/saving/BUILD
++++ b/tensorflow/python/keras/saving/BUILD
+@@ -55,6 +55,5 @@ py_library(
+ "//tensorflow/python/platform:tf_logging",
+ "//tensorflow/python/saved_model",
+ "//tensorflow/python/training:saver",
+- "@pypi_h5py//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/ops/BUILD b/tensorflow/python/ops/BUILD
+index b3a3d612a01..c242923f832 100644
+--- a/tensorflow/python/ops/BUILD
++++ b/tensorflow/python/ops/BUILD
+@@ -2780,7 +2780,6 @@ py_strict_library(
+ "//tensorflow/python/util:dispatch",
+ "//tensorflow/python/util:tf_export",
+ "//third_party/py/numpy",
+- "@pypi_opt_einsum//:pkg",
+ ],
+ )
+
+@@ -3872,7 +3871,6 @@ cuda_py_strict_test(
+ "//tensorflow/python/platform:tf_logging",
+ "//third_party/py/numpy",
+ "@absl_py//absl/testing:parameterized",
+- "@pypi_opt_einsum//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/profiler/BUILD b/tensorflow/python/profiler/BUILD
+index b1cfd6ea10c..9413aeeab8b 100644
+--- a/tensorflow/python/profiler/BUILD
++++ b/tensorflow/python/profiler/BUILD
+@@ -43,7 +43,6 @@ cuda_py_strict_test(
+ "//tensorflow/python/eager:test",
+ "//tensorflow/python/framework:errors",
+ "//tensorflow/python/framework:test_lib",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/profiler/integration_test/BUILD b/tensorflow/python/profiler/integration_test/BUILD
+index b20698ea6ea..e7060e5a315 100644
+--- a/tensorflow/python/profiler/integration_test/BUILD
++++ b/tensorflow/python/profiler/integration_test/BUILD
+@@ -35,6 +35,5 @@ cuda_py_strict_test(
+ "//tensorflow/python/platform:tf_logging",
+ "//tensorflow/python/profiler:profiler_client",
+ "//tensorflow/python/profiler:profiler_v2",
+- "@pypi_portpicker//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/summary/BUILD b/tensorflow/python/summary/BUILD
+index 126fb6d31f7..b292e39356f 100644
+--- a/tensorflow/python/summary/BUILD
++++ b/tensorflow/python/summary/BUILD
+@@ -121,6 +121,5 @@ tf_py_strict_test(
+ "//tensorflow/python/ops:summary_ops_v2",
+ "//tensorflow/python/platform:client_testlib",
+ "//tensorflow/python/training:training_util",
+- "@pypi_tensorboard//:pkg",
+ ],
+ )
+diff --git a/tensorflow/python/trackable/BUILD b/tensorflow/python/trackable/BUILD
+index 30efc64b5fd..2e2390a6643 100644
+--- a/tensorflow/python/trackable/BUILD
++++ b/tensorflow/python/trackable/BUILD
+@@ -225,7 +225,6 @@ py_strict_library(
+ "//tensorflow/python/ops:variables",
+ "//tensorflow/python/util:compat",
+ "//tensorflow/python/util:tf_export",
+- "@pypi_wrapt//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/types/BUILD b/tensorflow/python/types/BUILD
+index c04dc039153..43a030a051e 100644
+--- a/tensorflow/python/types/BUILD
++++ b/tensorflow/python/types/BUILD
+@@ -24,7 +24,6 @@ pytype_strict_library(
+ "//tensorflow/python/util:_pywrap_utils",
+ "//tensorflow/python/util:tf_export",
+ "//third_party/py/numpy",
+- "@pypi_typing_extensions//:pkg",
+ ],
+ )
+
+@@ -71,7 +70,6 @@ pytype_strict_library(
+ ":core",
+ "//tensorflow/python/util:tf_export",
+ "//tensorflow/tools/docs:doc_controls",
+- "@pypi_typing_extensions//:pkg",
+ ],
+ )
+
+diff --git a/tensorflow/python/util/BUILD b/tensorflow/python/util/BUILD
+index d1e7d626a1d..248eb23bcfe 100644
+--- a/tensorflow/python/util/BUILD
++++ b/tensorflow/python/util/BUILD
+@@ -732,7 +732,6 @@ py_strict_library(
+ # py_test because not all tensorflow tests use tensorflow.bzl's py_test.
+ "//tensorflow/python:global_test_configuration",
+ "@six_archive//:six",
+- "@pypi_wrapt//:pkg",
+ "//tensorflow/python:pywrap_tensorflow",
+ ":_pywrap_utils",
+ ],
+@@ -893,7 +892,6 @@ py_strict_library(
+ # py_test because not all tensorflow tests use tensorflow.bzl's py_test.
+ "//tensorflow/python:global_test_configuration",
+ "//third_party/py/numpy",
+- "@pypi_wrapt//:pkg",
+ ],
+ )
+
+@@ -1029,7 +1027,6 @@ py_strict_library(
+ # py_test because not all tensorflow tests use tensorflow.bzl's py_test.
+ "//tensorflow/python:global_test_configuration",
+ ":tf_export",
+- "@pypi_wrapt//:pkg",
+ ":_pywrap_utils",
+ ":_pywrap_nest",
+ ],
+diff --git a/tensorflow/tools/docs/BUILD b/tensorflow/tools/docs/BUILD
+index aa9490cf911..48e45b23a2a 100644
+--- a/tensorflow/tools/docs/BUILD
++++ b/tensorflow/tools/docs/BUILD
+@@ -137,7 +137,6 @@ py_strict_library(
+ srcs = ["fenced_doctest_lib.py"],
+ deps = [
+ ":tf_doctest_lib",
+- "@pypi_astor//:pkg",
+ ],
+ )
+
+@@ -178,7 +177,6 @@ py_strict_test(
+ # copybara:uncomment "//third_party/py/tensorflow:tensorflow_estimator",
+ "//tensorflow:tensorflow_py",
+ "//tensorflow/python/platform:test",
+- "@pypi_packaging//:pkg",
+ ],
+ )
+
+@@ -214,7 +212,6 @@ py_strict_library(
+ "//tensorflow/python/util:tf_inspect",
+ "@absl_py//absl:app",
+ "@absl_py//absl/flags",
+- "@pypi_packaging//:pkg",
+ ],
+ )
+
+diff --git a/third_party/xla/xla/glob_lit_test.bzl b/third_party/xla/xla/glob_lit_test.bzl
+index 79b4adc3edd..5893eba46c2 100644
+--- a/third_party/xla/xla/glob_lit_test.bzl
++++ b/third_party/xla/xla/glob_lit_test.bzl
+@@ -52,10 +52,6 @@ def _run_lit_test(name, data, size, tags, driver, features, exec_properties):
+ # can remove this logic. This is necessary to have these tests run on builds
+ # using Python 3.11, but also to not include `@pypi_lit` in standalone xla
+ # builds where it won't be found.
+- deps = []
+- if xla_root_dir == "tensorflow/compiler/xla/":
+- deps.append("@pypi_lit//:pkg")
+-
+ native.py_test(
+ name = name,
+ srcs = ["@llvm-project//llvm:lit"],
+@@ -69,7 +65,6 @@ def _run_lit_test(name, data, size, tags, driver, features, exec_properties):
+ "@llvm-project//llvm:count",
+ "@llvm-project//llvm:not",
+ ],
+- deps = deps,
+ size = size,
+ main = "lit.py",
+ exec_properties = exec_properties,
+diff --git a/third_party/xla/xla/mlir_hlo/tests/BUILD b/third_party/xla/xla/mlir_hlo/tests/BUILD
+index 89c6533956f..771d337be08 100644
+--- a/third_party/xla/xla/mlir_hlo/tests/BUILD
++++ b/third_party/xla/xla/mlir_hlo/tests/BUILD
+@@ -27,7 +27,6 @@ package(
+ tags = [
+ "nomsan", # The execution engine doesn't work with msan, see b/248097619.
+ ],
+- deps = ["@pypi_lit//:pkg"],
+ )
+ for src in glob(["**/*.mlir"])
+ ]
+--
+2.41.0
+