-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into port/tensorflow-lite
- Loading branch information
Showing
13 changed files
with
84 additions
and
848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,3 @@ nsync | |
ruy | ||
tensorflow-lite | ||
dlpack | ||
onnxruntime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,36 @@ | ||
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt | ||
index 78c7bd1..19aefbd 100644 | ||
--- a/cmake/CMakeLists.txt | ||
+++ b/cmake/CMakeLists.txt | ||
@@ -38,6 +38,8 @@ include(CheckLanguage) | ||
include(CMakeDependentOption) | ||
include(FetchContent) | ||
include(CheckFunctionExists) | ||
+include(GNUInstallDirs) # onnxruntime_providers_* require CMAKE_INSTALL_* variables | ||
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external") | ||
diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake | ||
index 8574602..6ab4a84 100644 | ||
--- a/cmake/external/onnxruntime_external_deps.cmake | ||
+++ b/cmake/external/onnxruntime_external_deps.cmake | ||
@@ -92,15 +92,15 @@ if (NOT WIN32) | ||
URL ${DEP_URL_google_nsync} | ||
URL_HASH SHA1=${DEP_SHA1_google_nsync} | ||
PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/nsync/nsync_1.26.0.patch | ||
- FIND_PACKAGE_ARGS NAMES nsync unofficial-nsync | ||
+ FIND_PACKAGE_ARGS NAMES nsync_cpp unofficial-nsync | ||
) | ||
#nsync tests failed on Mac Build | ||
set(NSYNC_ENABLE_TESTS OFF CACHE BOOL "" FORCE) | ||
onnxruntime_fetchcontent_makeavailable(google_nsync) | ||
|
||
# TODO: update this once all system adapt c++20 | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") | ||
@@ -1430,13 +1432,13 @@ endif() | ||
set(ORT_BUILD_INFO "ORT Build Info: ") | ||
find_package(Git) | ||
if (Git_FOUND) | ||
- execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- OUTPUT_VARIABLE ORT_GIT_COMMIT) | ||
+ # execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h | ||
+ # WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
+ # OUTPUT_VARIABLE ORT_GIT_COMMIT) | ||
string(STRIP "${ORT_GIT_COMMIT}" ORT_GIT_COMMIT) | ||
- execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- OUTPUT_VARIABLE ORT_GIT_BRANCH) | ||
+ # execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD | ||
+ # WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
+ # OUTPUT_VARIABLE ORT_GIT_BRANCH) | ||
string(STRIP "${ORT_GIT_BRANCH}" ORT_GIT_BRANCH) | ||
string(APPEND ORT_BUILD_INFO "git-branch=${ORT_GIT_BRANCH}, git-commit-id=${ORT_GIT_COMMIT}, ") | ||
endif() | ||
diff --git a/cmake/onnxruntime.cmake b/cmake/onnxruntime.cmake | ||
index 927b4ac..7e992fb 100644 | ||
--- a/cmake/onnxruntime.cmake | ||
+++ b/cmake/onnxruntime.cmake | ||
@@ -332,6 +332,9 @@ if(onnxruntime_BUILD_APPLE_FRAMEWORK) | ||
# If it's an onnxruntime library, extract .o files from the original cmake build path to a separate directory for | ||
# each library to avoid any clashes with filenames (e.g. utils.o) | ||
foreach(_LIB ${onnxruntime_INTERNAL_LIBRARIES} ) | ||
+ if(NOT TARGET ${_LIB}) # if we didn't build from source. it may not a target | ||
+ continue() | ||
+ endif() | ||
GET_TARGET_PROPERTY(_LIB_TYPE ${_LIB} TYPE) | ||
if(_LIB_TYPE STREQUAL "STATIC_LIBRARY") | ||
set(CUR_STATIC_LIB_OBJ_DIR ${STATIC_LIB_TEMP_DIR}/$<TARGET_LINKER_FILE_BASE_NAME:${_LIB}>) | ||
@@ -362,6 +365,9 @@ if(onnxruntime_BUILD_APPLE_FRAMEWORK) | ||
|
||
# for external libraries we create a symlink to the .a file | ||
foreach(_LIB ${onnxruntime_EXTERNAL_LIBRARIES}) | ||
+ if(NOT TARGET ${_LIB}) # if we didn't build from source. it may not a target | ||
+ continue() | ||
+ endif() | ||
GET_TARGET_PROPERTY(_LIB_TYPE ${_LIB} TYPE) | ||
if(_LIB_TYPE STREQUAL "STATIC_LIBRARY") | ||
add_custom_command(TARGET onnxruntime POST_BUILD | ||
diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake | ||
index 0c1e5e9..2418f9d 100644 | ||
--- a/cmake/onnxruntime_unittests.cmake | ||
+++ b/cmake/onnxruntime_unittests.cmake | ||
@@ -874,6 +874,9 @@ AddTest( | ||
DEPENDS ${all_dependencies} | ||
TEST_ARGS ${test_all_args} | ||
) | ||
+target_include_directories(onnxruntime_test_all PRIVATE | ||
+ ${ONNXRUNTIME_ROOT}/core/flatbuffers/schema # ort.fbs.h | ||
+) | ||
|
||
if (MSVC) | ||
# The warning means the type of two integral values around a binary operator is narrow than their result. | ||
@@ -967,7 +970,8 @@ target_compile_definitions(onnx_test_data_proto PRIVATE "-DONNX_API=") | ||
onnxruntime_add_include_to_target(onnx_test_data_proto onnx_proto) | ||
target_include_directories(onnx_test_data_proto PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||
set_target_properties(onnx_test_data_proto PROPERTIES FOLDER "ONNXRuntimeTest") | ||
-onnxruntime_protobuf_generate(APPEND_PATH IMPORT_DIRS ${onnx_SOURCE_DIR} TARGET onnx_test_data_proto) | ||
+find_path(ONNX_IMPORT_DIR NAMES onnx/onnx-ml.proto REQUIRED) | ||
+onnxruntime_protobuf_generate(APPEND_PATH IMPORT_DIRS ${ONNX_IMPORT_DIR} TARGET onnx_test_data_proto) | ||
|
||
# | ||
# onnxruntime_ir_graph test data | ||
- if (google_nsync_SOURCE_DIR) | ||
+ if (TARGET nsync_cpp AND NOT TARGET nsync::nsync_cpp) | ||
add_library(nsync::nsync_cpp ALIAS nsync_cpp) | ||
- target_include_directories(nsync_cpp PUBLIC ${google_nsync_SOURCE_DIR}/public) | ||
+ message(STATUS "Aliasing nsync_cpp to nsync::nsync_cpp") | ||
endif() | ||
if(TARGET unofficial::nsync::nsync_cpp AND NOT TARGET nsync::nsync_cpp) | ||
message(STATUS "Aliasing unofficial::nsync::nsync_cpp to nsync::nsync_cpp") | ||
diff --git a/cmake/onnxruntime_mlas.cmake b/cmake/onnxruntime_mlas.cmake | ||
index d888f80..b6b12c5 100644 | ||
index 0ba4694..32ce5fd 100644 | ||
--- a/cmake/onnxruntime_mlas.cmake | ||
+++ b/cmake/onnxruntime_mlas.cmake | ||
@@ -725,8 +725,7 @@ block() | ||
@@ -725,7 +725,7 @@ block() | ||
endblock() | ||
|
||
|
||
-if (NOT onnxruntime_ORT_MINIMAL_BUILD) | ||
- | ||
+if (NOT onnxruntime_ORT_MINIMAL_BUILD AND NOT (CMAKE_SYSTEM_NAME STREQUAL "iOS")) | ||
+if (FALSE) | ||
# | ||
# Command line tool for quantization and de-quantization of 2-D fp32 tensors | ||
# based on block-wise quantization of int4 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.