Skip to content

Commit

Permalink
[tensorflow-lite] Update to v2.15.1 (#187)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
luncliff authored Apr 4, 2024
1 parent 07e262e commit 6e16af5
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]`]'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]`]'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 28 additions & 0 deletions ports/tensorflow-lite/fix-cmake-vcpkg.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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)
36 changes: 36 additions & 0 deletions ports/tensorflow-lite/fix-source-abseil.patch
Original file line number Diff line number Diff line change
Expand Up @@ -677,3 +677,39 @@ index 170e5e39..1a8a4126 100644
auto weights = attr.weights.shape;

std::vector<Variable> 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 <utility>
#include <vector>

+#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 <string>
#include <vector>

+#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 <utility>
#include <vector>

+#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"
8 changes: 5 additions & 3 deletions ports/tensorflow-lite/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion ports/tensorflow-lite/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"port-version": 0
},
"tensorflow-lite": {
"baseline": "2.15.0",
"baseline": "2.15.1",
"port-version": 0
},
"tensorpipe": {
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/tensorflow-lite.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bcef395d4f0edadd485ca76b8c8138417d766e65",
"version-semver": "2.15.1",
"port-version": 0
},
{
"git-tree": "ac0b3b2efcaee8c1371bfdd8ce8901af5b3019e8",
"version-semver": "2.15.0",
Expand Down

0 comments on commit 6e16af5

Please sign in to comment.