You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: #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
0 commit comments