Skip to content

Commit

Permalink
[onnxruntime] fixing raining feature
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Jan 18, 2024
1 parent 2dafbeb commit 6a1b171
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/port-windows.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
onnxruntime[directml,xnnpack]:x64-windows
onnxruntime[training,directml,xnnpack]:x64-windows
13 changes: 13 additions & 0 deletions ports/onnxruntime/fix-cmake.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

37 changes: 37 additions & 0 deletions ports/onnxruntime/fix-sources.patch
Original file line number Diff line number Diff line change
@@ -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 <variant>
+#include <unordered_map>

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

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 <deque>
#include <charconv>
#include <vector>
#include <utility>
6 changes: 4 additions & 2 deletions ports/onnxruntime/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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}"
)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion versions/o-/onnxruntime.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "ce00adfe9695998a322ea3be0d00144b23b739f1",
"git-tree": "f89b1af1f550c094eec8a2f08862c8358f8b5df3",
"version-date": "2024-01-04",
"port-version": 0
},
Expand Down

0 comments on commit 6a1b171

Please sign in to comment.