forked from pytorch/executorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let custom_ops_aot_lib use portable_lib (pytorch#4024)
Summary: Currently on Mac we can't import portable_lib then import sdpa_with_kv_cache. The reason is that they both statically link `executorch_no_prim_ops.a` and when they are both dlopen'd in python they are holding 2 copies of the static variables in `executorch_no_prim_ops.a` such as [initialized](https://github.com/pytorch/executorch/blob/main/runtime/platform/default/posix.cpp#L70). Pull Request resolved: pytorch#4024 Test Plan: On Mac, make sure the pybind custom ops is able to import. ``` from executorch.extension.pybindings import portable_lib from executorch.examples.models.llama2.custom_ops import sdpa_with_kv_cache portable_lib._get_operator_names() > ... > llama::sdpa_with_kv_cache.out ``` Reviewed By: dbort Differential Revision: D58883985 Pulled By: larryliu0820 fbshipit-source-id: 0a42d90a53a90da83f8b57504844cbf67688d8f8
- Loading branch information
1 parent
78688b7
commit 398ce66
Showing
2 changed files
with
29 additions
and
32 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
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