-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QNN EP]: Clean up QNN logging resources if an error occurs during in…
…itialization (#23435) ### Description Re-implementation of #23320 (which was reverted). - Cleans up QNN logging resources if an error occurs during initialization. - Updates `QnnLogging()`, which is a logging callback called by QNN libs, to handle situations in which ORT logging is unavailable, thus avoiding a segmentation fault. - Updates `QnnBackendManager::CreateHtpPowerCfgId()` and `QnnBackendManager::SetHtpPowerConfig()` to check that backend setup is complete. These functions get called in QNN EP's `OnRunStart()` even if QNN backend setup failed and the model is assigned to a different EP. This prevents a segmentation fault. Our Android tests ran into this issue because the QNN backend setup failed, the model was then assigned to CPU EP, and the QNN EP's `OnRunStart()` was still called with an invalid backend. ### Motivation and Context If QNN initialization fails at any point, we have to properly clean up the logging resources so that QNN does not call our `QnnLogging()` callback after the EP has been destroyed.
- Loading branch information
1 parent
997ab24
commit c7f764c
Showing
1 changed file
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters