Skip to content

Commit

Permalink
[onnxruntime] Fix use of Eigen3, remove NuGet executable usage (#154)
Browse files Browse the repository at this point in the history
* [onnxruntime] fix Eigen header search, remove NuGet usage

* ci: onnxruntime[training]

* [onnxruntime] try reduce of build time

* use Ninja, reduce build step

* ci: save cach with config checksum

* ci: bring cache from old branch
  • Loading branch information
luncliff authored Jan 21, 2024
1 parent 621c25e commit a3d71eb
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
keys:
- v2352-caches-{{ .Branch }}
- v2352-caches-{{ checksum ".circleci/config.yml" }}
- v2352-caches-update/circleci
- v2352-caches-main
- run:
name: "Install: port-windows.txt"
Expand All @@ -71,13 +72,17 @@ jobs:
equal: [ main, << pipeline.git.branch >> ]
steps:
- save_cache:
key: v2352-caches-{{ .Branch }}
key: v2352-caches-main
paths:
- C:/vcpkg-caches
- save_cache:
key: v2352-caches-{{ .Branch }}
paths:
- C:/vcpkg-caches
- save_cache:
key: v2352-caches-{{ checksum ".circleci/config.yml" }}
paths:
- C:/vcpkg-caches
- store_artifacts:
name: "Upload: buildtrees log"
path: vcpkg/buildtrees/
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ stages:
path: $(vcpkg.default.binary.cache)
- task: run-vcpkg@0
inputs:
vcpkgArguments: "tensorflow-lite[gpu] onnxruntime[xnnpack]"
vcpkgArguments: "tensorflow-lite[gpu] onnxruntime[xnnpack,training]"
vcpkgGitCommitId: $(vcpkg.commit)
- task: CopyFiles@2
displayName: "Copy logs in buildtrees"
Expand Down
12 changes: 12 additions & 0 deletions ports/onnxruntime/fix-cmake.patch
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,15 @@ index 9c00703..eca3845 100644
flatbuffers::flatbuffers Boost::mp11 safeint_interface
)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index fa936c2..48bd0fb 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -959,6 +959,7 @@ function(onnxruntime_set_compile_flags target_name)
endif()
target_compile_definitions(${target_name} PUBLIC -DNSYNC_ATOMIC_CPP11)
onnxruntime_add_include_to_target(${target_name} nsync::nsync_cpp)
+ onnxruntime_add_include_to_target(${target_name} Eigen3::Eigen)
endif()
foreach(ORT_FLAG ${ORT_PROVIDER_FLAGS})
target_compile_definitions(${target_name} PRIVATE ${ORT_FLAG})
3 changes: 2 additions & 1 deletion ports/onnxruntime/onnxruntime_vcpkg_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ endif()
# Flatbuffers
find_package(flatbuffers CONFIG REQUIRED) # flatbuffers::flatbuffers
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES flatbuffers::flatbuffers)
list(APPEND onnxruntime_EXTERNAL_LIBRARIES flatbuffers::flatbuffers)

find_package(Protobuf CONFIG REQUIRED) # protobuf::libprotobuf protobuf::libprotobuf-lite
if (onnxruntime_USE_FULL_PROTOBUF)
Expand All @@ -35,7 +36,7 @@ get_filename_component(ONNX_CUSTOM_PROTOC_EXECUTABLE "${Protobuf_PROTOC_EXECUTAB
include(external/protobuf_function.cmake)

find_package(date CONFIG REQUIRED)
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES date::date)
list(APPEND onnxruntime_EXTERNAL_LIBRARIES date::date)

find_package(Boost REQUIRED)
find_path(BOOST_INCLUDEDIR "boost/mp11.hpp" REQUIRED)
Expand Down
8 changes: 1 addition & 7 deletions ports/onnxruntime/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ endif()
if(VCPKG_TARGET_IS_OSX AND ("framework" IN_LIST FEATURES))
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
endif()
vcpkg_find_acquire_program(NUGET)

# requires https://github.com/microsoft/onnxruntime/pull/18038 for later version of XNNPACK
vcpkg_from_github(
Expand Down Expand Up @@ -90,7 +89,7 @@ endif()
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
# For some reason CUDA compiler detection is not working in WINDOWS_USE_MSBUILD
if(NOT ("cuda" IN_LIST FEATURES))
set(GENERATOR_OPTIONS WINDOWS_USE_MSBUILD)
# set(GENERATOR_OPTIONS WINDOWS_USE_MSBUILD)
endif()
elseif(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
set(GENERATOR_OPTIONS GENERATOR Xcode)
Expand Down Expand Up @@ -148,7 +147,6 @@ vcpkg_cmake_configure(
OPTIONS
${ARCH_OPTIONS}
${FEATURE_OPTIONS}
-DNUGET_EXE:FILEPATH:=${NUGET}
-DPython_EXECUTABLE:FILEPATH=${PYTHON3}
-DProtobuf_PROTOC_EXECUTABLE:FILEPATH=${PROTOC}
# -DProtobuf_USE_STATIC_LIBS=OFF
Expand All @@ -175,15 +173,11 @@ vcpkg_cmake_configure(
-Donnxruntime_ENABLE_MEMORY_PROFILE=OFF
-Donnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
MAYBE_UNUSED_VARIABLES
NUGET_EXE
onnxruntime_BUILD_WEBASSEMBLY
onnxruntime_TENSORRT_PLACEHOLDER_BUILDER
onnxruntime_USE_CUSTOM_DIRECTML
onnxruntime_NVCC_THREADS
)
if("training" IN_LIST FEATURES)
vcpkg_cmake_build(TARGET onnxruntime_training LOGFILE_BASE build-training)
endif()
vcpkg_cmake_build(TARGET onnxruntime LOGFILE_BASE build-onnxruntime)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/onnxruntime PACKAGE_NAME onnxruntime)
Expand Down
1 change: 1 addition & 0 deletions ports/onnxruntime/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "onnxruntime",
"version-date": "2024-01-04",
"port-version": 1,
"description": "ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator",
"homepage": "https://www.onnxruntime.ai",
"dependencies": [
Expand Down
1 change: 1 addition & 0 deletions test/self-hosted-cuda.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"cuda",
"directml",
"python",
"training",
"xnnpack"
],
"platform": "x64 & windows"
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},
"onnxruntime": {
"baseline": "2024-01-04",
"port-version": 0
"port-version": 1
},
"openssl": {
"baseline": "3.1.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/onnxruntime.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6af6c57d2c15411b9baba5f49e5ecd5608fa9477",
"version-date": "2024-01-04",
"port-version": 1
},
{
"git-tree": "f89b1af1f550c094eec8a2f08862c8358f8b5df3",
"version-date": "2024-01-04",
Expand Down

0 comments on commit a3d71eb

Please sign in to comment.