SIGN IN SIGN UP

Add buck2 example for custom ops

Summary:
Similar to D48103652 and D48184410 but focusing on buck2 support.

This example demonstrates the ability to build a `exir_custom_ops_aot_lib` by using only C++ implementations of both functional and out variants of the custom op.

Specifically, let's assume a user has an op `my_ops::mul4` and already has a C++ implementation of it. The user registers this op through PyTorch C++ op registration API.

Now they want to run the same op on Executorch, naturally they need `my_ops::mul4.out` and a C++ implementation of it so that Executorch runtime can consume. `exir_custom_ops_aot_lib` is able to reuse this C++ impl for Executorch runtime, link it with `libtorch` and generate code to register it into PyTorch JIT runtime. This way the user doesn't have to write an extra Python impl.

This is the exact behavior demonstrated in D48184410, but instead of relying on CMake this diff enables BUCK2 targets.

Reviewed By: kimishpatel

Differential Revision: D48296936

fbshipit-source-id: 58ab7127f853549d29e7b25648dd7098219fe5c3
M
Mengwei Liu committed
95810861b346db28be988b3a3d155275b181c770
Parent: d1563b6
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 8/16/2023, 8:21:02 PM