Repository navigation
Isolate cached delegates by Module lifetime (#24462) - #24462
alirezamonfared wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24462
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 362a88f with merge base 893d815 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
@alirezamonfared has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122851825. |
This PR needs a
|
Summary: Pull Request resolved: pytorch#24462 ## Summary The QNN backend caches a `QnnManager` so methods in one ExecuTorch `Module` can share an expensive QNN context. The previous cache key used only the exported context signature, so independent modules loading equivalent programs could share a manager that was placement-allocated from one module's runtime allocator. Key the cache by both context signature and runtime allocator. Methods in one module continue to share a context, while independent modules receive managers with independent lifetimes. The change also: - serializes cache lookup, insertion, membership checks, and removal; - avoids allocating a manager on cache hits; - removes cache state before running the non-trivial `QnnManager` destructor. ## Scope This fixes sequential independent-module lifetime isolation. It does not change exported program contents, backend selection, or model behavior. Broader same-module concurrent execution and initialization races remain outside this change. Differential Revision: D122851825
9179591 to
362a88f
Compare
Summary:
Summary
The QNN backend caches a
QnnManagerso methods in one ExecuTorchModulecan share an expensive QNN context. The previous cache key used only the exported context signature, so independent modules loading equivalent programs could share a manager that was placement-allocated from one module's runtime allocator.Key the cache by both context signature and runtime allocator. Methods in one module continue to share a context, while independent modules receive managers with independent lifetimes.
The change also:
QnnManagerdestructor.Scope
This fixes sequential independent-module lifetime isolation. It does not change exported program contents, backend selection, or model behavior. Broader same-module concurrent execution and initialization races remain outside this change.
Differential Revision: D122851825
cc @cbilgin @psiddh