Skip to content

Commit 3807045

Browse files
dbortfacebook-github-bot
authored andcommitted
Remove buck2 references from examples/portable/README.md (#4027)
Summary: Change the example to use cmake instead, and show some example output. Pull Request resolved: #4027 Test Plan: Ran the new instructions in the README.md after running `./install_requirements.sh` to install the `executorch` python module. Reviewed By: Gasoonjia Differential Revision: D58850983 Pulled By: dbort fbshipit-source-id: d73ea0b570713d6fc89706c591f5c250eb529a87
1 parent f428d03 commit 3807045

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

examples/portable/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,37 @@ Use `-h` (or `--help`) to see all the supported models.
4444
3. Once we have the model binary (`.pte`) file, then let's run it with ExecuTorch runtime using the `executor_runner`.
4545

4646
```bash
47-
buck2 run examples/portable/executor_runner:executor_runner -- --model_path ./mv2.pte
47+
# Build the tool from the top-level `executorch` directory.
48+
(rm -rf cmake-out \
49+
&& mkdir cmake-out \
50+
&& cd cmake-out \
51+
&& cmake -DEXECUTORCH_PAL_DEFAULT=posix ..) \
52+
&& cmake --build cmake-out -j32 --target executor_runner
53+
54+
# Run the tool on the generated model.
55+
./cmake-out/executor_runner --model_path mv2.pte
4856
```
4957

58+
This will run the model with all input tensor elements set to `1`, and print
59+
the outputs. For example:
60+
```
61+
I 00:00:00.004885 executorch:executor_runner.cpp:73] Model file mv2.pte is loaded.
62+
I 00:00:00.004902 executorch:executor_runner.cpp:82] Using method forward
63+
I 00:00:00.004906 executorch:executor_runner.cpp:129] Setting up planned buffer 0, size 18652672.
64+
I 00:00:00.007243 executorch:executor_runner.cpp:152] Method loaded.
65+
I 00:00:00.007490 executorch:executor_runner.cpp:162] Inputs prepared.
66+
I 00:00:06.887939 executorch:executor_runner.cpp:171] Model executed successfully.
67+
I 00:00:06.887975 executorch:executor_runner.cpp:175] 1 outputs:
68+
Output 0: tensor(sizes=[1, 1000], [
69+
-0.50986, 0.300638, 0.0953877, 0.147722, 0.231202, 0.338555, 0.20689, -0.057578, -0.389269, -0.060687,
70+
-0.0213992, -0.121035, -0.288955, 0.134054, -0.171976, -0.0603627, 0.0203591, -0.0585333, 0.337855, -0.0718644,
71+
0.490758, 0.524144, 0.197857, 0.122066, -0.35913, 0.109461, 0.347747, 0.478515, 0.226558, 0.0363523,
72+
...,
73+
-0.227163, 0.567008, 0.202894, 0.71008, 0.421649, -0.00655106, 0.0114818, 0.398908, 0.0349851, -0.163213,
74+
0.187843, -0.154387, -0.22716, 0.150879, 0.265103, 0.087489, -0.188225, 0.0213046, -0.0293779, -0.27963,
75+
0.421221, 0.10045, -0.506771, -0.115818, -0.693015, -0.183256, 0.154783, -0.410679, 0.0119293, 0.449714,
76+
])
77+
```
5078

5179
## Custom Operator Registration
5280

0 commit comments

Comments
 (0)