From f9c7da69d3bc991b62003fd120c9cbea940cfdcb Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Tue, 29 Aug 2023 16:57:46 -0500 Subject: [PATCH] changes for consistent absl version --- .../def_file_filter/def_file_filter.py.tpl | 4 +- ...m_google_absl_fix_mac_and_nvcc_build.patch | 267 ------------------ third_party/absl/workspace.bzl | 6 +- 3 files changed, 4 insertions(+), 273 deletions(-) delete mode 100644 third_party/absl/com_google_absl_fix_mac_and_nvcc_build.patch diff --git a/tensorflow/tools/def_file_filter/def_file_filter.py.tpl b/tensorflow/tools/def_file_filter/def_file_filter.py.tpl index 444c2d151abbaa..7dc9517678b46e 100644 --- a/tensorflow/tools/def_file_filter/def_file_filter.py.tpl +++ b/tensorflow/tools/def_file_filter/def_file_filter.py.tpl @@ -292,8 +292,8 @@ def main(): def_fp.write("\t ??_7ConfigProto@tensorflow@@6B@\n") # for _pywrap_tfe def_fp.write("\t ??_7CoordinatedTask@tensorflow@@6B@\n") # for _pywrap_tfe def_fp.write("\t ?InternalSwap@CoordinatedTask@tensorflow@@AEAAXPEAV12@@Z\n") # for _pywrap_tfe - def_fp.write("\t ?kSeed@MixingHashState@hash_internal@lts_20220623@absl@@0QEBXEB\n") # for _pywrap_tfcompile - def_fp.write("\t ?kEmptyGroup@container_internal@lts_20220623@absl@@3QBW4ctrl_t@123@B\n") # for _pywrap_tfcompile + def_fp.write("\t ?kSeed@MixingHashState@hash_internal@lts_20230125@absl@@0QEBXEB\n") # for _pywrap_tfcompile + def_fp.write("\t ?kEmptyGroup@container_internal@lts_20230125@absl@@3QBW4ctrl_t@123@B\n") # for _pywrap_tfcompile def_fp.write("\t ??_7GraphDef@tensorflow@@6B@\n") def_fp.write("\t ??_7DeviceProperties@tensorflow@@6B@\n") def_fp.write("\t ??_7MetaGraphDef@tensorflow@@6B@\n") diff --git a/third_party/absl/com_google_absl_fix_mac_and_nvcc_build.patch b/third_party/absl/com_google_absl_fix_mac_and_nvcc_build.patch deleted file mode 100644 index f5c03435b12f4a..00000000000000 --- a/third_party/absl/com_google_absl_fix_mac_and_nvcc_build.patch +++ /dev/null @@ -1,267 +0,0 @@ -diff --git a/absl/container/internal/compressed_tuple.h b/absl/container/internal/compressed_tuple.h -index 5ebe1649..01db7134 100644 ---- a/absl/container/internal/compressed_tuple.h -+++ b/absl/container/internal/compressed_tuple.h -@@ -32,7 +32,6 @@ - #ifndef ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_ - #define ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_ - --#include - #include - #include - #include -@@ -77,134 +76,61 @@ constexpr bool IsFinal() { - #endif - } - --// We can't use EBCO on other CompressedTuples because that would mean that we --// derive from multiple Storage<> instantiations with the same I parameter, --// and potentially from multiple identical Storage<> instantiations. So anytime --// we use type inheritance rather than encapsulation, we mark --// CompressedTupleImpl, to make this easy to detect. --struct uses_inheritance {}; -- - template - constexpr bool ShouldUseBase() { -- return std::is_class::value && std::is_empty::value && !IsFinal() && -- !std::is_base_of::value; -+ return std::is_class::value && std::is_empty::value && !IsFinal(); - } - - // The storage class provides two specializations: - // - For empty classes, it stores T as a base class. - // - For everything else, it stores T as a member. --template ::type>()> --#else -- bool UseBase = ShouldUseBase()> --#endif -+template >()> - struct Storage { -+ using T = ElemT; - T value; - constexpr Storage() = default; -- template -- explicit constexpr Storage(absl::in_place_t, V&& v) -- : value(absl::forward(v)) {} -+ explicit constexpr Storage(T&& v) : value(absl::forward(v)) {} - constexpr const T& get() const& { return value; } - T& get() & { return value; } - constexpr const T&& get() const&& { return absl::move(*this).value; } - T&& get() && { return std::move(*this).value; } - }; - --template --struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC Storage : T { -+template -+struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC Storage -+ : ElemT { -+ using T = internal_compressed_tuple::ElemT; - constexpr Storage() = default; -- -- template -- explicit constexpr Storage(absl::in_place_t, V&& v) -- : T(absl::forward(v)) {} -- -+ explicit constexpr Storage(T&& v) : T(absl::forward(v)) {} - constexpr const T& get() const& { return *this; } - T& get() & { return *this; } - constexpr const T&& get() const&& { return absl::move(*this); } - T&& get() && { return std::move(*this); } - }; - --template -+template - struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTupleImpl; - --template --struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTupleImpl< -- CompressedTuple, absl::index_sequence, ShouldAnyUseBase> -+template -+struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC -+ CompressedTupleImpl, absl::index_sequence> - // We use the dummy identity function through std::integral_constant to - // convince MSVC of accepting and expanding I in that context. Without it - // you would get: - // error C3548: 'I': parameter pack cannot be used in this context -- : uses_inheritance, -- Storage::value>... { -+ : Storage, -+ std::integral_constant::value>... { - constexpr CompressedTupleImpl() = default; -- template -- explicit constexpr CompressedTupleImpl(absl::in_place_t, Vs&&... args) -- : Storage(absl::in_place, absl::forward(args))... {} -- friend CompressedTuple; -+ explicit constexpr CompressedTupleImpl(Ts&&... args) -+ : Storage, I>(absl::forward(args))... {} - }; - --template --struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTupleImpl< -- CompressedTuple, absl::index_sequence, false> -- // We use the dummy identity function as above... -- : Storage::value, false>... { -- constexpr CompressedTupleImpl() = default; -- template -- explicit constexpr CompressedTupleImpl(absl::in_place_t, Vs&&... args) -- : Storage(absl::in_place, absl::forward(args))... {} -- friend CompressedTuple; --}; -- --std::false_type Or(std::initializer_list); --std::true_type Or(std::initializer_list); -- --// MSVC requires this to be done separately rather than within the declaration --// of CompressedTuple below. --template --constexpr bool ShouldAnyUseBase() { -- return decltype( -- Or({std::integral_constant()>()...})){}; --} -- --template --using TupleElementMoveConstructible = -- typename std::conditional::value, -- std::is_convertible, -- std::is_constructible>::type; -- --template --struct TupleMoveConstructible : std::false_type {}; -- --template --struct TupleMoveConstructible, Vs...> -- : std::integral_constant< -- bool, absl::conjunction< -- TupleElementMoveConstructible...>::value> {}; -- --template --struct compressed_tuple_size; -- --template --struct compressed_tuple_size> -- : public std::integral_constant {}; -- --template --struct TupleItemsMoveConstructible -- : std::integral_constant< -- bool, TupleMoveConstructible::value == -- sizeof...(Vs), -- T, Vs...>::value> {}; -- - } // namespace internal_compressed_tuple - - // Helper class to perform the Empty Base Class Optimization. - // Ts can contain classes and non-classes, empty or not. For the ones that - // are empty classes, we perform the CompressedTuple. If all types in Ts are --// empty classes, then CompressedTuple is itself an empty class. (This --// does not apply when one or more of those empty classes is itself an empty --// CompressedTuple.) -+// empty classes, then CompressedTuple is itself an empty class. - // - // To access the members, use member .get() function. - // -@@ -220,59 +146,36 @@ struct TupleItemsMoveConstructible - template - class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple - : private internal_compressed_tuple::CompressedTupleImpl< -- CompressedTuple, absl::index_sequence_for, -- internal_compressed_tuple::ShouldAnyUseBase()> { -+ CompressedTuple, absl::index_sequence_for> { - private: - template - using ElemT = internal_compressed_tuple::ElemT; - -- template -- using StorageT = internal_compressed_tuple::Storage, I>; -- - public: -- // There seems to be a bug in MSVC dealing in which using '=default' here will -- // cause the compiler to ignore the body of other constructors. The work- -- // around is to explicitly implement the default constructor. --#if defined(_MSC_VER) -- constexpr CompressedTuple() : CompressedTuple::CompressedTupleImpl() {} --#else - constexpr CompressedTuple() = default; --#endif -- explicit constexpr CompressedTuple(const Ts&... base) -- : CompressedTuple::CompressedTupleImpl(absl::in_place, base...) {} -- -- template )>>, -- internal_compressed_tuple::TupleItemsMoveConstructible< -- CompressedTuple, First, Vs...>>::value, -- bool> = true> -- explicit constexpr CompressedTuple(First&& first, Vs&&... base) -- : CompressedTuple::CompressedTupleImpl(absl::in_place, -- absl::forward(first), -- absl::forward(base)...) {} -+ explicit constexpr CompressedTuple(Ts... base) -+ : CompressedTuple::CompressedTupleImpl(absl::forward(base)...) {} - - template - ElemT& get() & { -- return StorageT::get(); -+ return internal_compressed_tuple::Storage::get(); - } - - template - constexpr const ElemT& get() const& { -- return StorageT::get(); -+ return internal_compressed_tuple::Storage::get(); - } - - template - ElemT&& get() && { -- return std::move(*this).StorageT::get(); -+ return std::move(*this) -+ .internal_compressed_tuple::template Storage::get(); - } - - template - constexpr const ElemT&& get() const&& { -- return absl::move(*this).StorageT::get(); -+ return absl::move(*this) -+ .internal_compressed_tuple::template Storage::get(); - } - }; - -diff --git a/absl/time/internal/cctz/BUILD.bazel b/absl/time/internal/cctz/BUILD.bazel -index 7304d40d..75d8e086 100644 ---- a/absl/time/internal/cctz/BUILD.bazel -+++ b/absl/time/internal/cctz/BUILD.bazel -@@ -72,15 +72,6 @@ cc_library( - "include/cctz/time_zone.h", - "include/cctz/zone_info_source.h", - ], -- linkopts = select({ -- ":osx": [ -- "-framework Foundation", -- ], -- ":ios": [ -- "-framework Foundation", -- ], -- "//conditions:default": [], -- }), - visibility = ["//visibility:public"], - deps = [ - ":civil_time", -diff --git a/absl/base/config.h b/absl/base/config.h -index 8533aea..07b4e80 100644 ---- a/absl/base/config.h.orig -+++ b/absl/base/config.h -@@ -906,7 +906,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || - // SIMD). - #ifdef ABSL_INTERNAL_HAVE_ARM_NEON - #error ABSL_INTERNAL_HAVE_ARM_NEON cannot be directly set --#elif defined(__ARM_NEON) -+#elif defined(__ARM_NEON) && !defined(__CUDACC__) - #define ABSL_INTERNAL_HAVE_ARM_NEON 1 - #endif - diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl index 8c8923f1008beb..82c0ceb0e66bea 100644 --- a/third_party/absl/workspace.bzl +++ b/third_party/absl/workspace.bzl @@ -7,8 +7,8 @@ def repo(): # Attention: tools parse and update these lines. # LINT.IfChange - ABSL_COMMIT = "273292d1cfc0a94a65082ee350509af1d113344d" - ABSL_SHA256 = "94aef187f688665dc299d09286bfa0d22c4ecb86a80b156dff6aabadc5a5c26d" + ABSL_COMMIT = "c2435f8342c2d0ed8101cb43adfd605fdc52dca2" + ABSL_SHA256 = "9892836ab0d3f099b8c15076c6f4168144f452d097bd49da215fe0df36a2d48c" # LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake) SYS_DIRS = [ @@ -42,8 +42,6 @@ def repo(): build_file = "//third_party/absl:com_google_absl.BUILD", system_build_file = "//third_party/absl:system.BUILD", system_link_files = SYS_LINKS, - # TODO(b/234139015): Remove the patch when https://github.com/abseil/abseil-cpp/issues/326 is resolved - patch_file = ["//third_party/absl:com_google_absl_fix_mac_and_nvcc_build.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)), )