Skip to content

'QnnEpFactory' should provide a fully-qualified path to the backend #25407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 21, 2025

Conversation

mschofie
Copy link
Member

@mschofie mschofie commented Jul 15, 2025

Description

The QnnEpFactory implementation currently initializes the underlying provider by passing the backend_type configuration as htp, causing the provider to find the appropriate backend-library, and load it relative to the OnnxRuntime library. But if EP's are distributed separately from the OnnxRuntime library - a major benefit of the EP ABI - then the backend-library may-well not be relative to the OnnxRuntime. Having the QnnEpFactory implementation look for its associated runtime relative to itself would allow the implementation to bring its own runtime - and that's what this PR enables.

If the QnnEpFactory implementation is co-located with the OnnxRuntime library, then this is consistent with the existing behavior, but an QnnEpFactory implementation that is shipped 'out-of-band' will use a backend-relative to itself.

WinML has been using a version of this fix, and this PR is 'upstreaming' the change.

Motivation and Context

To support out-of-band distribution of EP's - enabled by the EP ABI work - then EP's should accommodate finding dependencies relative to the EP library, and not the OnnxRuntime library.

nieubank
nieubank previously approved these changes Jul 15, 2025
@jywu-msft
Copy link
Member

build error for building as shared lib

@mschofie
Copy link
Member Author

build error for building as shared lib

Sorry... I assumed an MSVC-ism. Will fix shortly.

jywu-msft
jywu-msft previously approved these changes Jul 17, 2025
@jywu-msft jywu-msft dismissed their stale review July 17, 2025 21:04

found merge issues

@jywu-msft
Copy link
Member

@adrianlizarraga @skottmckay can you take a quick look at this?

@jywu-msft jywu-msft added the ep:QNN issues related to QNN exeution provider label Jul 18, 2025
@jywu-msft
Copy link
Member

conflict with #25456

@jywu-msft
Copy link
Member

conflict with #25456

I resolved the merge conflict. pls confirm it looks ok.

@mschofie
Copy link
Member Author

conflict with #25456

I resolved the merge conflict. pls confirm it looks ok.

Looks good, thanks.

@adrianlizarraga adrianlizarraga merged commit ca45ff2 into main Jul 21, 2025
90 checks passed
@adrianlizarraga adrianlizarraga deleted the mschofie/qnn-path branch July 21, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:QNN issues related to QNN exeution provider release:1.23.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants