Skip to content

Commit 3351eb4

Browse files
digantdesaifacebook-github-bot
authored andcommitted
setting_up_executorch cleanup
Summary: - Use header formatting for steps so they show up in the outline - Make step names more explicit - Add a clone/submodule step to the Runtime section so that users don't need to do the AOT part first Reviewed By: dbort Differential Revision: D47920806 fbshipit-source-id: ad2146957411faace8b0045eaaff895043e61fb6
1 parent ee5ffe3 commit 3351eb4

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

docs/website/docs/tutorials/00_setting_up_executorch.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ This is a tutorial for building and installing Executorch from the GitHub reposi
44

55
## AOT Setup [(Open on Google Colab)](https://colab.research.google.com/drive/1m8iU4y7CRVelnnolK3ThS2l2gBo7QnAP#scrollTo=1o2t3LlYJQY5)
66

7+
[(Open on Google Colab)](https://colab.research.google.com/drive/1oJBt3fj_Tr3FE7L9RdUgSKK9XzJfUv4F#scrollTo=fC4CB3kFhHPJ)
78

89
This will install an `executorch` pip package to your conda environment and
910
allow you to export your PyTorch model to a flatbuffer file using ExecuTorch.
1011

11-
**Step 1: Set up a conda environment**
12+
### Step 1: Set up a conda environment
1213

1314
To install conda, you can look at the
1415
[conda installation guide](https://conda.io/projects/conda/en/latest/user-guide/install/index.html).
@@ -25,22 +26,21 @@ conda install -c conda-forge flatbuffers
2526
pip install --force-reinstall --pre torch -i https://download.pytorch.org/whl/nightly/cpu
2627
```
2728

28-
**Step 2: Set up Executorch**. This will install an `executorch` pip package to your conda environment.
29-
```bash
29+
### Step 2: Install the `executorch` pip package
30+
31+
This will install an `executorch` pip package to your conda environment.
3032

33+
```bash
3134
# Do one of these, depending on how your auth is set up
3235
git clone https://github.com/pytorch/executorch.git
3336
git clone [email protected]:pytorch/executorch.git
3437

35-
# [Runtime requirement] Run the following to get all submodules, only need for runtime setup
38+
# Install the pip package
3639
cd executorch
37-
git submodule update --init
38-
3940
pip install .
40-
4141
```
4242

43-
**Step 3: Try it out**
43+
### Step 3: Generate a program file from an `nn.Module`
4444

4545
Via python script:
4646
```bash
@@ -53,7 +53,7 @@ python3 -m examples.export.export_and_delegate --option "composite"
5353

5454
Or via python interpreter:
5555
```python
56-
(executorch) ~/ $ python
56+
$ python3
5757
>>> import executorch.exir as exir
5858
>>> from executorch.exir.tests.models import Mul
5959
>>> m = Mul()
@@ -63,19 +63,38 @@ Or via python interpreter:
6363

6464
## Runtime Setup
6565

66-
**Step 1: Install buck2**
66+
### Step 1: Install buck2
6767

6868
- If you don't have the `zstd` commandline tool, install it with `pip install zstd`
6969
- Download a prebuilt buck2 archive for your system from https://github.com/facebook/buck2/releases/tag/2023-07-18
70-
- Decompress with the following command (filename will need to change for non-Linux systems).
70+
- Decompress with the following command (filename depends on your system)
7171

72-
```
73-
zstd -cdq buck2-x86_64-unknown-linux-musl.zst > /tmp/buck2 && chmod +x /tmp/buck2
72+
```bash
73+
# For example, buck2-x86_64-unknown-linux-musl.zst
74+
zstd -cdq buck2-DOWNLOADED_FILENAME.zst > /tmp/buck2 && chmod +x /tmp/buck2
7475
```
7576

7677
You may want to copy the `buck2` binary into your `$PATH` so you can run it as `buck2`.
7778

78-
**Step 2: Build a binary**
79+
### Step 2: Clone the `executorch` repo
80+
81+
Clone the repo if you haven't already.
82+
83+
```bash
84+
# Do one of these, depending on how your auth is set up
85+
git clone https://github.com/pytorch/executorch.git
86+
git clone [email protected]:pytorch/executorch.git
87+
```
88+
89+
Ensure that git has fetched the submodules. This is only necessary after
90+
cloning.
91+
92+
```bash
93+
cd executorch
94+
git submodule update --init
95+
```
96+
97+
### Step 3: Build a binary
7998

8099
`executor_runner` is an example wrapper around executorch runtime which includes all the operators and backends
81100

@@ -90,7 +109,7 @@ If you run into `Stderr: clang-14: error: invalid linker name in argument '-fuse
90109
conda install -c conda-forge lld
91110
```
92111

93-
**Step 3: Run a binary**
112+
### Step 3: Run a binary
94113

95114
```bash
96115
# add.ff is the program generated from export_example.py during AOT Setup Step 3

0 commit comments

Comments
 (0)