Skip to content

Commit 8642e8b

Browse files
committed
Merge branch 'master' into sync_ort_main_19_7_25
2 parents ea8cf21 + 16701a2 commit 8642e8b

File tree

129 files changed

+5895
-3018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+5895
-3018
lines changed

.github/workflows/windows_openvino.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ jobs:
5454
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
5555
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
5656
57-
- name: Download OpenVINO Toolkit v2025.0.0
57+
- name: Download OpenVINO Toolkit v2025.2.0
5858
env:
59-
OpenVINOVersion: 2025.0.0
59+
OpenVINOVersion: 2025.2.0
6060
shell: pwsh
6161
run: |
62-
$Url = "https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.0/windows/openvino_toolkit_windows_2025.0.0.17942.1f68be9f594_x86_64.zip"
62+
$Url ="https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.2/windows/openvino_toolkit_windows_2025.2.0.19140.c01cd93e24d_x86_64.zip"
6363
$OutputPath = "$env:RUNNER_TEMP\openvino.zip"
6464
$ExtractPath = "$env:RUNNER_TEMP\openvino-v$env:OpenVINOVersion"
6565
$TempExtractPath = "$env:RUNNER_TEMP\openvino_temp"
@@ -102,7 +102,7 @@ jobs:
102102
shell: pwsh
103103
# Use $GITHUB_ENV to set the variable for subsequent steps
104104
run: |
105-
$openVinoRootDir = Join-Path $env:RUNNER_TEMP "openvino-v2025.0.0"
105+
$openVinoRootDir = Join-Path $env:RUNNER_TEMP "openvino-v2025.2.0"
106106
echo "OpenVINORootDir=$openVinoRootDir" >> $env:GITHUB_ENV
107107
108108
- name: Print OpenVINORootDir after downloading OpenVINO

cmake/onnxruntime_unittests.cmake

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,17 +498,19 @@ set (ONNXRUNTIME_AUTOEP_TEST_SRC_DIR "${TEST_SRC_DIR}/autoep")
498498
set (ONNXRUNTIME_EP_GRAPH_TEST_SRC_DIR "${TEST_SRC_DIR}/ep_graph")
499499

500500
set (onnxruntime_shared_lib_test_SRC
501-
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_fixture.h
502-
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_session_options.cc
503-
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_run_options.cc
501+
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/custom_op_utils.h
502+
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/custom_op_utils.cc
504503
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_allocator.cc
505-
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_nontensor_types.cc
504+
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_data_copy.cc
505+
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_fixture.h
506506
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_model_loading.cc
507+
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_nontensor_types.cc
507508
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_ort_format_models.cc
509+
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_run_options.cc
510+
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_session_options.cc
508511
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/utils.h
509512
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/utils.cc
510-
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/custom_op_utils.h
511-
${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/custom_op_utils.cc)
513+
)
512514

513515
if (NOT onnxruntime_MINIMAL_BUILD)
514516
list(APPEND onnxruntime_shared_lib_test_SRC ${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/test_inference.cc)
@@ -722,6 +724,7 @@ endif()
722724
if(onnxruntime_USE_QNN AND NOT onnxruntime_MINIMAL_BUILD AND NOT onnxruntime_REDUCED_OPS_BUILD)
723725
list(APPEND onnxruntime_test_framework_src_patterns ${TEST_SRC_DIR}/providers/qnn/*)
724726
list(APPEND onnxruntime_test_framework_src_patterns ${TEST_SRC_DIR}/providers/qnn/qnn_node_group/*)
727+
list(APPEND onnxruntime_test_framework_src_patterns ${TEST_SRC_DIR}/providers/qnn/optimizer/*)
725728
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_qnn)
726729
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_qnn)
727730
if(NOT onnxruntime_BUILD_QNN_EP_STATIC_LIB)

include/onnxruntime/core/providers/tensorrt/tensorrt_provider_options.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ struct OrtTensorRTProviderOptionsV2 {
8989
size_t trt_onnx_bytestream_size{0}; // size of the byte stream provided as "trt_onnx_bytestream"
9090
// can be updated using: UpdateTensorRTProviderOptionsWithValue
9191

92-
const char* trt_engine_cache_prefix{nullptr}; // specify engine cache prefix
93-
int trt_engine_hw_compatible{0}; // Enable hardware compatibility. Default 0 = false, nonzero = true
94-
const char* trt_op_types_to_exclude{}; // Exclude specific ops from running on TRT.
92+
const void* trt_external_data_bytestream{nullptr}; // The byte stream containing the weights to override the ones provided in the ONNX model.
93+
// can be updated using: UpdateTensorRTProviderOptionsWithValue
94+
size_t trt_external_data_bytestream_size{0}; // size of the byte stream provided as "trt_external_data_bytestream"
95+
// can be updated using: UpdateTensorRTProviderOptionsWithValue
96+
const char* trt_engine_cache_prefix{nullptr}; // specify engine cache prefix
97+
int trt_engine_hw_compatible{0}; // Enable hardware compatibility. Default 0 = false, nonzero = true
98+
const char* trt_op_types_to_exclude{}; // Exclude specific ops from running on TRT.
99+
int trt_load_user_initializer{0}; // Save initializers locally instead of to disk. Default 0 = false, nonzero = true
95100
};

include/onnxruntime/core/providers/utils/ort_graph_to_proto.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,11 +665,11 @@ static Ort::Status OrtOpAttrToProto(const OrtOpAttr& ort_attr, onnx::AttributePr
665665
Ort::Status status{ort_api.ReadOpAttr(&ort_attr, attr_type, nullptr, 0, &total_attr_bytes)};
666666
std::string* str = attr_proto.mutable_s();
667667

668-
str->resize(total_attr_bytes, '\0');
668+
str->resize(total_attr_bytes);
669669
ORT_EP_UTILS_C_RETURN_IF_ERROR(ort_api.ReadOpAttr(&ort_attr, attr_type, str->data(), total_attr_bytes,
670670
&total_attr_bytes));
671671

672-
str->resize(total_attr_bytes - 1); // remove extra ending terminating '\0' character.
672+
str->resize(total_attr_bytes);
673673
break;
674674
}
675675
case OrtOpAttrType::ORT_OP_ATTR_STRINGS: {

include/onnxruntime/core/session/environment.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "core/common/status.h"
1616
#include "core/framework/allocator.h"
1717
#include "core/framework/execution_provider.h"
18+
#include "core/framework/data_transfer_manager.h"
1819
#include "core/platform/device_discovery.h"
1920
#include "core/platform/threadpool.h"
2021

@@ -140,6 +141,10 @@ class Environment {
140141
OrtDeviceMemoryType mem_type, OrtAllocatorType allocator_type,
141142
const OrtKeyValuePairs* allocator_options, OrtAllocator** allocator);
142143
Status ReleaseSharedAllocator(const OrtEpDevice& ep_device, OrtDeviceMemoryType mem_type);
144+
145+
const DataTransferManager& GetDataTransferManager() const {
146+
return data_transfer_mgr_;
147+
}
143148
#endif // !defined(ORT_MINIMAL_BUILD)
144149

145150
// return a shared allocator from a plugin EP or custom allocator added with RegisterAllocator
@@ -185,6 +190,23 @@ class Environment {
185190

186191
using OrtAllocatorUniquePtr = std::unique_ptr<OrtAllocator, std::function<void(OrtAllocator*)>>;
187192

193+
// if the user calls CreateSharedAllocator and wraps the plugin EP's allocator with an arena we end up with
194+
// OrtAllocator from EP -> wrapped in IAllocatorImplWrappingOrtAllocator -> inside a BFCArena IAllocator.
195+
// we can put that in shared_allocators_ for sessions to use, but to have an OrtAllocator available in
196+
// shared_ort_allocators_ that can be used outside of a session we need to additionally wrap that in an
197+
// OrtAllocatorImplWrappingIAllocator. way too many levels of indirection but that is what it is currently.
198+
// we need something to own that final OrtAllocator, so we add it to arena_ort_allocators_.
199+
//
200+
// TODO: we could split out the BFCArena implementation so it can be plugged into either an IAllocator
201+
// or an OrtAllocator instance to reduce the indirection a little.
202+
// with that we get an OrtAllocator from the EP, wrap it with an OrtAllocator based BFCArena, and wrap that with the
203+
// IAllocatorImplWrappingOrtAllocator which takes ownership of the OrtAllocator and is in shared_allocators_.
204+
//
205+
// Alternatively we can disable wrapping an EP's allocator with a BFCArena and say the EP should provide the arena
206+
// implementation directly. They're free to copy BFCArena as it came from TF originally. Or we could provide a
207+
// cut-and-paste BFCArena implementation that works using the EP API that can be included in the EP source.
208+
std::unordered_map<const OrtMemoryInfo*, std::unique_ptr<OrtAllocatorImplWrappingIAllocator>> arena_ort_allocators_;
209+
188210
#if !defined(ORT_MINIMAL_BUILD)
189211
// register EPs that are built into the ORT binary so they can take part in AutoEP selection
190212
// added to ep_libraries
@@ -207,7 +229,9 @@ class Environment {
207229

208230
std::unique_ptr<EpLibrary> library;
209231
std::vector<std::unique_ptr<OrtEpDevice>> execution_devices;
210-
std::vector<EpFactoryInternal*> internal_factories; // factories that can create IExecutionProvider instances
232+
std::vector<OrtEpFactory*> factories;
233+
std::vector<EpFactoryInternal*> internal_factories; // factories that can create IExecutionProvider instances
234+
std::vector<plugin_ep::DataTransfer*> data_transfers; // data transfer instances for this EP.
211235

212236
private:
213237
EpInfo() = default;
@@ -223,6 +247,9 @@ class Environment {
223247

224248
// lookup set for internal EPs so we can create an IExecutionProvider directly
225249
std::unordered_set<EpFactoryInternal*> internal_ep_factories_;
250+
251+
DataTransferManager data_transfer_mgr_; // plugin EP IDataTransfer instances
252+
226253
#endif // !defined(ORT_MINIMAL_BUILD)
227254
};
228255

0 commit comments

Comments
 (0)