Skip to content

Commit ef774ff

Browse files
Improve android related docs (#9860)
For android demo, use links in pytorch-labs/executorch-examples Remove references to old demo app Add video Co-authored-by: Hansong <[email protected]>
1 parent 0c80f56 commit ef774ff

8 files changed

+20
-14
lines changed
139 KB
Loading
1.92 MB
Binary file not shown.

docs/source/backend-delegates-xnnpack-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@ def _qdq_quantized_linear(
142142
You can read more indepth explanations on PyTorch 2 quantization [here](https://pytorch.org/tutorials/prototype/pt2e_quant_ptq.html).
143143

144144
## See Also
145-
- [Integrating XNNPACK Delegate Android App](demo-apps-android.md)
145+
- [Integrating XNNPACK Delegate in Android AAR](using-executorch-android.md)
146146
- [Complete the Lowering to XNNPACK Tutorial](tutorial-xnnpack-delegate-lowering.md)

docs/source/backends-qualcomm.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,6 @@ The command-line arguments are written in [utils.py](https://github.com/pytorch/
351351
The model, inputs, and output location are passed to `qnn_executorch_runner` by `--model_path`, `--input_list_path`, and `--output_folder_path`.
352352

353353

354-
### Running a model via ExecuTorch's android demo-app
355-
356-
An Android demo-app using Qualcomm AI Engine Direct Backend can be found in
357-
`examples`. Please refer to android demo app [tutorial](demo-apps-android.md).
358-
359354
## Supported model list
360355

361356
Please refer to `$EXECUTORCH_ROOT/examples/qualcomm/scripts/` and `EXECUTORCH_ROOT/examples/qualcomm/oss_scripts/` to the list of supported models.

docs/source/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ExecuTorch provides support for:
4141
- [Building from Source](using-executorch-building-from-source)
4242
- [FAQs](using-executorch-faqs)
4343
#### Examples
44-
- [Android Demo Apps](demo-apps-android.md)
44+
- [Android Demo Apps](https://github.com/pytorch-labs/executorch-examples/tree/main/dl3/android/DeepLabV3Demo#executorch-android-demo-app)
4545
- [iOS Demo Apps](demo-apps-ios.md)
4646
#### Backends
4747
- [Overview](backends-overview)
@@ -142,7 +142,7 @@ using-executorch-faqs
142142
:caption: Examples
143143
:hidden:
144144
145-
demo-apps-android.md
145+
Building an ExecuTorch Android Demo App <https://github.com/pytorch-labs/executorch-examples/tree/main/dl3/android/DeepLabV3Demo#executorch-android-demo-app>
146146
demo-apps-ios.md
147147
```
148148

docs/source/tutorial-xnnpack-delegate-lowering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Now you should be able to find the executable built at `./cmake-out/backends/xnn
176176
```
177177

178178
## Building and Linking with the XNNPACK Backend
179-
You can build the XNNPACK backend [CMake target](https://github.com/pytorch/executorch/blob/main/backends/xnnpack/CMakeLists.txt#L83), and link it with your application binary such as an Android or iOS application. For more information on this you may take a look at this [resource](demo-apps-android.md) next.
179+
You can build the XNNPACK backend [CMake target](https://github.com/pytorch/executorch/blob/main/backends/xnnpack/CMakeLists.txt#L83), and link it with your application binary such as an Android or iOS application. For more information on this you may take a look at this [resource](./using-executorch-android.md) next.
180180

181181
## Profiling
182182
To enable profiling in the `xnn_executor_runner` pass the flags `-DEXECUTORCH_ENABLE_EVENT_TRACER=ON` and `-DEXECUTORCH_BUILD_DEVTOOLS=ON` to the build command (add `-DENABLE_XNNPACK_PROFILING=ON` for additional details). This will enable ETDump generation when running the inference and enables command line flags for profiling (see `xnn_executor_runner --help` for details).

docs/source/using-executorch-android.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ The AAR artifact contains the Java library for users to integrate with their Jav
2222
- LLaMa-specific Custom ops library.
2323
- Comes with two ABI variants, arm64-v8a and x86\_64.
2424

25+
The AAR library can be used for generic Android device with arm64-v8a or x86_64 architecture. It can be used across form factors, including phones, tablets, tv boxes, etc, as it does not contain any UI components.
26+
2527
## Using AAR from Maven Central
2628

2729
ExecuTorch is available on [Maven Central](https://mvnrepository.com/artifact/org.pytorch/executorch-android).
@@ -38,6 +40,11 @@ dependencies {
3840

3941
Note: `org.pytorch:executorch-android:0.5.1` corresponds to executorch v0.5.0.
4042

43+
Click the screenshot below to watch the *demo video* on how to add the package and run a simple ExecuTorch model with Android Studio.
44+
<a href="https://pytorch.org/executorch/main/_static/img/android_studio.mp4">
45+
<img src="https://pytorch.org/executorch/main/_static/img/android_studio.jpeg" width="800" alt="Integrating and Running ExecuTorch on Android">
46+
</a>
47+
4148
## Using AAR file directly
4249

4350
You can also directly specify an AAR file in the app. We upload pre-built AAR to S3 during each release, or as a snapshot.
@@ -103,6 +110,8 @@ export ANDROID_NDK=/path/to/ndk
103110
sh scripts/build_android_library.sh
104111
```
105112

113+
Currently, XNNPACK backend is always built with the script.
114+
106115
### Optional environment variables
107116

108117
Optionally, set these environment variables before running `build_android_library.sh`.

docs/source/using-executorch-building-from-source.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Or alternatively, [install conda on your machine](https://conda.io/projects/cond
6363
./install_executorch.sh
6464
```
6565

66-
Use the [`--pybind` flag](https://github.com/pytorch/executorch/blob/main/install_executorch.sh#L26-L29) to install with pybindings and dependencies for other backends.
66+
Use the [`--pybind` flag](https://github.com/pytorch/executorch/blob/main/install_executorch.sh#L26-L29) to install with pybindings and dependencies for other backends.
6767
```bash
6868
./install_executorch.sh --pybind <coreml | mps | xnnpack>
6969

@@ -82,7 +82,7 @@ Or alternatively, [install conda on your machine](https://conda.io/projects/cond
8282
For development mode, run the command with `--editable`, which allows us to modify Python source code and see changes reflected immediately.
8383
```bash
8484
./install_executorch.sh --editable [--pybind xnnpack]
85-
85+
8686
# Or you can directly do the following if dependencies are already installed
8787
# either via a previous invocation of `./install_executorch.sh` or by explicitly installing requirements via `./install_requirements.sh` first.
8888
pip install -e .
@@ -196,7 +196,7 @@ I 00:00:00.000612 executorch:executor_runner.cpp:138] Setting up planned buffer
196196
I 00:00:00.000669 executorch:executor_runner.cpp:161] Method loaded.
197197
I 00:00:00.000685 executorch:executor_runner.cpp:171] Inputs prepared.
198198
I 00:00:00.000764 executorch:executor_runner.cpp:180] Model executed successfully.
199-
I 00:00:00.000770 executorch:executor_runner.cpp:184] 1 outputs:
199+
I 00:00:00.000770 executorch:executor_runner.cpp:184] 1 outputs:
200200
Output 0: tensor(sizes=[1], [2.])
201201
```
202202

@@ -206,6 +206,8 @@ Output 0: tensor(sizes=[1], [2.])
206206
Following are instruction on how to perform cross compilation for Android and iOS.
207207

208208
### Android
209+
210+
#### Building executor_runner shell binary
209211
- Prerequisite: [Android NDK](https://developer.android.com/ndk), choose one of the following:
210212
- Option 1: Download Android Studio by following the instructions to [install ndk](https://developer.android.com/studio/projects/install-ndk).
211213
- Option 2: Download Android NDK directly from [here](https://developer.android.com/ndk/downloads).
@@ -243,7 +245,7 @@ sh scripts/build_android_library.sh
243245
```
244246

245247
This script will build the AAR, which contains the Java API and its corresponding JNI library. Please see
246-
[this documentation](./using-executorch-android.md#using-aar-file) for usage.
248+
[this documentation](./using-executorch-android#using-aar-file) for usage.
247249

248250
### iOS
249251

@@ -278,5 +280,5 @@ Check out the [iOS Demo App](demo-apps-ios.md) tutorial for more info.
278280
You have successfully cross-compiled `executor_runner` binary to iOS and Android platforms. You can start exploring advanced features and capabilities. Here is a list of sections you might want to read next:
279281

280282
* [Selective build](kernel-library-selective-build.md) to build the runtime that links to only kernels used by the program, which can provide significant binary size savings.
281-
* Tutorials on building [Android](./demo-apps-android.md) and [iOS](./demo-apps-ios.md) demo apps.
283+
* Tutorials on building [Android](https://github.com/pytorch-labs/executorch-examples/tree/main/dl3/android/DeepLabV3Demo#executorch-android-demo-app) and [iOS](./demo-apps-ios.md) demo apps.
282284
* Tutorials on deploying applications to embedded devices such as [ARM Cortex-M/Ethos-U](backends-arm-ethos-u.md) and [XTensa HiFi DSP](./backends-cadence.md).

0 commit comments

Comments
 (0)