Skip to content

Commit bb738ba

Browse files
authored
Merge pull request #863 from intel/sync_msft_25112025
Sync with Microsoft ONNX Runtime - 25/11/2025
2 parents 5a06f68 + 6274e3c commit bb738ba

File tree

82 files changed

+4456
-540
lines changed

Some content is hidden

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

82 files changed

+4456
-540
lines changed

cmake/deps.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ googletest;https://github.com/google/googletest/archive/refs/tags/v1.17.0.zip;f6
3131
googlexnnpack;https://github.com/google/XNNPACK/archive/3cf85e705098622d59056dcb8f5f963ea7bb0a00.zip;6f6bbba627241f89463ca845febaf063982b34fe
3232
json;https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.zip;5e88795165cc8590138d1f47ce94ee567b85b4d6
3333
microsoft_gsl;https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip;cf368104cd22a87b4dd0c80228919bb2df3e2a14
34-
microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.zip;e4a542a323c070376f7c2d1973d0f7ddbc1d2fa5
34+
microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.250325.1.zip;826c8bd47c2258ec61b8b218e031e5b33d27f761
3535
mimalloc;https://github.com/microsoft/mimalloc/archive/refs/tags/v2.1.1.zip;d5ee7d34223d0567892db5179849939c8769dc41
3636
mp11;https://github.com/boostorg/mp11/archive/refs/tags/boost-1.82.0.zip;9bc9e01dffb64d9e0773b2e44d2f22c51aace063
3737
onnx;https://github.com/onnx/onnx/archive/refs/tags/v1.19.1.zip;c5215b5697dcdfd71799f001b8c4054a6bba6b09

cmake/onnxruntime_unittests.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,8 +1528,14 @@ endif()
15281528
onnxruntime_add_shared_library(onnxruntime_runtime_path_test_shared_library
15291529
${onnxruntime_runtime_path_test_shared_library_src})
15301530

1531-
target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE
1532-
onnxruntime_common cpuinfo ${CMAKE_DL_LIBS})
1531+
if (CMAKE_SYSTEM_NAME MATCHES "AIX")
1532+
target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE
1533+
onnxruntime_common ${CMAKE_DL_LIBS})
1534+
set_target_properties(onnxruntime_runtime_path_test_shared_library PROPERTIES AIX_SHARED_LIBRARY_ARCHIVE OFF)
1535+
else()
1536+
target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE
1537+
onnxruntime_common cpuinfo ${CMAKE_DL_LIBS})
1538+
endif()
15331539
target_include_directories(onnxruntime_runtime_path_test_shared_library PRIVATE ${ONNXRUNTIME_ROOT})
15341540

15351541
if(UNIX)

docs/OperatorKernels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Do not modify directly.*
8888
|Conv|*in* X:**T**<br> *in* W:**T**<br> *in* B:**T**<br> *out* Y:**T**|22+|**T** = tensor(float)|
8989
|||[11, 21]|**T** = tensor(float)|
9090
|||[1, 10]|**T** = tensor(float)|
91-
|ConvInteger|*in* x:**T1**<br> *in* w:**T2**<br> *in* x_zero_point:**T1**<br> *in* w_zero_point:**T2**<br> *out* y:**T3**|10+|**T1** = tensor(uint8)<br/> **T2** = tensor(uint8)<br/> **T3** = tensor(int32)|
91+
|ConvInteger|*in* x:**T1**<br> *in* w:**T2**<br> *in* x_zero_point:**T1**<br> *in* w_zero_point:**T2**<br> *out* y:**T3**|10+|**T1** = tensor(int8), tensor(uint8)<br/> **T2** = tensor(int8), tensor(uint8)<br/> **T3** = tensor(int32)|
9292
|ConvTranspose|*in* X:**T**<br> *in* W:**T**<br> *in* B:**T**<br> *out* Y:**T**|22+|**T** = tensor(float)|
9393
|||[11, 21]|**T** = tensor(float)|
9494
|||[1, 10]|**T** = tensor(float)|

include/onnxruntime/core/framework/allocator.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ struct OrtArenaCfg {
3838
int max_dead_bytes_per_chunk; // use -1 to allow ORT to choose the default
3939
int initial_growth_chunk_size_bytes; // use -1 to allow ORT to choose the default
4040
int64_t max_power_of_two_extend_bytes; // use -1 to allow ORT to choose the default
41+
// Use CudaMemPool based arena if available (starting with cuda 11.2)
42+
int use_cuda_mempool = -1;
43+
// Amount of reserved memory in bytes to hold onto before trying
44+
// to release memory back to the OS.
45+
uint64_t cuda_mempool_release_threshold = 0;
46+
// Bytes to keep on shrink for CudaMemPool, 0 is to attempt to release all, allocated space not affected.
47+
size_t cuda_mempool_bytes_to_keep_on_shrink = 0;
4148

4249
bool IsValid() {
4350
return arena_extend_strategy >= -1 && arena_extend_strategy <= 1 &&
@@ -55,6 +62,9 @@ struct OrtArenaCfg {
5562
static constexpr const char* InitialGrowthChunkSizeBytes = "arena.initial_growth_chunk_size_bytes";
5663
static constexpr const char* MaxPowerOfTwoExtendBytes = "arena.max_power_of_two_extend_bytes";
5764
static constexpr const char* MaxMem = "arena.max_mem";
65+
static constexpr const char* UseCudaMemPool = "arena.use_cuda_mempool";
66+
static constexpr const char* CudaMempoolReleaseThreshold = "arena.cuda_mempool_release_threshold";
67+
static constexpr const char* CudaMempoolBytesToKeepOnShrink = "arena.cuda_mempool_bytes_to_keep_on_shrink";
5868
};
5969

6070
static onnxruntime::common::Status FromKeyValuePairs(const OrtKeyValuePairs& kvps, OrtArenaCfg& cfg);
@@ -348,4 +358,13 @@ void AllocatorDefaultFree(void* p);
348358
void* AllocatorDefaultAllocAligned(size_t size, size_t alignment);
349359
void AllocatorDefaultFreeAligned(void* p, size_t alignment);
350360

361+
class IArena : public IAllocator {
362+
public:
363+
using IAllocator::IAllocator;
364+
virtual Status Shrink() = 0;
365+
// Only implemented when IsStreamAware() returns true
366+
virtual void ReleaseStreamBuffers(Stream* /*stream*/) {}
367+
static IArena* SafeArenaCast(IAllocator* allocator);
368+
};
369+
351370
} // namespace onnxruntime

include/onnxruntime/core/session/onnxruntime_c_api.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6591,6 +6591,23 @@ struct OrtApi {
65916591
* \since Version 1.24
65926592
*/
65936593
ORT_API_T(bool, TensorTypeAndShape_HasShape, _In_ const OrtTensorTypeAndShapeInfo* info);
6594+
6595+
/** \brief Get all config entries from ::OrtKernelInfo.
6596+
*
6597+
* Gets all configuration entries from the ::OrtKernelInfo object as key-value pairs.
6598+
* Config entries are set on the ::OrtSessionOptions and are accessible in custom operator kernels.
6599+
*
6600+
* Used in the CreateKernel callback of an OrtCustomOp to access all session configuration entries
6601+
* during kernel construction.
6602+
*
6603+
* \param[in] info An instance of ::OrtKernelInfo.
6604+
* \param[out] out A pointer to a newly created OrtKeyValuePairs instance containing all config entries.
6605+
* Note: the user should call OrtApi::ReleaseKeyValuePairs.
6606+
*
6607+
* \snippet{doc} snippets.dox OrtStatus Return Value
6608+
* \since Version 1.24
6609+
*/
6610+
ORT_API2_STATUS(KernelInfo_GetConfigEntries, _In_ const OrtKernelInfo* info, _Outptr_ OrtKeyValuePairs** out);
65946611
};
65956612

65966613
/*

include/onnxruntime/core/session/onnxruntime_cxx_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,6 +2768,8 @@ struct KernelInfoImpl : Base<T> {
27682768

27692769
std::string GetNodeName() const;
27702770
Logger GetLogger() const;
2771+
2772+
KeyValuePairs GetConfigEntries() const;
27712773
};
27722774

27732775
} // namespace detail

include/onnxruntime/core/session/onnxruntime_cxx_inline.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2822,6 +2822,13 @@ inline Logger KernelInfoImpl<T>::GetLogger() const {
28222822
return Logger{out};
28232823
}
28242824

2825+
template <typename T>
2826+
inline KeyValuePairs KernelInfoImpl<T>::GetConfigEntries() const {
2827+
OrtKeyValuePairs* out = nullptr;
2828+
Ort::ThrowOnError(GetApi().KernelInfo_GetConfigEntries(this->p_, &out));
2829+
return KeyValuePairs{out};
2830+
}
2831+
28252832
inline void attr_utils::GetAttr(const OrtKernelInfo* p, const char* name, float& out) {
28262833
Ort::ThrowOnError(GetApi().KernelInfoGetAttribute_float(p, name, &out));
28272834
}

include/onnxruntime/core/session/onnxruntime_ep_device_ep_metadata_keys.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// Key for the execution provider version string. This should be available for all plugin EPs.
1010
static const char* const kOrtEpDevice_EpMetadataKey_Version = "version";
1111

12+
// Key for the execution provider OS driver version.
13+
static const char* const kOrtEpDevice_EpMetadataKey_OSDriverVersion = "os_driver_version";
14+
1215
// Prefix for execution provider compatibility information stored in model metadata.
1316
// Used when generating EP context models to store compatibility strings for each EP.
1417
// Full key format: "ep_compatibility_info.<EP_TYPE>"

0 commit comments

Comments
 (0)