Skip to content

Commit 8d330d8

Browse files
TedThemistokleousadrianlizarragayuslepukhinedgchen1chilo-ms
authored
V1.23.1 merge (#181)
* ORT 1.23.1 cherrypick 1 [REDO] (microsoft#26140) ### Description Cherry-pick the following PRs into the ORT 1.23.1 branch: - Fix Attention GQA implementation on CPU - **MANUAL MERGE**: see microsoft#26057 - main merge date: Sept 15, 11:33am - pr: microsoft#25966 - commit: d530b29 - Address edge GetMemInfo edge cases - main merge date: Sept 16, 10:32am - pr: microsoft#26021 - commit: d251f3a - Implement new Python APIs - main merge date: Sept 17, 11:44am - pr: microsoft#25999 - commit: abc63e8 - MemcpyFromHost and MemcpyToHost support for plugin EPs - **MERGE CONFLICT** on file onnxruntime/test/optimizer/transpose_optimizer_test.cc. Conflicts with microsoft#25689 - main merge date: Sept 23, 10:42am - pr: microsoft#26088 - commit: 4545732 - [TRT RTX EP] Fix bug for generating the correct subgraph in GetCapability microsoft#26132 - main merge date: Sept 23, 8:54pm - pr: microsoft#26132 - commit: 72e56e7 ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> --------- Co-authored-by: Dmitri Smirnov <[email protected]> Co-authored-by: Edward Chen <[email protected]> Co-authored-by: Chi Lo <[email protected]> * ORT 1.23.1 cherrypick 2 (microsoft#26182) ### Description Adds the following commits to the `rel-1.23.1` branch for ORT 1.23.1: - add session_id_ to LogEvaluationStart/Stop, LogSessionCreationStart - main merge date: July 31, 1:05am - pr: microsoft#25590 - commit: e753643 - [build] fix WebAssembly build on macOS/arm64 - main merge date: Aug 5, 8:07am - pr: microsoft#25653 - commit: 53f152b - [CPU] MoE Kernel (microsoft#25958) - main merge date: Sept 10, 4:54pm - pr: microsoft#25958 - commit: 930e640 - [CPU] Block-wise QMoE kernel for CPU - main merge date: Sept 15, 8:32am - pr: microsoft#26009 - commit: 5d17734 - [C#] Implement missing APIs - main merge date: Sept 24, 10:50am - pr: microsoft#26101 - commit: 35dcab5 - Regenerate test model with ONNX IR < 12 - main merge date: Sept 24, 2:50pm - pr: microsoft#26149 - commit: 88f2652 - [CPU] Fix compilation errors because of unused variables - main merge date: Sept 25, 1:21pm - pr: microsoft#26147 - commit: 42fcd71 - [EP ABI] Check if nodes specified in GetCapability() have already been assigned - main merge date: Sept 26, 1:24am - pr: microsoft#26156 - commit: 67d3ba0 - [QNN EP] Add dynamic option to set HTP performance mode - main merge date: Sept 26, 11:55am - pr: microsoft#26135 - commit: 6cc40fd --------- Co-authored-by: xieofxie <[email protected]> Co-authored-by: hualxie <[email protected]> Co-authored-by: Yulong Wang <[email protected]> Co-authored-by: Akshay Sonawane <[email protected]> Co-authored-by: Dmitri Smirnov <[email protected]> Co-authored-by: Edward Chen <[email protected]> Co-authored-by: quic-tirupath <[email protected]> Co-authored-by: quic-ashwshan <[email protected]> --------- Co-authored-by: Adrian Lizarraga <[email protected]> Co-authored-by: Dmitri Smirnov <[email protected]> Co-authored-by: Edward Chen <[email protected]> Co-authored-by: Chi Lo <[email protected]> Co-authored-by: xieofxie <[email protected]> Co-authored-by: hualxie <[email protected]> Co-authored-by: Yulong Wang <[email protected]> Co-authored-by: Akshay Sonawane <[email protected]> Co-authored-by: quic-tirupath <[email protected]> Co-authored-by: quic-ashwshan <[email protected]>
1 parent 8ff252d commit 8d330d8

File tree

94 files changed

+5290
-747
lines changed

Some content is hidden

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

94 files changed

+5290
-747
lines changed

VERSION_NUMBER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.23.0
1+
1.23.1

cmake/onnxruntime_unittests.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,7 @@ endif()
18001800
if (WIN32 AND onnxruntime_BUILD_SHARED_LIB AND
18011801
NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND
18021802
NOT onnxruntime_MINIMAL_BUILD)
1803+
# example_plugin_ep
18031804
file(GLOB onnxruntime_autoep_test_library_src "${TEST_SRC_DIR}/autoep/library/*.h"
18041805
"${TEST_SRC_DIR}/autoep/library/*.cc")
18051806
onnxruntime_add_shared_library_module(example_plugin_ep ${onnxruntime_autoep_test_library_src})
@@ -1822,6 +1823,9 @@ if (WIN32 AND onnxruntime_BUILD_SHARED_LIB AND
18221823
set_property(TARGET example_plugin_ep APPEND_STRING PROPERTY LINK_FLAGS
18231824
${ONNXRUNTIME_AUTOEP_LIB_LINK_FLAG})
18241825

1826+
set_target_properties(example_plugin_ep PROPERTIES FOLDER "ONNXRuntimeTest")
1827+
source_group(TREE ${TEST_SRC_DIR} FILES ${onnxruntime_autoep_test_library_src})
1828+
18251829
# test library
18261830
file(GLOB onnxruntime_autoep_test_SRC "${ONNXRUNTIME_AUTOEP_TEST_SRC_DIR}/*.h"
18271831
"${ONNXRUNTIME_AUTOEP_TEST_SRC_DIR}/*.cc")

csharp/src/Microsoft.ML.OnnxRuntime/InferenceSession.shared.cs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,82 @@ public IReadOnlyDictionary<string, NodeMetadata> OverridableInitializerMetadata
214214
}
215215
}
216216

217+
/// <summary>
218+
/// Fetches memory info for all inputs in the same order as their names.
219+
/// (See InputNames property).
220+
/// </summary>
221+
/// <returns>A disposable readonly collection of OrtMemoryInfo</returns>
222+
public IDisposableReadOnlyCollection<OrtMemoryInfo> GetMemoryInfosForInputs()
223+
{
224+
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionGetInputCount(_nativeHandle, out UIntPtr numInputs));
225+
226+
if(numInputs == UIntPtr.Zero)
227+
{
228+
return new DisposableList<OrtMemoryInfo>();
229+
}
230+
231+
var memoryInfoArray = new IntPtr[(ulong)numInputs];
232+
233+
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionGetMemoryInfoForInputs(_nativeHandle,
234+
memoryInfoArray, numInputs));
235+
236+
return new DisposableList<OrtMemoryInfo>(
237+
memoryInfoArray.Select(static ptr => new OrtMemoryInfo(ptr, /* owned= */ false)));
238+
}
239+
240+
/// <summary>
241+
/// Fetches memory info for all outputs in the same order as their names.
242+
/// (See OutputNames property).
243+
/// </summary>
244+
/// <returns>A disposable readonly collection of OrtMemoryInfo</returns>
245+
public IDisposableReadOnlyCollection<OrtMemoryInfo> GetMemoryInfosForOutputs()
246+
{
247+
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionGetOutputCount(_nativeHandle,
248+
out UIntPtr numOutputs));
249+
250+
if(numOutputs == UIntPtr.Zero)
251+
{
252+
return new DisposableList<OrtMemoryInfo>();
253+
}
254+
255+
var memoryInfoArray = new IntPtr[(ulong)numOutputs];
256+
257+
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionGetMemoryInfoForOutputs(_nativeHandle,
258+
memoryInfoArray, numOutputs));
259+
return new DisposableList<OrtMemoryInfo>(
260+
memoryInfoArray.Select(static ptr => new OrtMemoryInfo(ptr, /* owned= */ false)));
261+
}
262+
263+
/// <summary>
264+
/// Fetches OrtEpDevice instances for all inputs in the same order as their input names.
265+
/// For inputs that do not have a device, the corresponding entry in the returned list is null.
266+
/// See InputNames property.
267+
/// </summary>
268+
/// <returns>IReadOnlyList<OrtEpDevice></returns>
269+
public IReadOnlyList<OrtEpDevice> GetEpDeviceForInputs()
270+
{
271+
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionGetInputCount(_nativeHandle,
272+
out UIntPtr numInputs));
273+
274+
if (numInputs == UIntPtr.Zero)
275+
{
276+
// OrtSessionGetEpDeviceForInputs expects numInputs > 0, otherwise it is an invalid arg.
277+
return [];
278+
}
279+
280+
var epDevicesForInputs = new IntPtr[(ulong)numInputs];
281+
282+
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionGetEpDeviceForInputs(_nativeHandle,
283+
epDevicesForInputs, numInputs));
284+
285+
// Some entries in epDevicesForInputs can be IntPtr.Zero, indicating the input does not
286+
// have a device; return null for those entries.
287+
return epDevicesForInputs
288+
.Select(static ptr => ptr == IntPtr.Zero ? null : new OrtEpDevice(ptr))
289+
.ToList()
290+
.AsReadOnly();
291+
}
292+
217293
/// <summary>
218294
/// Runs the loaded model for the given inputs, and fetches all the outputs.
219295
/// </summary>

0 commit comments

Comments
 (0)