需要 Python 3.11–3.15 环境;nightly 版 wheel 不声明 torch 依赖,必须显式一起安装 torch,否则可能被替换成 CPU 版;Ethos-U 等后端导出要另装可选依赖如 executorch[ethos_u],嵌入式工具链需单独安装;.pte 与所选后端绑定,换硬件要重新导出而非只换 partitioner。

executorch
pytorch活跃维护PyTorch 官方的端侧推理框架,把训练好的模型导出并部署到手机、嵌入式和边缘设备上运行,覆盖 CPU、GPU 等多种后端。
On-device AI across mobile, embedded and edge for PyTorch
pip install executorchREADME 未给出具体显存或内存门槛;Linux 上 pip 安装的是 CUDA 构建,macOS 和 Windows 上是 CPU 构建,CUDA 版 wheel 仅发布 Linux 版本;嵌入式侧覆盖 Cortex-M、Ethos-U、NXP NPU、Cadence DSP 等目标。
PyTorch 官方的端侧推理栈,把 PyTorch 模型导出成 .pte 后跑在手机、嵌入式设备和微控制器上
PyTorch 官方的端侧推理框架,把训练好的模型导出并部署到手机、嵌入式和边缘设备上运行,覆盖 CPU、GPU 等多种后端。
核心能力
- 用 torch.export 捕获模型并导出为 .pte 文件
- 按硬件划分计算图,把子图交给 CPU、GPU、NPU 或 DSP 后端
- 支持 selective build,只链接部署所需的算子内核
- 提供 ETDump、ETRecord 和数值调试工具做性能与精度排查
- 支持 C++、Python、Swift、Kotlin、JavaScript 多语言运行时 API
容易踩的坑
- v1.5.1最新正式版2026-09-23 · 2026-09-23 16:58 UTC
v1.5.1 Changes
- Updated CMSIS-NN to v8.0.0 and aligned Arm runner dependencies.
- Added the public
get_thread_count()API. - Expanded Arm support for symbolic shapes and dynamic convolution and pooling.
- Folded redundant Q/DQ pairs in the shared EXIR
to_edgelowering path.
Highlights
- Expanded the Python wheels into a C++ SDK, with linkable libraries for the CUDA, Core ML, MLX, OpenVINO, and Qualcomm delegates and packaged TorchAO kernels.
- Expanded LLM serving with multi-method export, batched request scheduling, bounded cancellation, off-graph KV-cache layouts, and new Qwen3.5 MoE, Muse Glimmer, Supertonic, and Voxtral workflows.
- Added ROCm support to the AOTI CUDA backend, including packed W4 execution and end-to-end Voxtral Realtime coverage.
- Expanded Arm and Cortex-M support with explicit-layout lowering and kernels, additional Ethos-U targets and demos, broader VGF profiling, and more model and operator coverage.
- Expanded Qualcomm LLM quantization-aware distillation, additional operators, Windows guidance, and stronger validation and error handling.
- Improved Vulkan quantized execution, dispatch safety, external-memory integration, and operator coverage.
Runtime and Core
- Added multi-method model support to the export pipeline and per-backend load options.
- Added capacity-aware memory planning over target memory maps and support for shared allocations with offsets.
- Added schema-version checks for PTE and PTD files and clearer failures for invalid device-planned copies and missing delegate data.
- Added shared pre-decomposition and graph-transform hooks, including common view/permute propagation and reinplace passes.
- Improved constant propagation, symbolic-shape handling, and device placement for memory-planned buffers.
Packaging and Build
- Added a C++ SDK to the Python wheel and split the runtime from the Python bindings extension.
- Added CUDA wheel publishing on Pytorch.org
- Improved delegate/runtime bundling in the published wheels.
- Added packaged TorchAO and quantized-kernel libraries.
- Added Windows ARM64 build coverage.
- Reduced wheel size and improved portability by stripping local macOS symbols, removing unreachable vendored sources, and dropping unusable Linux MKL search paths.
- Lowered the supported CMake floor so CMake 3.26 through 3.28 builds work again.
Backends
Arm
- Added opt-in Cortex-M explicit-layout lowering with convolution and pooling kernels.
- Added Arm export-recipe support, a pre-decomposition partitioner pipeline, and broader symbolic-shape and dim-order handling.
- Added Ethos-U65 support, Ethos-U85 KV-cache export, and SmolLM2, TinyStories-42M, Silero VAD, MobileSAM, and Stable Diffusion workflows.
- Expanded VGF profiling and environment preflight validation tools, neural statistics, automatic operator-support generation, support for int8 KV cache, FP16, BF16, MXFP8, and quantized model coverage.
- Improved Cortex-M memory planning, CMSIS-Pack coverage, in-place activation fusion, and arithmetic, pooling, and activation lowering.
Qualcomm
- Added LLM quantization-aware distillation and Gemma 4 text-model enablement.
- Added support for
pdist,sort,reflection_pad3d,as_strided,scatter_reduce,scatter_add, and Hadamard-transform flows. - Added QNN-on-Windows guidance and improved SDK setup, import behavior, delegate bounds checks, graph-I/O validation, and quantized metadata preservation.
CUDA and ROCm
- Added opt-in ROCm support to the AOTI backend, packed W4 execution, AMD pointwise examples, and Voxtral Realtime coverage on gfx1100 and gfx950.
- Added shared-memory targeting for cross-architecture CUDA inference and INT4, INT5, and INT6 short-query kernels.
- Improved CUDA delegate integr
- v1.5.02026-09-16 · 2026-09-16 16:08 UTC
查看更新说明
Highlights
- Expanded the Python wheels into a C++ SDK, with linkable libraries for the CUDA, Core ML, MLX, OpenVINO, and Qualcomm delegates and packaged TorchAO kernels.
- Expanded LLM serving with multi-method export, batched request scheduling, bounded cancellation, off-graph KV-cache layouts, and new Qwen3.5 MoE, Muse Glimmer, Supertonic, and Voxtral workflows.
- Added ROCm support to the AOTI CUDA backend, including packed W4 execution and end-to-end Voxtral Realtime coverage.
- Expanded Arm and Cortex-M support with explicit-layout lowering and kernels, additional Ethos-U targets and demos, broader VGF profiling, and more model and operator coverage.
- Expanded Qualcomm LLM quantization-aware distillation, additional operators, Windows guidance, and stronger validation and error handling.
- Improved Vulkan quantized execution, dispatch safety, external-memory integration, and operator coverage.
Runtime and Core
- Added multi-method model support to the export pipeline and per-backend load options.
- Added capacity-aware memory planning over target memory maps and support for shared allocations with offsets.
- Added schema-version checks for PTE and PTD files and clearer failures for invalid device-planned copies and missing delegate data.
- Added shared pre-decomposition and graph-transform hooks, including common view/permute propagation and reinplace passes.
- Improved constant propagation, symbolic-shape handling, and device placement for memory-planned buffers.
Packaging and Build
- Added a C++ SDK to the Python wheel and split the runtime from the Python bindings extension.
- Added CUDA wheel publishing on Pytorch.org
- Improved delegate/runtime bundling in the published wheels.
- Added packaged TorchAO and quantized-kernel libraries.
- Added Windows ARM64 build coverage.
- Reduced wheel size and improved portability by stripping local macOS symbols, removing unreachable vendored sources, and dropping unusable Linux MKL search paths.
- Lowered the supported CMake floor so CMake 3.26 through 3.28 builds work again.
Backends
Arm
- Added opt-in Cortex-M explicit-layout lowering with convolution and pooling kernels.
- Added Arm export-recipe support, a pre-decomposition partitioner pipeline, and broader symbolic-shape and dim-order handling.
- Added Ethos-U65 support, Ethos-U85 KV-cache export, and SmolLM2, TinyStories-42M, Silero VAD, MobileSAM, and Stable Diffusion workflows.
- Expanded VGF profiling and environment preflight validation tools, neural statistics, automatic operator-support generation, support for int8 KV cache, FP16, BF16, MXFP8, and quantized model coverage.
- Improved Cortex-M memory planning, CMSIS-Pack coverage, in-place activation fusion, and arithmetic, pooling, and activation lowering.
Qualcomm
- Added LLM quantization-aware distillation and Gemma 4 text-model enablement.
- Added support for
pdist,sort,reflection_pad3d,as_strided,scatter_reduce,scatter_add, and Hadamard-transform flows. - Added QNN-on-Windows guidance and improved SDK setup, import behavior, delegate bounds checks, graph-I/O validation, and quantized metadata preservation.
CUDA and ROCm
- Added opt-in ROCm support to the AOTI backend, packed W4 execution, AMD pointwise examples, and Voxtral Realtime coverage on gfx1100 and gfx950.
- Added shared-memory targeting for cross-architecture CUDA inference and INT4, INT5, and INT6 short-query kernels.
- Improved CUDA delegate integration with per-thread streams, a warm memory pool, cross-method weight sharing, and clearer missing-weight errors.
Core ML and MLX
- Added linkable Core ML and MLX libraries to Apple frameworks and SwiftPM, plus ETDump profiling support.
- Added MLX off-graph KV-cache flat, ring
- v1.4.12026-08-14 · 2026-08-14 21:07 UTC
查看更新说明
1.4.1 Changes
Fixed an issue with incorrect baked in paths within the wheels. Fixed an issue with XNNPack's PreLU in quantized graphs.
1.4 Highlights
- Expanded Cortex-M support across additional CPU variants, model tests, scratch-buffer planning, CMSIS-NN integration, and CMSIS Pack builds.
- Added broad Arm backend coverage for TOSA dialect lowering, dynamic shapes, FP8/MXFP/BFloat16 paths, VGF profiling, and LLM export workflows.
- Added Vulkan support for Linux and Windows desktop GPUs, opt-in wheel builds, automatic build enablement, and a functional backend availability check.
- Expanded Qualcomm QNN support with 2-bit 16a2w quantization, faster VLM/LLM PTQ flows, multi-batch quantization and evaluation, LPAI tooling, profiling, and additional operators.
- NXP Backend finished MLIR based Neutron Converter flow rollout - all operators using the MLIR flow, Neutron backend now support 48 ATen operators.
- Continued Android API migration to Kotlin and added Android model E2E coverage and Kotlin examples.
Runtime and Core
- Removed the legacy _use_edge_ops toggles from the runtime/export path.
- Added explicit dim-order legalization for channels-last portable fallbacks.
- Hardened tensor-layout validation and segment loading against null metadata.
- Improved symbolic input metadata preservation during exported-program pass replay.
- Added direct bundled-program serialization improvements for embedded flows.
Backends
Arm and Cortex-M
- Added builds for more Cortex-M variants on Corstone-300, including M0+.
- Added AoT scratch-buffer planning and broader MLPerf Tiny model coverage.
- Expanded TOSA dialect lowering for activation, binary, conversion, data layout, FFT, reduction, shape, and unary operators.
- Added or improved VGF support for profiling, shader segments, BFloat16, MXFP, grid sampling, and persistent IO mappings.
- Ethos-U and VGF dependencies can now be installed with ExecuTorch using optional packages “pip install executorch[ethos_u,vgf]”
- Added SmolLM2 and Qwen3-VL export and evaluation coverage.
- Added CMSIS Pack infrastructure and an ExecuTorch 1.4 public API manifest.
Qualcomm
- Added additional QNN operators, including addmm, select_scatter, variance, diagonal, fill, cdist, LayerNorm variants, and hyperbolic functions.
- Added 2-bit weight quantization support and multi-batch LLM quantization.
- Decoupled calibration, quantization, compilation, and evaluation stages for faster LLM and VLM workflows.
- Added LPAI partitioning, tensor dumping, and runtime heap profiling.
NXP
- Updated the Neutron software stack to 3.1.3.
- Added backend profiling and MLPerf Tiny profiling tests.
- Expanded Neutron operator coverage and removed several broadcasting restrictions.
- Fixed partition-output handling, format inference, BatchNorm fusion, and multiprocessing conversion issues.
CoreML and MLX
- Added a Core ML compute-plan reporting tool for ANE, GPU, and CPU dispatch.
- Added MLX handlers for hardtanh, bitwise_or, and leaky_relu.
- Improved MLX submodule build isolation.
Vulkan
- Added Vulkan desktop support for Linux and Windows and opt-in wheel builds.
XNNPack
- Added quantized same-padding convolution support in XNNPACK, including fixes for even Conv1d kernels and ViT concatenation quantization parameters.
- Expanded RISC-V XNNPACK coverage across multiple RVV QEMU configurations.
Operators and Kernels
- Added BFloat16 and FP16 activation support to CPU SDPA.
- Added BFloat16-output quantized embeddings on CPU.
- Improved numerical accuracy by accumulating Half and BFloat16 softmax, log-softmax, mean, and sum operations in FP32.
- Fixed portable anti-aliased bilinear upsampling correctness.
LLM, Mobile, and Examples
- Added grammar and grammar_type
- v1.4.0v1.42026-08-07 · 2026-08-07 19:06 UTC
查看更新说明
Highlights
- Expanded Cortex-M support across additional CPU variants, model tests, scratch-buffer planning, CMSIS-NN integration, and CMSIS Pack builds.
- Added broad Arm backend coverage for TOSA dialect lowering, dynamic shapes, FP8/MXFP/BFloat16 paths, VGF profiling, and LLM export workflows.
- Added Vulkan support for Linux and Windows desktop GPUs, opt-in wheel builds, automatic build enablement, and a functional backend availability check.
- Expanded Qualcomm QNN support with 2-bit 16a2w quantization, faster VLM/LLM PTQ flows, multi-batch quantization and evaluation, LPAI tooling, profiling, and additional operators.
- NXP Backend finished MLIR based Neutron Converter flow rollout - all operators using the MLIR flow, Neutron backend now support 48 ATen operators.
- Continued Android API migration to Kotlin and added Android model E2E coverage and Kotlin examples.
Runtime and Core
- Removed the legacy _use_edge_ops toggles from the runtime/export path.
- Added explicit dim-order legalization for channels-last portable fallbacks.
- Hardened tensor-layout validation and segment loading against null metadata.
- Improved symbolic input metadata preservation during exported-program pass replay.
- Added direct bundled-program serialization improvements for embedded flows.
Backends
Arm and Cortex-M
- Added builds for more Cortex-M variants on Corstone-300, including M0+.
- Added AoT scratch-buffer planning and broader MLPerf Tiny model coverage.
- Expanded TOSA dialect lowering for activation, binary, conversion, data layout, FFT, reduction, shape, and unary operators.
- Added or improved VGF support for profiling, shader segments, BFloat16, MXFP, grid sampling, and persistent IO mappings.
- Ethos-U and VGF dependencies can now be installed with ExecuTorch using optional packages “pip install executorch[ethos_u,vgf]”
- Added SmolLM2 and Qwen3-VL export and evaluation coverage.
- Added CMSIS Pack infrastructure and an ExecuTorch 1.4 public API manifest.
Qualcomm
- Added additional QNN operators, including addmm, select_scatter, variance, diagonal, fill, cdist, LayerNorm variants, and hyperbolic functions.
- Added 2-bit weight quantization support and multi-batch LLM quantization.
- Decoupled calibration, quantization, compilation, and evaluation stages for faster LLM and VLM workflows.
- Added LPAI partitioning, tensor dumping, and runtime heap profiling.
NXP
- Updated the Neutron software stack to 3.1.3.
- Added backend profiling and MLPerf Tiny profiling tests.
- Expanded Neutron operator coverage and removed several broadcasting restrictions.
- Fixed partition-output handling, format inference, BatchNorm fusion, and multiprocessing conversion issues.
CoreML and MLX
- Added a Core ML compute-plan reporting tool for ANE, GPU, and CPU dispatch.
- Added MLX handlers for hardtanh, bitwise_or, and leaky_relu.
- Improved MLX submodule build isolation.
Vulkan
- Added Vulkan desktop support for Linux and Windows and opt-in wheel builds.
XNNPack
- Added quantized same-padding convolution support in XNNPACK, including fixes for even Conv1d kernels and ViT concatenation quantization parameters.
- Expanded RISC-V XNNPACK coverage across multiple RVV QEMU configurations.
Operators and Kernels
- Added BFloat16 and FP16 activation support to CPU SDPA.
- Added BFloat16-output quantized embeddings on CPU.
- Improved numerical accuracy by accumulating Half and BFloat16 softmax, log-softmax, mean, and sum operations in FP32.
- Fixed portable anti-aliased bilinear upsampling correctness.
LLM, Mobile, and Examples
- Added grammar and grammar_type fields to GenerationConfig.
- Added an unoptimized ExecuTorch runner example for Espressif ESP32.
- Migrated Android Module, TrainingModule, SGD,
- v1.3.12026-05-29 · 2026-05-29 17:34 UTC
查看更新说明
ExecuTorch v1.3.1 Release Notes
1.3.1 is the first broadly published 1.3 patch release, following the Maven-only 1.3.0 release.
Highlights
ExecuTorch v1.3.1 expands model and backend coverage across embedded, mobile, and GPU targets. This release adds major Arm, Cortex-M, VGF, NXP, Qualcomm, CUDA, Metal, MLX, Vulkan, and XNNPACK improvements, and continues broadening LLM and multimodal model support.
- Arm backend (Ethos-U / TOSA / VGF / Cortex-M) - Major expansion in TOSA dialect lowering, quantization support, VGF infrastructure, Cortex-M test coverage, Ethos-U compatibility, and CI reliability.
- New and expanded model support - Qwen3.5 MoE, Gemma 4 31B, LFM2.5, Voxtral Realtime/TTS, Llama4 export support, and additional Android LLM runner documentation.
- CUDA backend - Qwen3.5 MoE export/runtime work, fused MoE and INT4 Triton kernels, CUDA graph capture/replay, GPU-side sampling, and memory/stat reporting.
- Metal and MLX backends - Qwen3.5 MoE Metal path, Gemma 4 31B MLX support, MLX delegate progress, integer op support, top-k fallback, gated delta rule kernels, and hardened runtime code signing.
- Vulkan backend - Cooperative matrix dispatch for linear/matmul, safer memory handling, integer overflow and heap-buffer fixes, improved partitioning, and VGF compatibility work.
- Qualcomm AI Engine Direct (QNN) - Expanded ATen op support, LPAI and Direct Mode work, custom op and quantization annotation APIs, debugging improvements, performance dumping, and heap profiling.
- NXP backend - Continued new Neutron flow rollout, eIQ Neutron SDK 3.1.1, stricter graph verification, QAT coverage, and additional operator support.
- Runtime and packaging - Shared library install support, Android lifecycle/error handling fixes, and improved wheel/build reliability.
New Models and Model Enablement
- Qwen3.5 MoE export and runner support across CUDA and Metal, including fused MoE kernels, INT4 paths, CUDA graph support, and runtime stats.
- Gemma 4 31B export and runner support with CUDA and MLX backend support.
- LFM2.5 export and runner support for MLX.
- Voxtral Realtime and Voxtral TTS improvements, including streaming fixes, CUDA backend support, and documentation updates.
- Android LLM runner documentation and HuggingFace-oriented usage docs.
Core Components
EXIR / Export
- Safer ETRecord/export deserialization.
- FP8 placeholder support in ExecuTorch serialization.
- Fixes for
torch.splitalias annotations and partition grouping. - Migration cleanup away from deprecated capture config paths.
Runtime
- Backend and runtime option handling improvements.
- Better contextual error reporting for debuggability.
Kernels and Operators
- Portable adaptive average pool 2D kernel.
- fp32 accumulation for Half/BFloat16 grid sampler bilinear paths.
- Fused quantized add, mul, relu, hardswish, and bmm kernels.
- Quantized max pool and quantized conv1d fixes.
- Additional quantization and observer fixes across portable and backend kernels.
Backend Delegates
Arm / Ethos-U / TOSA / VGF / Cortex-M
- Expanded TOSA op coverage including slice, max pool, avg pool, adaptive avg pool, shape ops, resize, LSTM decomposition, and additional dtype/layout handling.
- FP16/BF16 operator coverage is now considered largely complete; most support landed incrementally over prior releases and the 1.3 cycle adds test stabilization for FP16 MobileNetV3 and VGF bilinear paths.
- Refactored dim-order and permute handling. Removed the legacy
tosa_dim_orderpath, added permute-removal for TOSA ops, and improved permute fusion over elementwise ops. This reduced unnecessary transposes in lowered graphs. - Improved quantization support, including composable quantizer work, constant folding fixes, TOSA/VGF linear quantization modes, and Cortex-M MVE/Helium int16 quantize/dequantize support.
- VGF build/test infrastructure and documentation.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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.
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 |
| 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.
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
.ptefor 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
.ptecreated 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:
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:
- Prebuilt C++ libraries, headers, and CMake package in current main/nightly Linux and macOS wheels
- Android AAR from Maven Central
- Apple frameworks through Swift Package Manager
- Source builds and cross-compilation
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.
| 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 | XNNPACK; OpenVINO; experimental CUDA/AOTInductor, Vulkan, and WebGPU desktop paths |
| 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 |
Documentation
- Get started
- Choose a platform
- Choose a backend
- Export and lower a model
- Work with LLMs
- Profile and debug
- Runtime and LLM APIs
- PTE/runtime compatibility policy
- LLM benchmark dashboard
- Troubleshooting
Community and contributing
- GitHub Discussions: ask questions and share ideas
- Discord: chat with maintainers and the community
- Issues: report bugs or request features
- Contributing guide: development setup, testing, and review guidelines
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.