ExecuTorch is an on-device AI framework that extends PyTorch to mobile, embedded, and edge devices. It enables efficient inference by compiling PyTorch models into a compact, optimized format (.pte file) suitable for resource-constrained environments. The current version, 1.2.0, expands model and hardware support, including real-time speech and improved embedded targets. Releases are frequent, typically every 1-2 months, aligning with PyTorch releases.
pip install executorchVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a simple PyTorch model, export it using `torch.export`, and then convert it into an ExecuTorch program (.pte file) using the `to_executorch` function with an XNNPACK delegate. The resulting .pte file can then be deployed to target devices.
Migrate to the new unified `export_llm` API for LLMs or the `torch.export` + `to_executorch` pattern for general models, referencing the latest documentation.
Refer to the official ExecuTorch documentation for your specific target platform (Android, iOS, Cortex-M, etc.) for detailed build instructions for the native runtime.
Ensure you have installed ExecuTorch with the correct backend extras (e.g., `pip install executorch[xnnpack]`) and provide instantiated delegate builders to `to_executorch`, e.g., `to_executorch(exported_program, [YourDelegate()])`.
Ensure your Python environment is within the supported range (e.g., `python 3.10`, `3.11`, `3.12`). Use `pyenv` or `conda` to manage Python versions if needed.