dtype selective build, link codegen and scalar_type_util (#1090)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/1090 1. Let codegen generate `selected_mobile_ops.h` based on `selected_operators.yaml` 2. Include header in `scalar_type_utils`. Add to visibility for codegen. 3. Create test for dtype selective build in scalar_utils. 4. Add buck config for dtype selective build. Dependencies: 1. Make scalar_type_utils depend on codegen headers (header lib only) to access `selected_mobile_ops.h`. 2. Split deps into `deps` and `kernel_deps`. Add `kernel_deps` to executorch_generated_library. There is a circular dependency if we leave it as is, where: - scalar_type_utils -> executorch_generated_lib (added dep) - executorch_generated_lib -> portable_ops (portable ops are a dependency to the genrule for `selected_operators.yaml`, but they do not need to be) - portable_ops -> kernel impls (eg. `op_add.cpp` etc.) - kernel impls -> scalar_type_utils (for macros) User flow: 1. User passes in the required executorch_generated_lib through buck config 2. See example in selective build examples. To do: include another dtype selection example when we can use model.pte for selective build. Reviewed By: larryliu0820 Differential Revision: D50561135 fbshipit-source-id: c52b6318bc1909c9c73a0ba231ecc2a6f01d1d22
L
Lucy Qiu committed
00d3dc7026d30219a38ca8b82e0e203938e2906d
Parent: 423f3bc
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 10/25/2023, 10:23:45 AM