pytorch/executorch

On-device AI across mobile, embedded and edge for PyTorch

What it solves

ExecuTorch provides a unified way to deploy PyTorch AI models on-device, ranging from microcontrollers to high-end smartphones. It eliminates the need for manual C++ rewrites, intermediate format conversions (like ONNX or TFLite), and vendor lock-in, allowing developers to move from research to production quickly while maintaining model semantics.

How it works

ExecuTorch uses ahead-of-time (AOT) compilation to prepare models for the edge. The process involves three main steps:

  1. Export: The PyTorch model graph is captured using torch.export().
  2. Compile: The model is quantized, optimized, and partitioned to specific hardware backends, resulting in a .pte file.
  3. Execute: A lightweight C++ runtime (with a base footprint of 50KB) loads and runs the .pte file on the device.

It uses a standardized Core ATen operator set and partitioners to delegate subgraphs to specialized hardware (NPU/GPU) with a CPU fallback.

Who it’s for

Developers and researchers who want to deploy LLMs, vision, speech, and multimodal models on mobile devices (Android, iOS) and embedded systems (Linux, Windows, macOS, MCU) without leaving the PyTorch ecosystem.

Highlights

  • Native PyTorch Export: Direct export without intermediate formats.
  • Production-Proven: Used by Meta for Instagram, WhatsApp, and Quest 3.
  • Tiny Runtime: 50KB base footprint for extreme portability.
  • Broad Hardware Support: 12+ backends including Apple, Samsung, Qualcomm, ARM, and MediaTek.
  • Advanced Deployment Tools: Built-in quantization (via torchao), memory planning, and a selective build system to minimize binary size.