Skip to content

Commit ceaf9f4

Browse files
adrianlizarragayuslepukhinedgchen1chilo-ms
authored
ORT 1.23.1 cherrypick 1 [REDO] (#26140)
### Description Cherry-pick the following PRs into the ORT 1.23.1 branch: - Fix Attention GQA implementation on CPU - **MANUAL MERGE**: see #26057 - main merge date: Sept 15, 11:33am - pr: #25966 - commit: d530b29 - Address edge GetMemInfo edge cases - main merge date: Sept 16, 10:32am - pr: #26021 - commit: d251f3a - Implement new Python APIs - main merge date: Sept 17, 11:44am - pr: #25999 - commit: abc63e8 - MemcpyFromHost and MemcpyToHost support for plugin EPs - **MERGE CONFLICT** on file onnxruntime/test/optimizer/transpose_optimizer_test.cc. Conflicts with #25689 - main merge date: Sept 23, 10:42am - pr: #26088 - commit: 4545732 - [TRT RTX EP] Fix bug for generating the correct subgraph in GetCapability #26132 - main merge date: Sept 23, 8:54pm - pr: #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]>
1 parent 2a034d5 commit ceaf9f4

File tree

58 files changed

+1028
-251
lines changed

Some content is hidden

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

58 files changed

+1028
-251
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")

docs/OperatorKernels.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ Do not modify directly.*
253253
|||[9, 12]|**T** = tensor(float)|
254254
|||[1, 8]|**T** = tensor(float)|
255255
|MelWeightMatrix|*in* num_mel_bins:**T1**<br> *in* dft_length:**T1**<br> *in* sample_rate:**T1**<br> *in* lower_edge_hertz:**T2**<br> *in* upper_edge_hertz:**T2**<br> *out* output:**T3**|17+|**T1** = tensor(int32), tensor(int64)<br/> **T2** = tensor(float)<br/> **T3** = tensor(double), tensor(float), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)|
256+
|MemcpyFromHost|*in* X:**T**<br> *out* Y:**T**|1+|**T** = seq(tensor(bfloat16)), seq(tensor(bool)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)), tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)|
257+
|MemcpyToHost|*in* X:**T**<br> *out* Y:**T**|1+|**T** = seq(tensor(bfloat16)), seq(tensor(bool)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)), tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)|
256258
|Min|*in* data_0:**T**<br> *out* min:**T**|13+|**T** = tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64)|
257259
|||12|**T** = tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64)|
258260
|||[8, 11]|**T** = tensor(double), tensor(float)|

docs/python/README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ For more information on ONNX Runtime, please see `aka.ms/onnxruntime <https://ak
88
Changes
99
-------
1010

11+
1.23.1
12+
^^^^^^
13+
14+
Release Notes : https://github.com/Microsoft/onnxruntime/releases/tag/v1.23.1
15+
1116
1.23.0
1217
^^^^^^
1318

include/onnxruntime/core/session/onnxruntime_cxx_api.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,11 +1000,25 @@ using UnownedAllocator = detail::AllocatorImpl<detail::Unowned<OrtAllocator>>;
10001000
/** \brief Wrapper around ::OrtSyncStream
10011001
*
10021002
*/
1003-
struct SyncStream : detail::Base<OrtSyncStream> {
1004-
explicit SyncStream(std::nullptr_t) {} ///< Create an empty SyncStream object, must be assigned a valid one to be used
1005-
explicit SyncStream(OrtSyncStream* p) : Base<OrtSyncStream>{p} {} ///< Take ownership of a pointer created by C API
1006-
void* GetHandle() const; ///< Wraps SyncStream_GetHandle
1003+
1004+
namespace detail {
1005+
template <typename T>
1006+
struct SyncStreamImpl : Base<T> {
1007+
using B = Base<T>;
1008+
using B::B;
1009+
// For some reason this is not a const method on the stream
1010+
void* GetHandle(); ///< Wraps SyncStream_GetHandle
10071011
};
1012+
} // namespace detail
1013+
1014+
struct SyncStream : detail::SyncStreamImpl<OrtSyncStream> {
1015+
///< Create an empty SyncStream object, must be assigned a valid one to be used
1016+
explicit SyncStream(std::nullptr_t) {}
1017+
///< Take ownership of a pointer created by C API
1018+
explicit SyncStream(OrtSyncStream* p) : SyncStreamImpl<OrtSyncStream>{p} {}
1019+
};
1020+
1021+
using UnownedSyncStream = detail::SyncStreamImpl<detail::Unowned<OrtSyncStream>>;
10081022

10091023
namespace detail {
10101024
template <typename T>

include/onnxruntime/core/session/onnxruntime_cxx_inline.h

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,12 @@ inline void KeyValuePairs::Remove(const char* key) {
669669
GetApi().RemoveKeyValuePair(this->p_, key);
670670
}
671671

672-
inline void* SyncStream::GetHandle() const {
672+
namespace detail {
673+
template <typename T>
674+
inline void* SyncStreamImpl<T>::GetHandle() {
673675
return GetApi().SyncStream_GetHandle(this->p_);
674676
}
677+
} // namespace detail
675678

676679
namespace detail {
677680
template <typename T>
@@ -1582,11 +1585,13 @@ inline std::vector<ConstMemoryInfo> ConstSessionImpl<T>::GetMemoryInfoForInputs(
15821585

15831586
auto num_inputs = GetInputCount();
15841587
std::vector<ConstMemoryInfo> mem_infos;
1585-
mem_infos.resize(num_inputs);
1588+
if (num_inputs > 0) {
1589+
mem_infos.resize(num_inputs);
15861590

1587-
ThrowOnError(GetApi().SessionGetMemoryInfoForInputs(this->p_,
1588-
reinterpret_cast<const OrtMemoryInfo**>(mem_infos.data()),
1589-
num_inputs));
1591+
ThrowOnError(GetApi().SessionGetMemoryInfoForInputs(this->p_,
1592+
reinterpret_cast<const OrtMemoryInfo**>(mem_infos.data()),
1593+
num_inputs));
1594+
}
15901595

15911596
return mem_infos;
15921597
}
@@ -1598,11 +1603,13 @@ inline std::vector<ConstMemoryInfo> ConstSessionImpl<T>::GetMemoryInfoForOutputs
15981603

15991604
auto num_outputs = GetOutputCount();
16001605
std::vector<ConstMemoryInfo> mem_infos;
1601-
mem_infos.resize(num_outputs);
1606+
if (num_outputs > 0) {
1607+
mem_infos.resize(num_outputs);
16021608

1603-
ThrowOnError(GetApi().SessionGetMemoryInfoForOutputs(this->p_,
1604-
reinterpret_cast<const OrtMemoryInfo**>(mem_infos.data()),
1605-
num_outputs));
1609+
ThrowOnError(GetApi().SessionGetMemoryInfoForOutputs(this->p_,
1610+
reinterpret_cast<const OrtMemoryInfo**>(mem_infos.data()),
1611+
num_outputs));
1612+
}
16061613
return mem_infos;
16071614
}
16081615

@@ -1631,12 +1638,12 @@ template <typename T>
16311638
inline std::vector<ConstEpDevice> ConstSessionImpl<T>::GetEpDeviceForInputs() const {
16321639
auto num_inputs = GetInputCount();
16331640
std::vector<ConstEpDevice> input_devices;
1634-
input_devices.resize(num_inputs);
1635-
1636-
ThrowOnError(GetApi().SessionGetEpDeviceForInputs(this->p_,
1637-
reinterpret_cast<const OrtEpDevice**>(input_devices.data()),
1638-
num_inputs));
1639-
1641+
if (num_inputs > 0) {
1642+
input_devices.resize(num_inputs);
1643+
ThrowOnError(GetApi().SessionGetEpDeviceForInputs(this->p_,
1644+
reinterpret_cast<const OrtEpDevice**>(input_devices.data()),
1645+
num_inputs));
1646+
}
16401647
return input_devices;
16411648
}
16421649

js/common/lib/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
// This file is generated by /js/scripts/update-version.ts
55
// Do not modify file content manually.
66

7-
export const version = '1.23.0';
7+
export const version = '1.23.1';

js/common/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"license": "MIT",
33
"type": "module",
44
"name": "onnxruntime-common",
5-
"version": "1.23.0",
5+
"version": "1.23.1",
66
"repository": {
77
"url": "https://github.com/Microsoft/onnxruntime.git",
88
"type": "git"

js/node/lib/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
// This file is generated by /js/scripts/update-version.ts
55
// Do not modify file content manually.
66

7-
export const version = '1.23.0';
7+
export const version = '1.23.1';

0 commit comments

Comments
 (0)