ExecuTorch
PyTorch-native AI inference from phones and laptops to microcontrollers
ExecuTorch is PyTorch's open source stack for running AI locally on phones,
wearables, laptops, browsers, embedded systems, and microcontrollers. Start with
a PyTorch model, capture it with torch.export, optimize it for target hardware,
and run it through C++, Python, Swift/Objective-C, Kotlin/Java, or JavaScript
APIs.
ExecuTorch powers on-device experiences across Instagram, WhatsApp, Facebook,
and Messenger, serving billions of people. It also runs AI features on
Meta Quest and Ray-Ban Meta devices.
See where ExecuTorch is shipping.
Built for current edge workloads
| Workload |
Representative capabilities |
Start here |
| Local LLM and agent building blocks |
Quantized text models, long context, tool calling, speculative decoding, multi-session execution, and an experimental OpenAI-compatible local server |
Muse Glimmer · LLM guide · LLM server |
| Voice |
Streaming and offline speech recognition, speech synthesis, voice activity detection, and speaker diarization |
Voxtral Realtime · Parakeet · Sortformer diarization · Voxtral TTS · Nemotron 3 Diarization · Phonon TTS |
| Multimodal |
Text, image, and audio runners; mobile vision-language models |
Gemma 4 · Multimodal runner |
| Computer vision |
Image classification, object detection, semantic segmentation, and promptable segmentation |
MobileNet V2 · YOLO26 · DeepLabV3 · EfficientSAM |
| Embedded AI |
Cortex-M CPU kernels, Ethos-U and NXP NPUs, Cadence DSPs, Espressif ESP32 MCUs, Zephyr, Arduino, and Raspberry Pi Pico workflows |
Embedded guide · Cortex-M · Arduino |
These are starting points, not a compatibility list. A model does not need to
appear here to run with ExecuTorch: use the
standard export guide
or adapt the closest model example. Deployment depends on
torch.export capture plus operator, runtime, and selected-backend coverage;
validate numerical accuracy, memory use, and performance on the target. For a
new language-model architecture, see the
custom LLM guide.
Why ExecuTorch
- PyTorch-native workflow: work directly from
torch.export, with PyTorch
program metadata and source mappings available to export and debugging tools.
- Partitioned hardware acceleration: delegate supported graph regions to
CPU, GPU, NPU, or DSP backends while retaining portable CPU kernels for
fallback.
- One source model, explicit targets: reuse the PyTorch model and export
flow, while producing a backend-specific
.pte for each target that needs
hardware specialization.
- A runtime you can right-size: link only the operators, kernels, and
delegates a deployment needs;
selective build
keeps only the required operator kernels.
- Inspect, profile, and extend: use
ETDump,
ETRecord, and
numeric debugging,
or add custom operators and backends.
- Versioned deployment contract: a
.pte created with stable APIs is
guaranteed to load and execute for at least one following non-patch runtime
release; see the
runtime compatibility and
API lifecycle policies.
Install
Install the latest stable Python package in a Python 3.11–3.15 environment:
On Linux this is the CUDA build, matching the torch package on PyPI. On macOS
and Windows it is the CPU build. For the CPU-only Linux build or another CUDA
version, see
Getting Started.
Install a nightly built from main to use the newest features:
pip install --upgrade --pre executorch torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
torch is explicit because nightly ExecuTorch wheels do not declare it as a
dependency. This command installs a CPU-only PyTorch nightly. On Linux with an
NVIDIA GPU, select the nightly command matching your CUDA version in the
PyTorch installation selector and
use its nightly/cu* index instead; otherwise, pip can replace a CUDA-enabled
PyTorch installation with the CPU build. ExecuTorch CUDA wheels are published
for Linux only.
Backend export tools can require optional dependencies. For example, use
pip install 'executorch[ethos_u]' for Ethos-U AOT export. Embedded
toolchains, simulators, and target runtimes are installed separately.
For platform-specific setup (Android, iOS, embedded systems), see the
Quick Start
documentation for additional information.
The prebuilt Python wheel is published for Linux x86-64, Linux AArch64, macOS
arm64, and Windows x86-64. Build from source for other hosts or custom
configurations. Native integration is also available through:
Five-minute export and run
This complete example, from the
quick-start pathway,
exports a small model and lowers it to XNNPACK:
import torch
from executorch.exir import to_edge_transform_and_lower
from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner
from executorch.runtime import Runtime
class Add(torch.nn.Module):
def forward(self, x, y):
return x + y
model = Add().eval()
sample_inputs = (torch.ones(1), torch.ones(1))
et_program = to_edge_transform_and_lower(
torch.export.export(model, sample_inputs),
partitioner=[XnnpackPartitioner()]
).to_executorch()
with open("add.pte", "wb") as f:
f.write(et_program.buffer)
runtime = Runtime.get()
runtime_program = runtime.load_program("add.pte")
method = runtime_program.load_method("forward")
output = method.execute(sample_inputs)[0]
torch.testing.assert_close(output, model(*sample_inputs))
print("Output:", output)
Expected output: Output: tensor([2.]). This verifies export, XNNPACK lowering,
serialization, loading, and execution on the host; measure performance again on
the target device.
The resulting add.pte is specialized for the selected backend. Targeting
Core ML, Qualcomm, or another accelerator requires that backend's dependencies,
configuration, and a separate export, not a blind partitioner substitution.
Continue with the Python runtime,
C++ Module API,
Android, or
iOS.
Choose an export path
| Starting point |
Recommended path |
Scope |
PyTorch nn.Module |
Standard export and lowering |
Full backend choice; some models need decompositions or custom operators |
Hugging Face PreTrainedModel |
Transformers ExecuTorch exporter |
Experimental programmatic XNNPACK/CUDA export; generation components require application orchestration |
| Optimized text or multimodal generation |
export_llm or Optimum ExecuTorch |
Tested recipes, quantization, tokenizers, and runner-specific metadata |
Already have a compatible .pte? Browse the
ExecuTorch Community,
Arm AI model catalog filtered to ExecuTorch,
or, where available, the linked model pages above. Match the model
configuration, precision, backend, and runtime; a .pte built for one hardware
delegate is not a universal model file.
Runtime and LLM APIs
Use C++, Python, Java/Kotlin, Swift/Objective-C, or JavaScript/WebAssembly for
general .pte execution. Higher-level text and multimodal runners are available
for C++, Python, Android, and Apple platforms.
Compare the runtime and LLM APIs
for language-specific entry points and API maturity.
Platforms and hardware backends
Choose a backend based on target hardware, operator coverage, and deployment
constraints. The linked guides document setup, supported hardware, and known
limitations. These are representative paths; the
backend documentation
is authoritative. See also the Desktop guide.
Documentation
Community and contributing
Citing ExecuTorch
Read the MLSys 2026 paper (PDF).
If you use ExecuTorch in research, please cite:
@article{executorch2026,
title={{ExecuTorch} - A Unified {PyTorch} Solution to Run {AI} Models On-Device},
author={Nachin, Mergen and Desai, Digant and Jia, Sicheng Stephen and Lai, Chen and Liu, Mengwei and Szwejbka, Jacob and Alvarez, Raziel and Ascani, RJ and Bort, Dave and Candales, Manuel and
others},
journal={arXiv preprint arXiv:2605.08195},
url={https://arxiv.org/abs/2605.08195},
year={2026}
}
License
ExecuTorch is BSD licensed. See LICENSE.