Skip to content

Commit e772ec7

Browse files
larryliu0820malfet
authored andcommitted
Update runner_build.md with correct cmake commands (#461)
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 6da36ee commit e772ec7

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

docs/runner_build.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ Options:
1919
To build runner-aoti, run the following commands *from the torchchat root directory*
2020

2121
```
22-
cmake -S ./runner-aoti -B ./runner-aoti/cmake-out -G Ninja -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'`
23-
cmake --build ./runner-aoti/cmake-out
22+
# Pull submodules (re2, abseil) for Tiktoken
23+
git submodule sync
24+
git submodule update --init
25+
26+
cmake -S . -B ./cmake-out -G Ninja -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'`
27+
cmake --build ./cmake-out --target et_run
2428
```
2529

26-
After running these, the runner-aoti binary is located at ./runner-aoti/cmake-out/run.
30+
After running these, the runner-aoti binary is located at ./cmake-out/aoti_run.
2731

2832
Let us try using it with an example.
2933
We first download stories15M and export it to AOTI.
@@ -37,7 +41,7 @@ We can now execute the runner with:
3741

3842
```
3943
wget -O ./tokenizer.bin https://github.com/karpathy/llama2.c/raw/master/tokenizer.bin
40-
./runner-aoti/cmake-out/run ./model.so -z ./tokenizer.bin -i "Once upon a time"
44+
./cmake-out/aoti_run ./model.so -z ./tokenizer.bin -i "Once upon a time"
4145
```
4246

4347
## Building and running runner-et
@@ -47,12 +51,16 @@ Before building runner-et, you must first setup ExecuTorch by following [setup E
4751
To build runner-et, run the following commands *from the torchchat root directory*
4852

4953
```
54+
# Pull submodules (re2, abseil) for Tiktoken
55+
git submodule sync
56+
git submodule update --init
57+
5058
export TORCHCHAT_ROOT=${PWD}
51-
cmake -S ./runner-et -B ./runner-et/cmake-out -G Ninja
52-
cmake --build ./runner-et/cmake-out
59+
cmake -S . -B ./cmake-out -G Ninja
60+
cmake --build ./cmake-out --target et_run
5361
```
5462

55-
After running these, the runner-et binary is located at ./runner-et/cmake-out/run.
63+
After running these, the runner-et binary is located at ./cmake-out/et_run.
5664

5765
Let us try using it with an example.
5866
We first download stories15M and export it to ExecuTorch.
@@ -66,5 +74,5 @@ We can now execute the runner with:
6674

6775
```
6876
wget -O ./tokenizer.bin https://github.com/karpathy/llama2.c/raw/master/tokenizer.bin
69-
./runner-et/cmake-out/run ./model.pte -z ./tokenizer.bin -i "Once upon a time"
77+
./cmake-out/et_run ./model.pte -z ./tokenizer.bin -i "Once upon a time"
7078
```

0 commit comments

Comments
 (0)