Registry / ai-ml / executorch

executorch

JSON →
library1.3.1pypypi✓ verified 85d ago

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 executorch
INSTALL
IMPORT
SIG · EXECUTORCH
E
executorch
ai-mlpythonv1.3.1
Install
97.3s avg
Import
—
Disk
5376MB
Pass rate
2/ 10
Env Coverage2 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ no_wheel
✓ 104.8s
py 3.11
✕ no_wheel
3/4 runs
py 3.12
✕ no_wheel
3/4 runs
py 3.13
✕ no_wheel
✓ 89.8s
py 3.9
✕ no_wheel
3/4 runs
5376MB installed
● package 5376MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

to_executorch
✓ import executorch
✗ from executorch import to_executorch

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.

import torch import torch.nn as nn from torch._export.executorch import to_executorch from torch.export import export from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner # 1. Define a simple PyTorch model class SimpleModel(nn.Module): def __init__(self): super().__init__() self.linear = nn.Linear(10, 2) def forward(self, x): return self.linear(x) model = SimpleModel() # 2. Define example inputs (crucial for tracing and export) example_inputs = (torch.randn(1, 10),) # 3. Export the model to an ExportedProgram using PyTorch's export API exported_program = export(model, example_inputs) # 4. Convert the ExportedProgram to an ExecuTorch program (.pte file) # This requires specifying a backend delegate. XNNPACK is a common choice. # Ensure `executorch[xnnpack]` or equivalent is installed. executorch_program = to_executorch(exported_program, [XnnpackPartitioner()]) # 5. Save the ExecuTorch program to a file with open("model.pte", "wb") as f: f.write(executorch_program.buffer) print("Model successfully exported to model.pte")
Debug
Known issues
breakingThe `export_llm` API was significantly changed/unified in v0.7.0. Older custom LLM export scripts will likely break. The general model export workflow also transitioned from older `executorch.exporters.model_exporter.model_exporter.export_to_edge` to `torch.export` followed by `torch._export.executorch.to_executorch`.
fix
Migrate to the new unified `export_llm` API for LLMs or the `torch.export` + `to_executorch` pattern for general models, referencing the latest documentation.
affects: <0.7.0
gotchaExecuTorch involves two main components: the Python model preparation/exporter and the C++/native runtime for target devices. While `pip install executorch` handles the Python part, building the C++ runtime and SDK for specific embedded/mobile targets is a separate, often complex, and platform-specific process, requiring CMake and toolchain setup.
fix
Refer to the official ExecuTorch documentation for your specific target platform (Android, iOS, Cortex-M, etc.) for detailed build instructions for the native runtime.
affects: All versions
gotchaThe `to_executorch` function requires a list of delegate builders (e.g., `[XnnpackPartitioner()]`) for model partitioning and optimization. If a backend delegate is not provided or not correctly configured/installed, the export process may fail or result in a program that does not utilize the target hardware effectively.
fix
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()])`.
affects: All versions
gotchaExecuTorch explicitly supports Python versions `>=3.10` and `<3.14`. Using unsupported Python versions may lead to installation issues, build failures, or runtime errors due to underlying dependencies like PyTorch itself.
fix
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.
affects: All versions
Upgrade
Version history
1.3.1latest on PyPI · released May 29, 2026
Audit
Dependencies
torchrequiredCore PyTorch library, ExecuTorch is built on top of it for model export.
pytorch-tokenizersrequiredRequired for certain model types, especially LLMs. Was explicitly added as a dependency in v1.0.1.
torchvisionrequiredRequired for vision models.
torchaudiorequiredRequired for audio models.
xnnpackoptionalOne of several optional backends for on-device inference.
coremltoolsoptionalRequired for the CoreML backend on Apple devices. Updated in v1.0.1.
Agent activity
27 hits · last 30 days
node
24
Amazon
2
OpenAI (training)
1
Resources
executorch — pip install executorch · libregistry