Skip to content

Commit

Permalink
[tensorflow-lite] update to 2.15.0 (#156)
Browse files Browse the repository at this point in the history
* [tensorflow-lite] fix `TFLITE_ENABLE_MMAP` option usage

* [tensorflow-lite] todo: support XLA

* [tensorflow-lite] bump to 2.15.0

* [xnnpack] update xnnpack-config.cmake template

* [tensorflow-lite] resurrect third_party/xla

* [eigen3] use master branch

* [tensorflow-lite] update patch files

* [onnxruntime] fix Eigen header search, remove NuGet usage

* ci: onnxruntime[training]

* [tensorflow-lite] bring PRs into patch, merge changes

* [tensorflow-lite] install metal_delegate in iOS build

* prevent <poll.h> usage

* [tensorflow-lite] check ARM architecture

* [tensorflow-lite] update baseline
  • Loading branch information
luncliff authored Jan 25, 2024
1 parent 3d0a6ad commit c4b7b6e
Show file tree
Hide file tree
Showing 26 changed files with 800 additions and 606 deletions.
26 changes: 0 additions & 26 deletions ports/eigen3/fix-vectorized-reductions-half.patch

This file was deleted.

19 changes: 10 additions & 9 deletions ports/eigen3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ vcpkg_from_gitlab(
GITLAB_URL https://gitlab.com
OUT_SOURCE_PATH SOURCE_PATH
REPO libeigen/eigen
REF 3.4.0
SHA512 ba75ecb760e32acf4ceaf27115468e65d4f77c44f8d519b5a13e7940af2c03a304ad433368cb6d55431f307c5c39e2666ab41d34442db3cf441638e51f5c3b6a
REF b2814d53a707f699e5c56f565847e7020654efc2
SHA512 82e79174b205bafa67a8bfc92ea20882ea0002738c956f59737c9ab1f54fcff322d4eda8d8b3f3ac97513102148c2fb1b01de4482a027dd3666982fb735719a7
HEAD_REF master
PATCHES
remove_configure_checks.patch # This removes unnecessary configure checks. Eigen3 just installs headers not anything more.
fix-vectorized-reductions-half.patch # Remove this patch in the next update
)

if(VCPKG_TARGET_IS_ANDROID)
Expand All @@ -34,9 +31,13 @@ vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_fixup_pkgconfig()

file(GLOB INCLUDES "${CURRENT_PACKAGES_DIR}/include/eigen3/*")
# file(GLOB INCLUDES "${CURRENT_PACKAGES_DIR}/include/eigen3/*")
# Copy the eigen header files to conventional location for user-wide MSBuild integration
file(COPY ${INCLUDES} DESTINATION "${CURRENT_PACKAGES_DIR}/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
# file(COPY ${INCLUDES} DESTINATION "${CURRENT_PACKAGES_DIR}/include")

file(INSTALL "${SOURCE_PATH}/COPYING.README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.README")
37 changes: 0 additions & 37 deletions ports/eigen3/remove_configure_checks.patch

This file was deleted.

3 changes: 1 addition & 2 deletions ports/eigen3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "eigen3",
"version": "3.4.0",
"port-version": 2,
"version-date": "2024-01-16",
"description": "C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.",
"homepage": "http://eigen.tuxfamily.org",
"license": "MPL-2.0",
Expand Down
35 changes: 16 additions & 19 deletions ports/tensorflow-lite/fix-cmake-c-api.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
index f8709c6a..161e3421 100644
index 78657b58..7ee0d64e 100644
--- a/tensorflow/lite/CMakeLists.txt
+++ b/tensorflow/lite/CMakeLists.txt
@@ -640,6 +640,7 @@ if(TFLITE_ENABLE_INSTALL)
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
@@ -731,6 +731,34 @@ target_compile_definitions(tensorflow-lite
)
add_library(${PROJECT_NAME}::tensorflowlite ALIAS tensorflow-lite)

foreach(hdr ${_ALL_TFLITE_HDRS})
@@ -671,6 +672,37 @@ if(TFLITE_ENABLE_INSTALL)
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
endif()
+
+# see tensorflow/lite/c/CMakeLists.txt
+target_sources(tensorflow-lite PRIVATE
+ ${TFLITE_SOURCE_DIR}/core/c/c_api.cc
Expand All @@ -28,9 +19,7 @@ index f8709c6a..161e3421 100644
+ c/c_api_types.h
+ c/common.h
+)
+target_include_directories(tensorflow-lite PRIVATE
+ c
+)
+target_include_directories(tensorflow-lite PRIVATE c)
+# set_target_properties(tensorflow-lite PROPERTEIS
+# OUTPUT_NAME tensorflowlite_c
+# )
Expand All @@ -45,6 +34,14 @@ index f8709c6a..161e3421 100644
+ endif()
+endif()
+
return() # drop following targets
# The kernel tests.
if(TFLITE_KERNEL_TEST)
# The install targets.
if(TFLITE_ENABLE_INSTALL)
install(
@@ -738,6 +766,7 @@ if(TFLITE_ENABLE_INSTALL)
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

foreach(hdr ${_ALL_TFLITE_HDRS})
161 changes: 0 additions & 161 deletions ports/tensorflow-lite/fix-cmake-gpu.patch

This file was deleted.

23 changes: 0 additions & 23 deletions ports/tensorflow-lite/fix-cmake-nnapi.patch

This file was deleted.

Loading

0 comments on commit c4b7b6e

Please sign in to comment.