Skip to content

Commit 41910cc

Browse files
committed
Other fixes
1 parent 1ded0ff commit 41910cc

5 files changed

+26
-11
lines changed

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/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: 4 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).
@@ -103,6 +105,8 @@ export ANDROID_NDK=/path/to/ndk
103105
sh scripts/build_android_library.sh
104106
```
105107

108+
Currently, XNNPACK backend is always built with the script.
109+
106110
### Optional environment variables
107111

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

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ portability details.
6767
./install_executorch.sh
6868
```
6969

70-
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.
70+
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.
7171
```bash
7272
./install_executorch.sh --pybind <coreml | mps | xnnpack>
7373

@@ -86,7 +86,7 @@ portability details.
8686
For development mode, run the command with `--editable`, which allows us to modify Python source code and see changes reflected immediately.
8787
```bash
8888
./install_executorch.sh --editable [--pybind xnnpack]
89-
89+
9090
# Or you can directly do the following if dependencies are already installed
9191
# either via a previous invocation of `./install_executorch.sh` or by explicitly installing requirements via `./install_requirements.sh` first.
9292
pip install -e .
@@ -200,7 +200,7 @@ I 00:00:00.000612 executorch:executor_runner.cpp:138] Setting up planned buffer
200200
I 00:00:00.000669 executorch:executor_runner.cpp:161] Method loaded.
201201
I 00:00:00.000685 executorch:executor_runner.cpp:171] Inputs prepared.
202202
I 00:00:00.000764 executorch:executor_runner.cpp:180] Model executed successfully.
203-
I 00:00:00.000770 executorch:executor_runner.cpp:184] 1 outputs:
203+
I 00:00:00.000770 executorch:executor_runner.cpp:184] 1 outputs:
204204
Output 0: tensor(sizes=[1], [2.])
205205
```
206206

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

212212
### Android
213+
214+
#### Building executor_runner shell binary
213215
- Prerequisite: [Android NDK](https://developer.android.com/ndk), choose one of the following:
214216
- Option 1: Download Android Studio by following the instructions to [install ndk](https://developer.android.com/studio/projects/install-ndk).
215217
- Option 2: Download Android NDK directly from [here](https://developer.android.com/ndk/downloads).
@@ -235,6 +237,20 @@ adb push add.pte /data/local/tmp/executorch
235237
adb shell "/data/local/tmp/executorch/executor_runner --model_path /data/local/tmp/executorch/add.pte"
236238
```
237239

240+
#### Building AAR for app integration from source
241+
- Prerequisite: Android NDK from the previous section, and Android SDK (Android Studio is recommended).
242+
243+
Assuming Android NDK and SDK is available, run:
244+
```bash
245+
export ANDROID_ABIS=arm64-v8a
246+
export BUILD_AAR_DIR=aar-out
247+
mkdir -p $BUILD_AAR_DIR
248+
sh scripts/build_android_library.sh
249+
```
250+
251+
This script will build the AAR, which contains the Java API and its corresponding JNI library. Please see
252+
[this documentation](./using-executorch-android#using-aar-file) for usage.
253+
238254
### iOS
239255

240256
For iOS we'll build [frameworks](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle) instead of static libraries, that will also contain the public headers inside.
@@ -268,5 +284,5 @@ Check out the [iOS Demo App](demo-apps-ios.md) tutorial for more info.
268284
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:
269285

270286
* [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.
271-
* Tutorials on building [Android](./demo-apps-android.md) and [iOS](./demo-apps-ios.md) demo apps.
287+
* 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.
272288
* 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)