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
Allow operators to be called outside of the kernel registry
Summary:
Usecase from Whatsapp (D67169920) to:
- use dtype selective build to create executorch_generated_lib
- use portable lib operators directly in C++
- ^cover these usecases in the same dependency
This requires removing the compiler flag '-fvisibility=hidden', so that the operator symbols are exposed in the archive file. Otherwise, we get missing operator symbols, like in P1697209425.
Alternative solution 1:
Add the operator dependency explicitly, eg. adding `//executorch/kernels/portable/cpu:op_cat`, to the dep list, to allow C++ usage.
This causes duplicate symbols for dependencies in op_cat, because dtype selective build re-builds the portable lib.
Without dtype selective build, this would be OK, as we use `//executorch/kernels/portable:operators` that aggregates the individual operator targets under the hood; this would be deduplicated with the explicit operator dependency.
Alternative solution 2:
Expose the operator registry and add a helper utility to return the function ptr to the kernel, though this could be an intrusive change that opens operator registry to external clients outside the core runtime. cc tarun292.
Differential Revision: D67229096
0 commit comments