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
remove buck2 from custom operator registration (#4233) (#4244)
Summary:
Pull Request resolved: #4233
For alpha+, we need to remove all buck2 commands and buck2 dependencies from static doc and github readmes.
This diff gets rid of the buck2 from custom operator registration examples.
Reviewed By: larryliu0820
Differential Revision: D59661023
fbshipit-source-id: 25b4fec3f5ff71e615bc52b4b465d31a8e4c6c87
(cherry picked from commit 17ae009)
Co-authored-by: Songhao Jia <[email protected]>
@@ -37,24 +37,11 @@ After the model is exported by EXIR, we need C++ implementations of these custom
37
37
```
38
38
For how to write these YAML entries, please refer to [`kernels/portable/README.md`](https://github.com/pytorch/executorch/blob/main/kernels/portable/README.md).
39
39
40
-
Currently we provide 2 build systems that links `my_ops::mul3.out` kernel (written in `custom_ops_1.cpp`) to Executor runtime: buck2 and CMake. Both instructions are listed in `examples/portable/custom_ops/test_custom_ops.sh`(test_buck2_custom_op_1 and test_cmake_custom_op_1).
40
+
Currently we use Cmake as the build system to link the `my_ops::mul3.out` kernel (written in `custom_ops_1.cpp`) to the ExecuTorch runtime. See instructions in:`examples/portable/custom_ops/test_custom_ops.sh`(test_cmake_custom_op_1).
41
41
42
42
## Selective build
43
43
44
-
Note that we have defined a custom op for both `my_ops::mul3.out` and `my_ops::mul4.out` in `custom_ops.yaml`. Below is a demonstration of how to only register the operator from the model we are running into the runtime.
45
-
46
-
In CMake, this is done by passing in a list of operators to `gen_oplist` custom rule: `--root_ops="my_ops::mul4.out"`.
47
-
48
-
In Buck2, this is done by a rule called `et_operator_library`:
49
-
```python
50
-
et_operator_library(
51
-
name = "select_custom_ops_2",
52
-
ops = [
53
-
"my_ops::mul4.out",
54
-
],
55
-
...
56
-
)
57
-
```
44
+
Note that we have defined a custom op for both `my_ops::mul3.out` and `my_ops::mul4.out` in `custom_ops.yaml`. To reduce binary size, we can choose to only register the operators used in the model. This is done by passing in a list of operators to the `gen_oplist` custom rule, for example: `--root_ops="my_ops::mul4.out"`.
58
45
59
46
We then let the custom ops library depend on this target, to only register the ops we want.
0 commit comments