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