Skip to content

Conversation

@edgchen1
Copy link
Contributor

Description

  • Some documentation updates. Goal is to clarify and make consistent. Changes are definitely open to discussion.
  • Fix possible leak of OrtAllocator.

Motivation and Context

Documentation updates and clean up.

Comment on lines -207 to -214
/** \brief The ONNX Runtime version the OrtNodeFusionOptions was compiled with.
*
* Implementation should set to ORT_API_VERSION.
* ORT will use this to ensure it does not use members that were not available when the EP library was compiled.
*
* \since Version 1.23.
*/
uint32_t ort_version_supported;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete this info?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was trying to make it consistent and I chose the more concise version. alternatively, I could add this info to the other ort_version_supported docs.

Comment on lines +322 to +325
* The created instance must be released with OrtEpApi::ReleaseEpDevice.
*
* \note When called from OrtEpFactory::GetSupportedDevices to populate the ep_devices output, ORT will take
* ownership of the OrtEpDevice instances.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When else would it be called? Wondering if the doco should be saying 'release if you don't provide to ORT in GetSupportedDevices'. Or maybe reverse the order of the two statements and remove the \note if we only expect usage in GetSupportedDevices.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, the main point I'd like to convey is that CreateEpDevice's output must be released with ReleaseEpDevice.

it just so happens that OrtEpFactory::GetSupportedDevices is the primary place CreateEpDevice is expected to be called, and that ORT will take ownership of the OrtEpDevice on success.


/** \brief Create an OrtHardwareDevice.
*
* The created instance must be released with OrtEpApi::ReleaseHardwareDevice.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the OrtEpDevice using this is provided to ORT do we take a copy, or the user needs to keep this valid and not release until EP unload?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, we do not copy the OrtHardwareDevice. OrtEpDevice creation just copies the pointer. currently, the user would need to ensure that a created OrtHardwareDevice doesn't get released before OrtEpDevices are done using it.

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