-
Notifications
You must be signed in to change notification settings - Fork 607
Let custom_ops_aot_lib use portable_lib #4024
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4024
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d9652f7 with merge base 5e22836 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow this really simplifies things at the top level! I'm glad this works; looks great.
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). 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
5209d05
to
d9652f7
Compare
This pull request was exported from Phabricator. Differential Revision: D58883985 |
@larryliu0820 merged this pull request in 398ce66. |
Summary: After #4024, sdpa is no longer in portable_lib by default, import separately. Differential Revision: D61163753
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 inexecutorch_no_prim_ops.a
such as initialized.Test Plan:
On Mac, make sure the pybind custom ops is able to import.
Reviewers:
Subscribers:
Tasks:
Tags: