README.md
1# Selective Build Examples
2To optimize binary size of ExecuTorch runtime, selective build can be used. This folder contains examples to select only the operators needed for ExecuTorch build. This example will demonstrate the CMake build.
3
4## How to run
5
6Prerequisite: finish the [setting up wiki](https://pytorch.org/executorch/stable/getting-started-setup).
7
8Run:
9
10```bash
11cd executorch
12bash examples/selective_build/test_selective_build.sh cmake
13```
14
15Check out `CMakeLists.txt` for demo of 3 selective build APIs:
161. `SELECT_ALL_OPS`: Select all ops from the dependency kernel libraries, register all of them into ExecuTorch runtime.
172. `SELECT_OPS_LIST`: Only select operators from a list.
183. `SELECT_OPS_YAML`: Only select operators from a yaml file.
19
20Other configs:
21- `MAX_KERNEL_NUM=N`: Only allocate memory for N operators.
22
23We have one more API incoming: only select from an exported model file (.pte).
24