Skip to content
Snippets Groups Projects
Commit 93a1c3d6 authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

feat(py-tensorflow): copy recipes from upstream@develop (2025-03-14)

parent 1b54bea2
No related branches found
No related tags found
No related merge requests found
From 2ea8d31a2a75de75f838b4650e1531c346dfa6fe Mon Sep 17 00:00:00 2001
From: sclarkson <sc@lambdal.com>
Date: Thu, 12 Aug 2021 03:23:28 -0700
Subject: [PATCH 8/8] Fix protobuf errors when using system protobuf
When tensorflow and python protobuf use the same instance of
libprotobuf, pywrap_tensorflow must be imported before anything
else that would import protobuf definitions.
---
tensorflow/python/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tensorflow/python/__init__.py b/tensorflow/python/__init__.py
index 6efba380ca0..38d1eb55027 100644
--- a/tensorflow/python/__init__.py
+++ b/tensorflow/python/__init__.py
@@ -37,8 +37,8 @@ import traceback
# go/tf-wildcard-import
# pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
-from tensorflow.python.eager import context
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
+from tensorflow.python.eager import context
# pylint: enable=wildcard-import
--
2.32.0
From 32321ebf22c32ed4bbc9f98b44f2a67fe6c86823 Mon Sep 17 00:00:00 2001
From: Andrew Elble <aweits@rit.edu>
Date: Wed, 1 May 2024 18:46:42 -0400
Subject: [PATCH] patch
---
third_party/absl/absl_neon.patch | 23 +++++++++++++++++++++++
third_party/absl/workspace.bzl | 1 +
2 files changed, 24 insertions(+)
create mode 100644 third_party/absl/absl_neon.patch
diff --git a/third_party/absl/absl_neon.patch b/third_party/absl/absl_neon.patch
new file mode 100644
index 000000000000..d4eb77bc3f86
--- /dev/null
+++ b/third_party/absl/absl_neon.patch
@@ -0,0 +1,23 @@
+From: Andrew Elble <aweits@rit.edu>
+Date: Thu, 25 Apr 2024 08:09:36 -0400
+Subject: [PATCH] fix
+
+---
+ absl/base/config.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/absl/base/config.h b/absl/base/config.h
+index 5fa9f0efe5a4..bfedf4e1d7bd 100644
+--- a/absl/base/config.h
++++ b/absl/base/config.h
+@@ -962,7 +962,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
+ // https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code
+ #ifdef ABSL_INTERNAL_HAVE_ARM_NEON
+ #error ABSL_INTERNAL_HAVE_ARM_NEON cannot be directly set
+-#elif defined(__ARM_NEON) && !defined(__CUDA_ARCH__)
++#elif defined(__ARM_NEON) && !(defined(__NVCC__) && defined(__CUDACC__))
+ #define ABSL_INTERNAL_HAVE_ARM_NEON 1
+ #endif
+
+--
+2.31.1
diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl
index 06f75166ce4b..56d146d65abe 100644
--- a/third_party/absl/workspace.bzl
+++ b/third_party/absl/workspace.bzl
@@ -42,6 +42,7 @@ def repo():
build_file = "//third_party/absl:com_google_absl.BUILD",
system_build_file = "//third_party/absl:system.BUILD",
system_link_files = SYS_LINKS,
+ patch_file = ["//third_party/absl:absl_neon.patch"],
strip_prefix = "abseil-cpp-{commit}".format(commit = ABSL_COMMIT),
urls = tf_mirror_urls("https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT)),
)
--
2.31.1
From ac0fca8559c2384240a00599a46816bbb5afb93f Mon Sep 17 00:00:00 2001
From: Thomas Dickerson <elfprince13@gmail.com>
Date: Tue, 11 Mar 2025 14:07:34 -0400
Subject: [PATCH] Allow empty configuration values to be supplied from
environment
For example it may be desirable for `CC_OPT_FLAGS` to be empty.
---
configure.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.py b/configure.py
index ec04fcfdd0cc67..ac19b856d7c914 100644
--- a/configure.py
+++ b/configure.py
@@ -529,7 +529,9 @@ def get_from_env_or_user_or_default(environ_cp, var_name, ask_for_var,
string value for var_name
"""
var = environ_cp.get(var_name)
- if not var:
+ # an intentionally empty value in the
+ # environment is not the same as no value
+ if var is None:
var = get_input(ask_for_var)
print('\n')
if not var:
--- a/tensorflow/core/kernels/example_parsing_ops.cc
+++ b/tensorflow/core/kernels/example_parsing_ops.cc
@@ -1218,7 +1218,7 @@ class DecodeJSONExampleOp : public OpKernel {
resolver_.get(), "type.googleapis.com/tensorflow.Example", &in, &out);
OP_REQUIRES(ctx, status.ok(),
errors::InvalidArgument("Error while parsing JSON: ",
- string(status.error_message())));
+ string(status.message())));
}
}
diff -ru a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl
--- a/third_party/gpus/cuda_configure.bzl 2021-05-12 13:26:41.000000000 +0000
+++ b/third_party/gpus/cuda_configure.bzl 2021-10-28 21:38:06.949271099 +0000
@@ -1205,10 +1205,7 @@
# TODO: when bazel stops adding '-B/usr/bin' by default, remove this
# flag from the CROSSTOOL completely (see
# https://github.com/bazelbuild/bazel/issues/5634)
- if should_download_clang:
- cuda_defines["%{linker_bin_path}"] = ""
- else:
- cuda_defines["%{linker_bin_path}"] = host_compiler_prefix
+ cuda_defines["%{linker_bin_path}"] = ""
cuda_defines["%{extra_no_canonical_prefixes_flags}"] = ""
cuda_defines["%{unfiltered_compile_flags}"] = ""
This diff is collapsed.
diff --git a/tensorflow/core/kernels/mlir_generated/build_defs.bzl b/tensorflow/core/kernels/mlir_generated/build_defs.bzl
index f574a8da8fd..fc1fbf68bf8 100644
--- a/tensorflow/core/kernels/mlir_generated/build_defs.bzl
+++ b/tensorflow/core/kernels/mlir_generated/build_defs.bzl
@@ -360,7 +360,7 @@ def _gen_kernel_library(
extra_args = extra_args,
host_triple = host_triple,
gpu_archs = gpu_archs,
- jit = jit,
+ jit = True,
mlir_op = "{op}_{name}_{platform}_{type}_{output_type}.mlir".format(
op = op,
name = name,
@@ -370,7 +370,7 @@ def _gen_kernel_library(
),
tile_size = typed_tile_size,
unroll_factors = typed_unroll_factors,
- jit_i64_indexed_for_large_tensors = jit_i64_indexed_for_large_tensors,
+ jit_i64_indexed_for_large_tensors = False,
)
# We have to use a sh_test instead of build_test because it doesn't properly find the dependent targets.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment