TopGit
GitHub Repo Review

ExecuTorch: PyTorch's On-Device AI Runtime

pytorch/executorch
ETopGit review image for pytorch/executorch
Review by Topgit.dev for pytorch/executorch, with GitHub repository stats and README context.
Quick verdict

ExecuTorch is PyTorch's runtime for deploying trained models directly onto phones, wearables, and microcontrollers. It exports straight from torch.export() into a compact C++ runtime, skipping ONNX or TFLite conversion. Reach for it if you already train in PyTorch and want one export path across many hardware backends; skip it if your models live in TensorFlow or you need a longer track record outside Meta's own apps.

Stars
โ˜… 5.0k
Forks
โ‘‚ 1.2k
Contributors
๐Ÿ‘ฅ 583
Language
Python
License
See repository
Topic
AI Tools
Updated
Sep 2026

What is ExecuTorch?

ExecuTorch is PyTorch's runtime and toolchain for running trained models on-device, across phones, embedded boards, and microcontrollers, without porting them to another framework first. It captures a model graph with torch.export(), compiles it ahead of time into a .pte file, and runs that file through a lightweight C++ runtime with backends for chips from Apple, Qualcomm, Samsung, MediaTek, and ARM.

Core Capabilities for Deployment

  • โœ“Native export from torch.export() straight to a .pte file, with no intermediate ONNX or TFLite conversion step, so the model graph's structure survives the trip, per the README.
  • โœ“A 50KB base runtime footprint, small enough for microcontrollers as well as flagship phones.
  • โœ“12+ hardware backends listed in the README, including XNNPACK, Apple CoreML, Qualcomm QNN, Samsung Exynos, MediaTek, Vulkan, and ARM Ethos-U for microcontrollers.
  • โœ“Switch hardware targets by swapping one partitioner line, such as XnnpackPartitioner, CoreMLPartitioner, or QnnPartitioner, instead of re-exporting per chip.
  • โœ“Quantization support through torchao covering 8-bit and 4-bit precision, plus a dynamic mode, per the README.
  • โœ“Developer tooling: an ETDump profiler and an ETRecord inspector for looking inside a running .pte model.
  • โœ“Selective build strips unused operators to cut binary size, and custom operators let you add domain-specific kernels.
  • โœ“Dynamic shapes are supported for models with variable input sizes within bounded ranges.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history โ†—

Real-World Applications and Supported Models

  • โ€ขShipping an LLM chat feature inside a mobile app: the README lists Llama 3.2, 3.1, and 3, Qwen 3, Phi-4-mini, and LiquidAI LFM2 as examples with working export scripts.
  • โ€ขRunning vision or speech models on-device, with MobileNetV2, DeepLabV3, YOLO26, and Whisper listed as example models in the repo.
  • โ€ขMultimodal apps that combine text with images or audio, using the Llava and Voxtral examples plus the MultiModal runner API.
  • โ€ขDeploying one trained PyTorch model across Android, iOS, and embedded Linux from a single export, switching only the partitioner.
  • โ€ขBuilding for microcontrollers or DSPs, where ARM Ethos-U, NXP, and Cadence DSP backends cover the embedded/MCU row in the platform table.

Getting Started with ExecuTorch

Install the Python package with `pip install executorch`. That's the entire command for the core package. Platform-specific setup for Android, iOS, or embedded targets isn't spelled out step by step in the README itself; it points to a separate Quick Start doc for that. Exporting a model needs `torch`, `executorch.exir`, and a backend-specific partitioner import, such as XnnpackPartitioner for CPU or CoreMLPartitioner for iOS, both shown in the README's own export snippet.

Deploying PyTorch Models On-Device

The flow the README shows has three steps. First, capture the model graph with torch.export.export() on an eval()'d model and example inputs. Second, call to_edge_transform_and_lower() with a chosen partitioner, then .to_executorch(), which quantizes, optimizes, and partitions the graph into a .pte file you write to disk. Third, load that .pte file on-device: the C++ Module API, Swift's Module class on iOS, or Kotlin's Module.load() on Android all call forward() the same way. For an LLM specifically, the README points to the export_llm script or Optimum-ExecuTorch's optimum-cli export executorch command, then running the result through a matching LLM runner API, such as create_llama_runner in C++ or TextRunner in Swift.

Strengths

  • โœ“Exports straight from PyTorch with torch.export(), with no separate ONNX or TFLite conversion step to keep in sync with the training code.
  • โœ“A 50KB base runtime that scales down to microcontrollers, not just phones.
  • โœ“One export can target 12+ different hardware backends by swapping a single partitioner argument.
  • โœ“Already running in production at Meta's own apps and devices โ€” Instagram, WhatsApp, Quest 3, and Ray-Ban Meta Smart Glasses, per the README.
  • โœ“Ships export scripts for current, real models โ€” Llama 3.2, 3.1, and 3, Qwen 3, Phi-4-mini, Whisper, YOLO26 โ€” rather than only toy demos.

Current Scope and Considerations

  • โ–ณThe README gives no version number or release cadence, so there's no documented way to gauge how mature any given snapshot is beyond the stated backend list.
  • โ–ณThe platform table already marks MPS deprecated on both iOS and macOS, and flags CUDA (Linux/Windows) and Metal (macOS) as experimental, so several backends in the matrix aren't production-ready yet.
  • โ–ณThe README's Quick Start doesn't walk through Android, iOS, or embedded setup end to end; it defers to a separate docs site for anything past the core pip install.
  • โ–ณThe repo's license field isn't a specific SPDX identifier in the facts available here; the README just says 'BSD licensed,' so check the exact terms in the LICENSE file before shipping a product.
  • โ–ณThe whole pipeline depends on torch.export() succeeding on your model graph first, and the README doesn't document what happens when a graph doesn't export cleanly.

Comparing On-Device ML Frameworks

TensorFlow Lite (LiteRT) โ€” Google's on-device runtime, older and more widely documented than ExecuTorch's newer, PyTorch-only export path.ONNX Runtime Mobile โ€” works across PyTorch, TensorFlow, and other model formats via ONNX conversion, the exact conversion step ExecuTorch's README says it skips.Core ML โ€” Apple's own on-device format for iOS and macOS, narrower in platform reach than ExecuTorch's 12+ backend list but tightly integrated into Apple's toolchain.llama.cpp โ€” a C/C++ inference engine focused specifically on running large language models locally, versus ExecuTorch's broader scope across vision, speech, and multimodal models too. โ†—

Common Questions about ExecuTorch

Is ExecuTorch suitable for commercial projects?

ExecuTorch is released under a BSD license, per the README, which permits commercial use. Check the exact terms in the repository's LICENSE file before shipping a commercial product.

What types of AI models can be deployed with ExecuTorch?

ExecuTorch covers the model categories the README names: LLMs, vision, speech, and multimodal, all using standard PyTorch APIs. Example export scripts exist for Llama, Qwen 3, Phi-4-mini, Llava, Voxtral, MobileNetV2, and Whisper.

Which hardware platforms and backends does ExecuTorch support?

ExecuTorch's README lists 12+ hardware backends, including XNNPACK, Apple CoreML, Qualcomm QNN, Samsung Exynos, MediaTek, Vulkan, ARM Ethos-U, NXP, and Cadence DSP, covering Android, iOS, Linux, Windows, macOS, and embedded/MCU targets.

How does ExecuTorch handle model optimization for devices?

ExecuTorch uses ahead-of-time compilation: it captures the model graph with torch.export(), then quantizes, optimizes, and partitions it into a .pte file before the model ever runs on-device, per the README.

Can ExecuTorch be integrated into existing mobile applications?

ExecuTorch ships runtime APIs for C++, Swift on iOS, and Kotlin on Android, per the README, so an existing mobile app can load a .pte file and call forward() in whichever language it's already written in.

Is ExecuTorch part of the main PyTorch project?

ExecuTorch describes itself in its own README as PyTorch's unified solution for on-device deployment. It's maintained under the pytorch GitHub organization and reuses the same PyTorch APIs used for training.

The problem it solves

Getting a trained PyTorch model onto a phone or a microcontroller usually means converting it to another format like ONNX or TFLite, hand-porting inference code to C++, and picking a hardware vendor's SDK you're then stuck with. ExecuTorch's README frames its own reason for existing around exactly that friction: keep the same PyTorch APIs from training through deployment, skip the conversion step, and avoid getting locked into one chip vendor's toolchain.

Who should try it โ€” and who should skip

Try ExecuTorch if you already train models in PyTorch and need to ship them on phones, wearables, or microcontrollers without maintaining a second conversion pipeline โ€” the one-export, multiple-backend flow and the C++/Swift/Kotlin runtime APIs are built for that handoff. Skip it if your models come from TensorFlow or another framework, since you'd be adding back the conversion step ExecuTorch exists to avoid for PyTorch users. Skip it too if you need a runtime with a long production track record outside Meta's own apps, since the README doesn't document independent adopters.

Related repositories

Source & attribution

Facts and quotes sourced from the pytorch/executorch GitHub repository and its README.

GitHub data ยท last synced Aug 14, 2026Reviewed by Henry
โ† Back to TopGit

Is executorch worth your time?

ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of executorch.

GitHub