diff --git a/.circleci/port-windows.txt b/.circleci/port-windows.txt index 2dfd747a..46f70004 100644 --- a/.circleci/port-windows.txt +++ b/.circleci/port-windows.txt @@ -1 +1 @@ -onnxruntime[directml,xnnpack]:x64-windows +onnxruntime[training,directml,xnnpack]:x64-windows diff --git a/ports/onnxruntime/fix-cmake.patch b/ports/onnxruntime/fix-cmake.patch index 32e8c09f..0820d759 100644 --- a/ports/onnxruntime/fix-cmake.patch +++ b/ports/onnxruntime/fix-cmake.patch @@ -82,3 +82,16 @@ index ad31e40..e6254ff 100644 set(TENSORBOARD_ROOT ${tensorboard_SOURCE_DIR}) # tensorboard protos +diff --git a/cmake/onnxruntime_providers_xnnpack.cmake b/cmake/onnxruntime_providers_xnnpack.cmake +index 9c00703..eca3845 100644 +--- a/cmake/onnxruntime_providers_xnnpack.cmake ++++ b/cmake/onnxruntime_providers_xnnpack.cmake +@@ -15,7 +15,7 @@ + source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_providers_xnnpack_cc_srcs}) + onnxruntime_add_static_library(onnxruntime_providers_xnnpack ${onnxruntime_providers_xnnpack_cc_srcs}) + onnxruntime_add_include_to_target(onnxruntime_providers_xnnpack +- onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} XNNPACK pthreadpool ++ onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} xnnpack + flatbuffers::flatbuffers Boost::mp11 safeint_interface + ) + diff --git a/ports/onnxruntime/fix-sources.patch b/ports/onnxruntime/fix-sources.patch new file mode 100644 index 00000000..54a08ad9 --- /dev/null +++ b/ports/onnxruntime/fix-sources.patch @@ -0,0 +1,37 @@ +diff --git a/onnxruntime/core/optimizer/compute_optimizer/upstream_gather_actors.h b/onnxruntime/core/optimizer/compute_optimizer/upstream_gather_actors.h +index 0c21be1..3ee6061 100644 +--- a/onnxruntime/core/optimizer/compute_optimizer/upstream_gather_actors.h ++++ b/onnxruntime/core/optimizer/compute_optimizer/upstream_gather_actors.h +@@ -5,6 +5,8 @@ + // while so far we mainly validate training during cooking the optimization. + #ifdef ENABLE_TRAINING + #pragma once ++#include ++#include + + #include "core/optimizer/compute_optimizer/shared_utils.h" + +diff --git a/onnxruntime/core/optimizer/compute_optimizer/upstream_transformer_base.h b/onnxruntime/core/optimizer/compute_optimizer/upstream_transformer_base.h +index 6e22fc7..79c8ac1 100644 +--- a/onnxruntime/core/optimizer/compute_optimizer/upstream_transformer_base.h ++++ b/onnxruntime/core/optimizer/compute_optimizer/upstream_transformer_base.h +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + namespace onnxruntime::optimizer::compute_optimizer { + +diff --git a/orttraining/orttraining/core/optimizer/memory_optimizer/transformer_specific.cc b/orttraining/orttraining/core/optimizer/memory_optimizer/transformer_specific.cc +index 04f2679..9c4de02 100644 +--- a/orttraining/orttraining/core/optimizer/memory_optimizer/transformer_specific.cc ++++ b/orttraining/orttraining/core/optimizer/memory_optimizer/transformer_specific.cc +@@ -1,6 +1,7 @@ + // Copyright (c) Microsoft Corporation. All rights reserved. + // Licensed under the MIT License. + ++#include + #include + #include + #include diff --git a/ports/onnxruntime/portfile.cmake b/ports/onnxruntime/portfile.cmake index 5b425336..57965b9d 100644 --- a/ports/onnxruntime/portfile.cmake +++ b/ports/onnxruntime/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_from_github( PATCHES fix-cmake.patch fix-source-flatbuffers.patch + fix-sources.patch ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/onnxruntime_vcpkg_deps.cmake" DESTINATION "${SOURCE_PATH}/cmake/external") @@ -32,7 +33,7 @@ message(STATUS "Using flatc: ${FLATC}") set(SCHEMA_DIR "${SOURCE_PATH}/onnxruntime/core/flatbuffers/schema") vcpkg_execute_required_process( - COMMAND ${FLATC} --cpp --scoped-enums --filename-suffix ".fbs" ort.fbs + COMMAND ${FLATC} --cpp --scoped-enums --filename-suffix ".fbs" ort.fbs ort_training_checkpoint.fbs LOGNAME codegen-flatc-cpp WORKING_DIRECTORY "${SCHEMA_DIR}" ) @@ -69,6 +70,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS mpi onnxruntime_USE_MPI INVERTED_FEATURES abseil onnxruntime_DISABLE_ABSEIL + training onnxruntime_DISABLE_RTTI cuda onnxruntime_USE_CUTLASS cuda onnxruntime_USE_MEMORY_EFFICIENT_ATTENTION ) @@ -154,7 +156,7 @@ vcpkg_cmake_configure( -Donnxruntime_BUILD_SHARED_LIB=${BUILD_SHARED} -Donnxruntime_BUILD_WEBASSEMBLY=OFF -Donnxruntime_CROSS_COMPILING=${VCPKG_CROSSCOMPILING} - -Donnxruntime_USE_FULL_PROTOBUF=ON + -Donnxruntime_USE_FULL_PROTOBUF=OFF # minimalize protoc execution -Donnxruntime_USE_PREINSTALLED_EIGEN=ON -Donnxruntime_USE_EXTENSIONS=OFF -Donnxruntime_USE_NNAPI_BUILTIN=${VCPKG_TARGET_IS_ANDROID} diff --git a/versions/o-/onnxruntime.json b/versions/o-/onnxruntime.json index 6ff6f0e2..0fd92977 100644 --- a/versions/o-/onnxruntime.json +++ b/versions/o-/onnxruntime.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "ce00adfe9695998a322ea3be0d00144b23b739f1", + "git-tree": "f89b1af1f550c094eec8a2f08862c8358f8b5df3", "version-date": "2024-01-04", "port-version": 0 },