Skip to content

Conversation

@adrianlizarraga
Copy link
Contributor

Description

Fixes memory leak in OrtEpFactory::GetSupportedDevices(). The OrtKeyValuePairs instance created by the factory was not released.

This memory leak can be reproduced by running the unit test QnnHTPBackendTests.AutoEp_PreferNpu.

Motivation and Context

Fix memory leak that one encounters when using automatic EP selection (e.g., PREFER_NPU) with QNN EP.

Copy link
Contributor

@HectorSVC HectorSVC left a comment

Choose a reason for hiding this comment

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

:shipit:

@adrianlizarraga adrianlizarraga merged commit 8570298 into main Sep 5, 2025
93 of 94 checks passed
@adrianlizarraga adrianlizarraga deleted the adrianl/qnn-get-ep-devices-memleak branch September 5, 2025 23:52
snnn pushed a commit to snnn/onnxruntime that referenced this pull request Sep 8, 2025
…osoft#25968)

### Description
Fixes memory leak in `OrtEpFactory::GetSupportedDevices()`. The
`OrtKeyValuePairs` instance created by the factory was not released.

This memory leak can be reproduced by running the unit test
[QnnHTPBackendTests.AutoEp_PreferNpu](https://github.com/microsoft/onnxruntime/blob/4e2699fbf24d96d2a0261b30509864da08b701de/onnxruntime/test/providers/qnn/qnn_basic_test.cc#L1426).

### Motivation and Context
Fix memory leak that one encounters when using automatic EP selection
(e.g., PREFER_NPU) with QNN EP.

(cherry picked from commit 8570298)
snnn pushed a commit that referenced this pull request Sep 8, 2025
### Description
Fixes memory leak in `OrtEpFactory::GetSupportedDevices()`. The
`OrtKeyValuePairs` instance created by the factory was not released.

This memory leak can be reproduced by running the unit test
[QnnHTPBackendTests.AutoEp_PreferNpu](https://github.com/microsoft/onnxruntime/blob/4e2699fbf24d96d2a0261b30509864da08b701de/onnxruntime/test/providers/qnn/qnn_basic_test.cc#L1426).

### Motivation and Context
Fix memory leak that one encounters when using automatic EP selection
(e.g., PREFER_NPU) with QNN EP.

(cherry picked from commit 8570298)
snnn pushed a commit that referenced this pull request Sep 8, 2025
### Description
Fixes memory leak in `OrtEpFactory::GetSupportedDevices()`. The
`OrtKeyValuePairs` instance created by the factory was not released.

This memory leak can be reproduced by running the unit test
[QnnHTPBackendTests.AutoEp_PreferNpu](https://github.com/microsoft/onnxruntime/blob/4e2699fbf24d96d2a0261b30509864da08b701de/onnxruntime/test/providers/qnn/qnn_basic_test.cc#L1426).

### Motivation and Context
Fix memory leak that one encounters when using automatic EP selection
(e.g., PREFER_NPU) with QNN EP.

(cherry picked from commit 8570298)
snnn added a commit that referenced this pull request Sep 8, 2025
This PR cherry-picks the following PRs to the rel-1.23.0 branch:

* #25938
* #25957
* #25960
* #25968
* #25971

---------

Co-authored-by: Dmitri Smirnov <[email protected]>
Co-authored-by: Adrian Lizarraga <[email protected]>
Co-authored-by: Hariharan Seshadri <[email protected]>
@snnn
Copy link
Member

snnn commented Sep 8, 2025

This PR has been cherry-picked into the rel-1.23.0 branch in PR #25985. Removing the release:1.23.0 label.

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.

6 participants