AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻译准备中
On-device AI across mobile, embedded and edge for PyTorch
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗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.
[!IMPORTANT] Release channels: use the latest release with the stable documentation. This README tracks
main; features labeled Main / nightly may change before release. Use the main documentation with a source checkout or nightly package.
| 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 |
| 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, 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.
torch.export, with PyTorch
program metadata and source mappings available to export and debugging tools..pte for each target that needs
hardware specialization..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 the latest stable Python package in a Python 3.11–3.15 environment:
pip install executorch
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:
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.
| 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.
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.
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.
| Target | Backends and integrations |
|---|---|
| Android | XNNPACK CPU; Vulkan GPU; Qualcomm, MediaTek, Arm VGF, and Samsung Exynos accelerators |
| iOS / iPadOS | XNNPACK CPU; Core ML; MLX on physical devices (experimental) |
| macOS | XNNPACK; Core ML; experimental MLX, Metal/AOTInductor, and WebGPU paths |
| Linux | ; ; experimental , , and desktop paths |
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}
}
ExecuTorch is BSD licensed. See LICENSE.
| Windows | XNNPACK; OpenVINO; experimental CUDA/AOTInductor and Vulkan desktop paths |
| Browser / WebAssembly | Portable WebAssembly runtime and WebGPU (both experimental) |
| Embedded / MCU | Arm Cortex-M with CMSIS-NN (beta); Arm Ethos-U; NXP eIQ Neutron; Cadence DSP; Zephyr and Arduino integrations |