Skip to content

[EP ABI] Node_GetAttrByName returns ORT_NOT_FOUND with non-existing attr name - #25565

Merged
Adrian Lizarraga (adrianlizarraga) merged 14 commits into
mainfrom
adrianl/EpABI_GetAttrByName_NotFoundOk
Jul 29, 2025
Merged

Adrian Lizarraga (adrianlizarraga) merged 14 commits into
mainfrom
adrianl/EpABI_GetAttrByName_NotFoundOk

Conversation

@adrianlizarraga

@adrianlizarraga Adrian Lizarraga (adrianlizarraga) commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

Description

Updates Node_GetAttributeByName to return an error status with code ORT_NOT_FOUND and set the attribute output parameter to NULL when called with a non-existing attribute name.

Why? Currently, a caller has to do string comparison of the OrtStatus error message to determine if the attribute does not exist or if another error occurred. This can be somewhat cumbersome. With this change, the caller can just check the error code.

Motivation and Context

Make it easier to use Node_GetAttributeByName.

@adrianlizarraga Adrian Lizarraga (adrianlizarraga) changed the title [EP ABI] Allow calling Node_GetAttrByName with non-existing attr name [EP ABI] Node_GetAttrByName returns ORT_NOT_FOUND with non-existing attr name Jul 28, 2025
Comment thread onnxruntime/core/graph/ep_api_types.cc Outdated
Comment thread onnxruntime/test/ep_graph/test_ep_graph.cc Outdated
Comment thread onnxruntime/test/ep_graph/test_ep_graph.cc
Comment thread csharp/src/Microsoft.ML.OnnxRuntime/Exceptions.shared.cs Outdated
Comment thread include/onnxruntime/core/session/onnxruntime_c_api.h Outdated
@adrianlizarraga
Adrian Lizarraga (adrianlizarraga) deleted the adrianl/EpABI_GetAttrByName_NotFoundOk branch July 29, 2025 22:03
Changming Sun (snnn) pushed a commit that referenced this pull request Jul 30, 2025
…ttr name (#25565)

### Description
Updates `Node_GetAttributeByName` to return an error status with code
`ORT_NOT_FOUND` and set the `attribute` output parameter to `NULL` when
called with a non-existing attribute name.

Why? Currently, a caller has to do string comparison of the `OrtStatus`
error message to determine if the attribute does not exist or if another
error occurred. This can be somewhat cumbersome. With this change, the
caller can just check the error code.

### Motivation and Context
Make it easier to use `Node_GetAttributeByName`.
Changming Sun (snnn) pushed a commit that referenced this pull request Jul 30, 2025
- DynamicQuantizeMatMul - handle case where B zero point input is
provided but not constant. (#25544)
- Refactor plugin EP support (#25541)
- Remove the python installation steps from
win-qnn-arm64-ci-pipeline.yml (#25552)
- [EP ABI] Node_GetAttrByName returns ORT_NOT_FOUND with non-existing
attr name (#25565)
- Fix C/C++ documentation generation (#25569)
- [build] fix multi-config for VCPKG (#25585)
Sanket Kale (sanketkaleoss) pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
…ttr name (microsoft#25565)

### Description
Updates `Node_GetAttributeByName` to return an error status with code
`ORT_NOT_FOUND` and set the `attribute` output parameter to `NULL` when
called with a non-existing attribute name.

Why? Currently, a caller has to do string comparison of the `OrtStatus`
error message to determine if the attribute does not exist or if another
error occurred. This can be somewhat cumbersome. With this change, the
caller can just check the error code.

### Motivation and Context
Make it easier to use `Node_GetAttributeByName`.
qti-yuduo pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Sep 24, 2025
- Fix OrtNodeAttrHelper::Get after the change - microsoft#25565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants