[QNN EP] Support htp_reused_io_limit_mb provider option for HTP AOT context load - #752
Merged
Merged
Conversation
chunghow-qti
force-pushed
the
dev/chunghow/reused-io-limit
branch
from
August 25, 2026 07:00
5e980d1 to
42490e9
Compare
Collaborator
Author
|
/ci |
chunghow-qti
marked this pull request as ready for review
August 25, 2026 11:20
chunghow-qti
requested review from
qti-ashwshan,
qti-chuteng,
qti-jkilpatrick,
qti-kromero,
qti-yuduo,
tirupath-qti and
yath1
as code owners
August 25, 2026 11:20
chunghow-qti
requested review from
huaychou,
kuanyul-qti,
minfhong-qti and
yuhuchua-qti
August 26, 2026 06:46
kuanyul-qti
reviewed
Aug 26, 2026
huaychou
reviewed
Aug 27, 2026
huaychou
left a comment
Collaborator
There was a problem hiding this comment.
Do we need to add htp_reused_io_limit_mb in onnxruntime_perf_test?
chunghow-qti
requested review from
qti-mbadnara,
qti-shubham and
quic-calvnguy
as code owners
August 28, 2026 04:15
Collaborator
Author
|
will rebase on PR#778 and PR#677 |
chunghow-qti
requested review from
huaychou,
kuanyul-qti,
minfhong-qti and
qti-hungjuiw
August 31, 2026 13:29
chunghow-qti
force-pushed
the
dev/chunghow/reused-io-limit
branch
from
September 7, 2026 03:15
1c79f42 to
95e4a80
Compare
minfhong-qti
reviewed
Sep 7, 2026
huaychou
reviewed
Sep 7, 2026
minfhong-qti
reviewed
Sep 8, 2026
huaychou
reviewed
Sep 8, 2026
huaychou
reviewed
Sep 9, 2026
huaychou
approved these changes
Sep 9, 2026
Collaborator
Author
|
Update the doc to use |
qti-chuteng
reviewed
Sep 9, 2026
qti-chuteng
reviewed
Sep 9, 2026
qti-chuteng
approved these changes
Sep 10, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
htp_reused_io_limit_mbprovider option for the HTP backend, wired through toQNN_HTP_CONTEXT_CONFIG_OPTION_REUSED_IO_LIMITwhen loading a cached QNN context binary (LoadCachedQnnContextFromBuffer).ep.qnnexecutionprovider.reused_io_limit_mbvalue in MB. Default is0, which leaves the SDK's default (unbounded) behavior unchanged.Motivation and Context
QNN HTP assumes no I/O reuse and estimates the context's memory using the total I/O size of all graphs in the context. If you actually share (reuse) one or more I/O buffers across multiple graphs in a context, or across multiple contexts, that default estimate can overshoot what the context really needs.
This overestimation matters because HTP loads each context into one of several process domains (PDs), each with a limited memory budget. An inflated estimate can cause a context to be placed in its own PD instead of sharing one with others (which is slower, since contexts on different PDs pay extra cost to talk to each other) — or it can cause the context to fail to load at all (QNN error 1002, "Failed to find available PD") even though it would actually fit.
By explicitly specifying the reused I/O size, you let QNN HTP use a smaller, more accurate estimate instead.
Test plan
Take a context binary that fails to load by default (QNN error 1002, "Failed to find available PD"). Load it
htp_reused_io_limit_mbis applied on both AOT context-load pathscontextCreateFromBinary: load four static-1024 contexts withhtp_reused_io_limit_mb=2; confirm QNN verbose log reportsSetting Reused IO memory estimation to 2 MBand all contexts load successfully.contextCreateFromBinaryListAsync: runQnnHTPBackendTests.HtpSharedResourceOptimization_HtpReusedIoLimitMb_LoadsSucceeds;confirm QNN verbose log reports
Setting Reused IO memory estimation to 128 MB.