From 6e16af5e0a51cfde4ddc5845fb96c6064d515cc0 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Fri, 5 Apr 2024 06:41:46 +0900 Subject: [PATCH] [tensorflow-lite] Update to v2.15.1 (#187) * ci: test with vcpkg 2024.03.25 * https://github.com/microsoft/vcpkg/releases/tag/2024.03.25 * [tensorflow-lite] update to 2.15.1 * [tensorflow-lite] update baseline * [tensorflow-lite] fox sources for latest abseil * [tensorflow-lite] use msbuild in Windows * [tensorflow-lite] fix arm64-uwp build --- .github/workflows/build-macos.yml | 2 ++ .github/workflows/build-ubuntu.yml | 2 ++ .github/workflows/build-windows-cuda.yml | 2 +- .github/workflows/build-windows-hosted.yml | 2 +- .github/workflows/build-windows.yml | 2 ++ ports/tensorflow-lite/fix-cmake-vcpkg.patch | 28 +++++++++++++++ ports/tensorflow-lite/fix-source-abseil.patch | 36 +++++++++++++++++++ ports/tensorflow-lite/portfile.cmake | 8 +++-- ports/tensorflow-lite/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/t-/tensorflow-lite.json | 5 +++ 11 files changed, 84 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 03353471..226178cb 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -17,6 +17,8 @@ jobs: # vcpkg_commit: "53bef8994c541b6561884a8395ea35715ece75db" - vcpkg_tag: "2024.02.14" vcpkg_commit: "fba75d09065fcc76a25dcf386b1d00d33f5175af" + - vcpkg_tag: "2024.03.25" + vcpkg_commit: "a34c873a9717a888f58dc05268dea15592c2f0ff" fail-fast: false env: VCPKG_DOWNLOADS: "/usr/local/share/vcpkg-downloads" diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 0d51c511..803e8ecd 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -18,6 +18,8 @@ jobs: # vcpkg_commit: "c8696863d371ab7f46e213d8f5ca923c4aef2a00" - vcpkg_tag: "2024.02.14" vcpkg_commit: "fba75d09065fcc76a25dcf386b1d00d33f5175af" + - vcpkg_tag: "2024.03.25" + vcpkg_commit: "a34c873a9717a888f58dc05268dea15592c2f0ff" fail-fast: false env: VCPKG_OVERLAY_PORTS: "${{ github.workspace }}/ports" diff --git a/.github/workflows/build-windows-cuda.yml b/.github/workflows/build-windows-cuda.yml index 25a39705..e32fe7c3 100644 --- a/.github/workflows/build-windows-cuda.yml +++ b/.github/workflows/build-windows-cuda.yml @@ -28,7 +28,7 @@ jobs: - uses: lukka/run-vcpkg@v11.5 with: vcpkgDirectory: "C:/vcpkg" - vcpkgGitCommitId: "fba75d09065fcc76a25dcf386b1d00d33f5175af" # 2024.02.14 + vcpkgGitCommitId: "a34c873a9717a888f58dc05268dea15592c2f0ff" # 2024.03.25 vcpkgJsonGlob: "test/vcpkg.json" runVcpkgInstall: true runVcpkgFormatString: '[`install`, `--clean-buildtrees-after-build`, `--clean-packages-after-build`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`]' diff --git a/.github/workflows/build-windows-hosted.yml b/.github/workflows/build-windows-hosted.yml index ef3cf9f0..eabf64d3 100644 --- a/.github/workflows/build-windows-hosted.yml +++ b/.github/workflows/build-windows-hosted.yml @@ -26,7 +26,7 @@ jobs: - uses: lukka/run-vcpkg@v11.5 with: vcpkgDirectory: "C:/vcpkg" - vcpkgGitCommitId: "fba75d09065fcc76a25dcf386b1d00d33f5175af" # 2024.02.14 + vcpkgGitCommitId: "a34c873a9717a888f58dc05268dea15592c2f0ff" # 2024.03.25 vcpkgJsonGlob: "test/vcpkg.json" runVcpkgInstall: true runVcpkgFormatString: '[`install`, `--clean-buildtrees-after-build`, `--clean-packages-after-build`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`]' diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index bfbf5cf8..a28bd119 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -21,6 +21,8 @@ jobs: # vcpkg_commit: "53bef8994c541b6561884a8395ea35715ece75db" - vcpkg_tag: "2024.02.14" vcpkg_commit: "fba75d09065fcc76a25dcf386b1d00d33f5175af" + - vcpkg_tag: "2024.03.25" + vcpkg_commit: "a34c873a9717a888f58dc05268dea15592c2f0ff" fail-fast: false env: VCPKG_DOWNLOADS: "C:/vcpkg/downloads" diff --git a/ports/tensorflow-lite/fix-cmake-vcpkg.patch b/ports/tensorflow-lite/fix-cmake-vcpkg.patch index 522feb16..94d9a8a7 100644 --- a/ports/tensorflow-lite/fix-cmake-vcpkg.patch +++ b/ports/tensorflow-lite/fix-cmake-vcpkg.patch @@ -217,3 +217,31 @@ index 8a95d535..72155e4c 100644 # The kernel tests. if(TFLITE_KERNEL_TEST) enable_testing() +diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt +index 92b87da9..a0f91daf 100644 +--- a/tensorflow/lite/CMakeLists.txt ++++ b/tensorflow/lite/CMakeLists.txt +@@ -265,7 +265,22 @@ else() + endif() + + populate_tflite_source_vars("core" TFLITE_CORE_SRCS) +-populate_tflite_source_vars("core/acceleration/configuration" TFLITE_CORE_ACCELERATION_SRCS) ++populate_tflite_source_vars("core/acceleration/configuration" TFLITE_CORE_ACCELERATION_SRCS ++ FILTER "(nnapi).*\\.(cc|h)" ++) ++if(CMAKE_SYSTEM_NAME STREQUAL WindowsStore) ++ add_compile_definitions( ++ _SILENCE_CXX20_IS_POD_DEPRECATION_WARNING ++ _CRT_SECURE_NO_WARNINGS ++ _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING ++ _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING ++ ) ++elseif(ANDROID) ++ list(APPEND TFLITE_CORE_ACCELERATION_SRCS ++ ${TFLITE_SOURCE_DIR}/core/acceleration/configuration/nnapi_plugin.h ++ ${TFLITE_SOURCE_DIR}/core/acceleration/configuration/nnapi_plugin.cc ++ ) ++endif() + populate_tflite_source_vars("core/api" TFLITE_CORE_API_SRCS) + populate_tflite_source_vars("core/async" TFLITE_CORE_ASYNC_SRCS) + populate_tflite_source_vars("core/async/c" TFLITE_CORE_ASYNC_C_SRCS) diff --git a/ports/tensorflow-lite/fix-source-abseil.patch b/ports/tensorflow-lite/fix-source-abseil.patch index 0e3917f0..a83cda77 100644 --- a/ports/tensorflow-lite/fix-source-abseil.patch +++ b/ports/tensorflow-lite/fix-source-abseil.patch @@ -677,3 +677,39 @@ index 170e5e39..1a8a4126 100644 auto weights = attr.weights.shape; std::vector parameters = { +diff --git a/tensorflow/lite/delegates/gpu/cl/cl_operation.h b/tensorflow/lite/delegates/gpu/cl/cl_operation.h +index 11795234..09154de2 100644 +--- a/tensorflow/lite/delegates/gpu/cl/cl_operation.h ++++ b/tensorflow/lite/delegates/gpu/cl/cl_operation.h +@@ -22,6 +22,7 @@ limitations under the License. + #include + #include + ++#include "absl/strings/str_cat.h" + #include "tensorflow/lite/delegates/gpu/cl/cl_arguments.h" + #include "tensorflow/lite/delegates/gpu/cl/cl_command_queue.h" + #include "tensorflow/lite/delegates/gpu/cl/cl_context.h" +diff --git a/tensorflow/lite/delegates/gpu/common/task/qcom_thin_filter_desc.cc b/tensorflow/lite/delegates/gpu/common/task/qcom_thin_filter_desc.cc +index 03909221..ffcf1fb2 100644 +--- a/tensorflow/lite/delegates/gpu/common/task/qcom_thin_filter_desc.cc ++++ b/tensorflow/lite/delegates/gpu/common/task/qcom_thin_filter_desc.cc +@@ -18,6 +18,7 @@ limitations under the License. + #include + #include + ++#include "absl/strings/str_cat.h" + #include "absl/strings/string_view.h" + + namespace tflite { +diff --git a/tensorflow/lite/delegates/gpu/common/tasks/special/thin_pointwise_fuser.cc b/tensorflow/lite/delegates/gpu/common/tasks/special/thin_pointwise_fuser.cc +index 03fd1292..923aaf53 100644 +--- a/tensorflow/lite/delegates/gpu/common/tasks/special/thin_pointwise_fuser.cc ++++ b/tensorflow/lite/delegates/gpu/common/tasks/special/thin_pointwise_fuser.cc +@@ -24,6 +24,7 @@ limitations under the License. + #include + #include + ++#include "absl/strings/str_cat.h" + #include "absl/strings/str_replace.h" + #include "tensorflow/lite/delegates/gpu/common/flops_util.h" + #include "tensorflow/lite/delegates/gpu/common/model.h" diff --git a/ports/tensorflow-lite/portfile.cmake b/ports/tensorflow-lite/portfile.cmake index 965f9629..16c390df 100644 --- a/ports/tensorflow-lite/portfile.cmake +++ b/ports/tensorflow-lite/portfile.cmake @@ -23,8 +23,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tensorflow/tensorflow - REF v2.15.0 - SHA512 51976c7255ffbdb98fe67a28f6ae1c3b9a073e49fe6b44187a53d99654e4af753de53bfa7229cdd1997ac71e8ddecbc15e4759d46c6d24b55eb84c5d31523dfe + REF v2.15.1 + SHA512 21f63e7b3a5d8d7d0356a13aac259ca3fd40bd9c118a747378741fc304fa24de2674c0722de92dfa0524c3b5c40bc0dfde1988301b050ac69f2a3f2fbfbf9875 PATCHES tensorflow-pr-61381.patch tensorflow-pr-62037.patch @@ -154,7 +154,9 @@ else() list(APPEND FEATURE_OPTIONS -DTFLITE_ENABLE_GLES3=OFF) endif() -if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) +if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND GENERATOR_OPTIONS WINDOWS_USE_MSBUILD) +elseif(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) list(APPEND GENERATOR_OPTIONS GENERATOR Xcode) endif() diff --git a/ports/tensorflow-lite/vcpkg.json b/ports/tensorflow-lite/vcpkg.json index 3bad3042..ecb6a98c 100644 --- a/ports/tensorflow-lite/vcpkg.json +++ b/ports/tensorflow-lite/vcpkg.json @@ -1,6 +1,6 @@ { "name": "tensorflow-lite", - "version-semver": "2.15.0", + "version-semver": "2.15.1", "description": "Open standard for machine learning interoperability", "homepage": "https://www.tensorflow.org/", "license": "Apache-2.0", diff --git a/versions/baseline.json b/versions/baseline.json index 026dd933..4db34041 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -161,7 +161,7 @@ "port-version": 0 }, "tensorflow-lite": { - "baseline": "2.15.0", + "baseline": "2.15.1", "port-version": 0 }, "tensorpipe": { diff --git a/versions/t-/tensorflow-lite.json b/versions/t-/tensorflow-lite.json index 656b3b70..943b2be6 100644 --- a/versions/t-/tensorflow-lite.json +++ b/versions/t-/tensorflow-lite.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bcef395d4f0edadd485ca76b8c8138417d766e65", + "version-semver": "2.15.1", + "port-version": 0 + }, { "git-tree": "ac0b3b2efcaee8c1371bfdd8ce8901af5b3019e8", "version-semver": "2.15.0",