Skip to content

Commit a4f505f

Browse files
Merge branch 'main' into adrianl/BaseTester_SupportCompileAndKernelPluginEps
2 parents 5e54793 + a5dc0f9 commit a4f505f

File tree

56 files changed

+739
-1255
lines changed

Some content is hidden

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

56 files changed

+739
-1255
lines changed

cmake/onnxruntime_unittests.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,13 @@ endif()
15201520
onnxruntime_common ${CMAKE_DL_LIBS})
15211521
set_target_properties(onnxruntime_runtime_path_test_shared_library PROPERTIES AIX_SHARED_LIBRARY_ARCHIVE OFF)
15221522
else()
1523-
target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE
1524-
onnxruntime_common cpuinfo ${CMAKE_DL_LIBS})
1523+
if (CPUINFO_SUPPORTED)
1524+
target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE
1525+
onnxruntime_common cpuinfo ${CMAKE_DL_LIBS})
1526+
else()
1527+
target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE
1528+
onnxruntime_common ${CMAKE_DL_LIBS})
1529+
endif()
15251530
endif()
15261531
target_include_directories(onnxruntime_runtime_path_test_shared_library PRIVATE ${ONNXRUNTIME_ROOT})
15271532

dockerfiles/Dockerfile.source

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ RUN cd /code && /bin/bash ./build.sh --allow_running_as_root --skip_submodule_sy
1616
FROM mcr.microsoft.com/azurelinux/base/python:3
1717
COPY --from=0 /code/build/Linux/Release/dist /root
1818
COPY --from=0 /code/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt
19-
RUN tdnf install -y ca-certificates python3-setuptools python3-wheel python3-pip python3-numpy python3-flatbuffers python3-packaging python3-protobuf python3-mpmath python3-sympy && python3 -m pip install coloredlogs humanfriendly && python3 -m pip install --no-index --find-links /root onnxruntime && rm -rf /root/*.whl
19+
RUN tdnf install -y ca-certificates python3-setuptools python3-wheel python3-pip python3-numpy python3-flatbuffers python3-packaging python3-protobuf python3-mpmath python3-sympy && python3 -m pip install humanfriendly && python3 -m pip install --no-index --find-links /root onnxruntime && rm -rf /root/*.whl

docs/OperatorKernels.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ Do not modify directly.*
240240
|||[13, 15]|**B** = tensor(bool)<br/> **I** = tensor(int64)<br/> **V** = seq(tensor(bfloat16)), seq(tensor(bool)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(string)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)), tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)|
241241
|||[11, 12]|**B** = tensor(bool)<br/> **I** = tensor(int64)<br/> **V** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)|
242242
|||[1, 10]|**B** = tensor(bool)<br/> **I** = tensor(int64)<br/> **V** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)|
243-
|LpNormalization|*in* input:**T**<br> *out* output:**T**|1+|**T** = tensor(double), tensor(float)|
243+
|LpNormalization|*in* input:**T**<br> *out* output:**T**|22+|**T** = tensor(double), tensor(float)|
244+
|||[1, 21]|**T** = tensor(double), tensor(float)|
244245
|LpPool|*in* X:**T**<br> *out* Y:**T**|22+|**T** = tensor(float)|
245246
|||[18, 21]|**T** = tensor(float)|
246247
|||[11, 17]|**T** = tensor(float)|

docs/python/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ furo
1111
pyquickhelper
1212
pandas
1313
pydot
14-
coloredlogs
1514
flatbuffers
1615
numpy<2.0.0
1716
packaging

include/onnxruntime/core/framework/allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ constexpr const char* OpenVINO_GPU = "OpenVINO_GPU";
8585
constexpr const char* OpenVINO_RT = "OpenVINO_RT";
8686
constexpr const char* OpenVINO_RT_NPU = "OpenVINO_RT_NPU";
8787
constexpr const char* QNN_HTP_SHARED = "QnnHtpShared";
88-
constexpr const char* WEBGPU_BUFFER = "WebGPU_Buffer";
89-
constexpr const char* WEBNN_TENSOR = "WebNN_Tensor";
88+
constexpr const char* WEBGPU_BUFFER = "WebGPU_Buf"; // limited to 10 chars to ensure std::string SSO for web
89+
constexpr const char* WEBNN_TENSOR = "WebNN_Ten"; // limited to 10 chars to ensure std::string SSO for web
9090

9191
constexpr size_t kAllocAlignment = 256;
9292
constexpr const size_t kAlloc4KAlignment = 4096;

include/onnxruntime/core/session/onnxruntime_c_api.h

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7196,11 +7196,36 @@ struct OrtApi {
71967196
*/
71977197
ORT_API_T(void, RunOptionsSetSyncStream, _Inout_ OrtRunOptions* options, _In_ OrtSyncStream* sync_stream);
71987198

7199+
/** \brief Get the element data type and shape for an OrtValue that represents a Tensor (scalar, dense, or sparse).
7200+
*
7201+
* \note This function is an alternative to ::GetTensorTypeAndShape() that does not allocate a new array for
7202+
* the shape data. The OrtValue instance's internal shape data is returned directly.
7203+
*
7204+
* \note Returns an error if the underlying OrtValue is not a Tensor.
7205+
*
7206+
* \param[in] value The OrtValue instance.
7207+
* \param[out] elem_type Output parameter set to the tensor element data type.
7208+
* \param[out] shape_data Output parameter set to the OrtValue instance's internal shape data array.
7209+
* For a scalar, `shape_data` is NULL and `shape_data_count` is 0.
7210+
* Must not be released as it is owned by the OrtValue instance. This pointer becomes invalid
7211+
* when the OrtValue is released or if the underlying shape data is updated or reallocated.
7212+
* \param[out] shape_data_count Output parameter set to the number of elements in `shape_data`.
7213+
* `shape_data_count` is 0 for a scalar.
7214+
*
7215+
* \snippet{doc} snippets.dox OrtStatus Return Value
7216+
*
7217+
* \since Version 1.24.
7218+
*/
7219+
ORT_API2_STATUS(GetTensorElementTypeAndShapeDataReference, _In_ const OrtValue* value,
7220+
_Out_ ONNXTensorElementDataType* elem_type,
7221+
_Outptr_result_maybenull_ const int64_t** shape_data,
7222+
_Out_ size_t* shape_data_count);
7223+
71997224
/** \brief Enable profiling for this run
72007225
*
72017226
* \param[in] options
72027227
* \param[in] profile_file_prefix The prefix for the profile file. The actual filename will be:
7203-
* <profile_file_prefix>_<timestamp>.json
7228+
* [profile_file_prefix]_[timestamp].json
72047229
*
72057230
* \snippet{doc} snippets.dox OrtStatus Return Value
72067231
*

include/onnxruntime/core/session/onnxruntime_cxx_api.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,6 +2233,19 @@ struct ConstValueImpl : Base<T> {
22332233
const R* GetSparseTensorValues() const;
22342234

22352235
#endif
2236+
2237+
/// <summary>
2238+
/// Returns the tensor's element type and a reference to the tensor's internal shape data. The shape data is owned
2239+
/// by the Ort::Value and becomes invalid when the Ort::Value is destroyed or if the underlying shape data is
2240+
/// updated or reallocated.
2241+
///
2242+
/// For a scalar, shape.shape is nullptr and shape.shape_len is 0.
2243+
///
2244+
/// Wraps OrtApi::GetTensorElementTypeAndShapeDataReference.
2245+
/// </summary>
2246+
/// <param name="elem_type">Output parameter set to the element's data type.</param>
2247+
/// <param name="shape">Output parameter set to the OrtValue instance's shape data and number of elements.</param>
2248+
void GetTensorElementTypeAndShapeDataReference(ONNXTensorElementDataType& elem_type, Shape& shape) const;
22362249
};
22372250

22382251
template <typename T>

include/onnxruntime/core/session/onnxruntime_cxx_inline.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,6 +2387,13 @@ inline const R* ConstValueImpl<T>::GetSparseTensorValues() const {
23872387

23882388
#endif
23892389

2390+
template <typename T>
2391+
void ConstValueImpl<T>::GetTensorElementTypeAndShapeDataReference(ONNXTensorElementDataType& elem_type,
2392+
Shape& shape) const {
2393+
ThrowOnError(GetApi().GetTensorElementTypeAndShapeDataReference(this->p_, &elem_type, &shape.shape,
2394+
&shape.shape_len));
2395+
}
2396+
23902397
template <typename T>
23912398
void ValueImpl<T>::FillStringTensor(const char* const* s, size_t s_len) {
23922399
ThrowOnError(GetApi().FillStringTensor(this->p_, s, s_len));

0 commit comments

Comments
 (0)