File size: 1,167 Bytes
d87f91e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# ExecuTorch
Executorch is a PyTorch inference API for Edge Devices.
## Instructions
A prebuilt tar is included.
## Build
To build executorch you will require `cmake` and `python3`. You will also require `torch`.
```shell
# get executorch git
git clone --branch viable/strict https://github.com/pytorch/executorch.git /tmp/executorch
cd /tmp/executorch && git submodule sync && git submodule update --init
# copy missing files (monkey patch)
# We require these files for building execu
ls /usr/local/lib/python3.10/dist-packages/torchgen/packaged/ATen/native/
# This is a workaround for now
mkdir -p /usr/lib/python3/dist-packages/torchgen/packaged/ATen/native/
cp /usr/local/lib/python3.10/dist-packages/torchgen/packaged/ATen/native/* /usr/lib/python3/dist-packages/torchgen/packaged/ATen/native/
```
Run this Python Code
```python
import sysconfig
lib_path = sysconfig.get_paths()["purelib"]
print(lib_path)
```
Copy the LIB PATH into this `CMAKE_PREFIX_PATH` value
```shell
cd /tmp/executorch; CMAKE_PREFIX_PATH={lib_path} EXECUTORCH_BUILD_XNNPACK=ON bash ./install_executorch.sh --pybind xnnpack; echo "build completed"
```
Wait for build to complete.
|