From 5228bfa2fe7c6cb314ec96afd5126c13672982c0 Mon Sep 17 00:00:00 2001 From: Gregory Comer Date: Sun, 16 Feb 2025 17:55:06 -0800 Subject: [PATCH] Move Apple runtime docs to new location --- docs/source/index.rst | 1 + docs/source/using-executorch-android.md | 22 ++++++++++++++++++- ...ple-runtime.md => using-executorch-ios.md} | 14 ++++++------ 3 files changed, 29 insertions(+), 8 deletions(-) rename docs/source/{apple-runtime.md => using-executorch-ios.md} (94%) diff --git a/docs/source/index.rst b/docs/source/index.rst index 7d316664092..7b8b46df951 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -89,6 +89,7 @@ Topics in this section will help you get started with ExecuTorch. using-executorch-android using-executorch-ios using-executorch-cpp + using-executorch-runtime-integration using-executorch-troubleshooting .. toctree:: diff --git a/docs/source/using-executorch-android.md b/docs/source/using-executorch-android.md index 0af96283f2b..cedb355810b 100644 --- a/docs/source/using-executorch-android.md +++ b/docs/source/using-executorch-android.md @@ -1,3 +1,23 @@ # Using ExecuTorch on Android -Placeholder for top-level Android documentation \ No newline at end of file +To use from Android, ExecuTorch provides Java API bindings and Android platform integration, available as a AAR file. The ExecuTorch C++ APIs can also be used from Android native. + +## Installation + +TODO Instructions on downloading the pre-built AAR. Replace with Maven/Gradle package management when available. + +### Building from Source + +TODO Instructions on re-creating and customizing the Android AAR. + +## Android Backends + +TODO Describe commonly used backends, including XNN, Vulkan, and NPUs. + +## Runtime Integration + +TODO Code sample in Java + +## Next Steps + +TODO Link to Java API reference and other relevant material \ No newline at end of file diff --git a/docs/source/apple-runtime.md b/docs/source/using-executorch-ios.md similarity index 94% rename from docs/source/apple-runtime.md rename to docs/source/using-executorch-ios.md index 4114b780607..68599065f6a 100644 --- a/docs/source/apple-runtime.md +++ b/docs/source/using-executorch-ios.md @@ -1,6 +1,8 @@ -# Integrating and Running ExecuTorch on Apple Platforms +# Using ExecuTorch on iOS -**Author:** [Anthony Shoumikhin](https://github.com/shoumikhin) +ExecuTorch supports both iOS and macOS via Objective-C, Swift, and C++. ExecuTorch also provides backends to leverage Core ML and Metal Performance Shaders (MPS) for hardware-accelerated execution on Apple platforms. + +## Integration The ExecuTorch Runtime for iOS and macOS is distributed as a collection of prebuilt [.xcframework](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle) binary targets. These targets are compatible with both iOS and macOS devices and simulators and are available in both release and debug modes: @@ -17,8 +19,6 @@ Link your binary with the ExecuTorch runtime and any backends or kernels used by **Note:** To access logs, link against the Debug build of the ExecuTorch runtime, i.e., the `executorch_debug` framework. For optimal performance, always link against the Release version of the deliverables (those without the `_debug` suffix), which have all logging overhead removed. -## Integration - ### Swift Package Manager The prebuilt ExecuTorch runtime, backend, and kernels are available as a [Swift PM](https://www.swift.org/documentation/package-manager/) package. @@ -84,9 +84,9 @@ swift package resolve swift build ``` -### Local Build +### Building from Source -Another way to integrate the ExecuTorch runtime is to build the necessary components from sources locally and link against them. This route is more involved but certainly doable. +Another way to integrate the ExecuTorch runtime is to build the necessary components from sources locally and link against them. This is useful when customizing the runtime. 1. Install [Xcode](https://developer.apple.com/xcode/resources/) 15+ and Command Line Tools: @@ -195,7 +195,7 @@ import ExecuTorch ### Logging -We provide extra APIs for logging in Objective-C and Swift as a lightweight wrapper of the internal ExecuTorch machinery. To use it, just import the main framework header in Objective-C. Then use the `ExecuTorchLog` interface (or the `Log` class in Swift) to subscribe your own implementation of the `ExecuTorchLogSink` protocol (or `LogSink` in Swift) to listen to log events. +ExecuTorch provides extra APIs for logging in Objective-C and Swift as a lightweight wrapper of the internal ExecuTorch machinery. To use it, just import the main framework header in Objective-C. Then use the `ExecuTorchLog` interface (or the `Log` class in Swift) to subscribe your own implementation of the `ExecuTorchLogSink` protocol (or `LogSink` in Swift) to listen to log events. ```objectivec #import