You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building an ExecuTorch Android Demo App <https://github.com/pytorch-labs/executorch-examples/tree/main/dl3/android/DeepLabV3Demo#executorch-android-demo-app>
Copy file name to clipboardExpand all lines: docs/source/tutorial-xnnpack-delegate-lowering.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,7 @@ Now you should be able to find the executable built at `./cmake-out/backends/xnn
176
176
```
177
177
178
178
## 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.
180
180
181
181
## Profiling
182
182
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).
Copy file name to clipboardExpand all lines: docs/source/using-executorch-android.md
+9
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ The AAR artifact contains the Java library for users to integrate with their Jav
22
22
- LLaMa-specific Custom ops library.
23
23
- Comes with two ABI variants, arm64-v8a and x86\_64.
24
24
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
+
25
27
## Using AAR from Maven Central
26
28
27
29
ExecuTorch is available on [Maven Central](https://mvnrepository.com/artifact/org.pytorch/executorch-android).
@@ -38,6 +40,11 @@ dependencies {
38
40
39
41
Note: `org.pytorch:executorch-android:0.5.1` corresponds to executorch v0.5.0.
40
42
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.
Copy file name to clipboardExpand all lines: docs/source/using-executorch-building-from-source.md
+20-4
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ portability details.
67
67
./install_executorch.sh
68
68
```
69
69
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.
- 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
+
238
254
### iOS
239
255
240
256
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.
268
284
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:
269
285
270
286
*[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.
272
288
* 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