1# ExecuTorch 2 3**ExecuTorch** is an end-to-end solution for enabling on-device inference 4capabilities across mobile and edge devices including wearables, embedded 5devices and microcontrollers. It is part of the PyTorch Edge ecosystem and 6enables efficient deployment of PyTorch models to edge devices. 7 8Key value propositions of ExecuTorch are: 9 10- **Portability:** Compatibility with a wide variety of computing platforms, 11 from high-end mobile phones to highly constrained embedded systems and 12 microcontrollers. 13- **Productivity:** Enabling developers to use the same toolchains and Developer 14 Tools from PyTorch model authoring and conversion, to debugging and deployment 15 to a wide variety of platforms. 16- **Performance:** Providing end users with a seamless and high-performance 17 experience due to a lightweight runtime and utilizing full hardware 18 capabilities such as CPUs, NPUs, and DSPs. 19 20For a comprehensive technical overview of ExecuTorch and step-by-step tutorials, 21please visit our documentation website [for the latest release](https://pytorch.org/executorch/stable/index.html) (or the [main branch](https://pytorch.org/executorch/main/index.html)). 22 23Check out the [Getting Started](https://pytorch.org/executorch/stable/getting-started-setup.html#quick-setup-colab-jupyter-notebook-prototype) page for a quick spin. 24 25Check out the examples of [Llama](./examples/models/llama/README.md), [Llava](./examples/models/llava/README.md) and [other models](./examples/README.md) running on edge devices using ExecuTorch. 26 27 28**[UPDATE - 10/24]** We have added support for running [Llama 3.2 Quantized 1B/3B](./examples/models/llama/README.md) models via ExecuTorch. 29 30## Feedback 31 32We welcome any feedback, suggestions, and bug reports from the community to help 33us improve our technology. Please use the [PyTorch 34Forums](https://discuss.pytorch.org/c/executorch) for discussion and feedback 35about ExecuTorch using the **ExecuTorch** category, and our [GitHub 36repository](https://github.com/pytorch/executorch/issues) for bug reporting. 37 38We recommend using the latest release tag from the 39[Releases](https://github.com/pytorch/executorch/releases) page when developing. 40 41## Contributing 42 43See [CONTRIBUTING.md](CONTRIBUTING.md) for details about issues, PRs, code 44style, CI jobs, and other development topics. 45 46To connect with us and other community members, we invite you to join PyTorch Slack community by filling out this [form](https://docs.google.com/forms/d/e/1FAIpQLSeADnUNW36fjKjYzyHDOzEB_abKQE9b6gqqW9NXse6O0MWh0A/viewform). Once you've joined, you can: 47* Head to the `#executorch-general` channel for general questions, discussion, and community support. 48* Join the `#executorch-contributors` channel if you're interested in contributing directly to project development. 49 50 51## Directory Structure 52 53``` 54executorch 55├── backends # Backend delegate implementations. 56├── build # Utilities for managing the build system. 57├── codegen # Tooling to autogenerate bindings between kernels and the runtime. 58├── configurations 59├── docs # Static docs tooling. 60├── examples # Examples of various user flows, such as model export, delegates, and runtime execution. 61├── exir # Ahead-of-time library: model capture and lowering APIs. 62| ├── _serialize # Serialize final export artifact. 63| ├── backend # Backend delegate ahead of time APIs 64| ├── capture # Program capture. 65| ├── dialects # Op sets for various dialects in the export process. 66| ├── emit # Conversion from ExportedProgram to ExecuTorch execution instructions. 67| ├── operator # Operator node manipulation utilities. 68| ├── passes # Built-in compiler passes. 69| ├── program # Export artifacts. 70| ├── serde # Graph module 71serialization/deserialization. 72| ├── verification # IR verification. 73├── extension # Extensions built on top of the runtime. 74| ├── android # ExecuTorch wrappers for Android apps. 75| ├── apple # ExecuTorch wrappers for iOS apps. 76| ├── aten_util # Converts to and from PyTorch ATen types. 77| ├── data_loader # 1st party data loader implementations. 78| ├── evalue_util # Helpers for working with EValue objects. 79| ├── gguf_util # Tools to convert from the GGUF format. 80| ├── kernel_util # Helpers for registering kernels. 81| ├── memory_allocator # 1st party memory allocator implementations. 82| ├── module # A simplified C++ wrapper for the runtime. 83| ├── parallel # C++ threadpool integration. 84| ├── pybindings # Python API for executorch runtime. 85| ├── pytree # C++ and Python flattening and unflattening lib for pytrees. 86| ├── runner_util # Helpers for writing C++ PTE-execution 87tools. 88| ├── testing_util # Helpers for writing C++ tests. 89| ├── training # Experimental libraries for on-device training 90├── kernels # 1st party kernel implementations. 91| ├── aten 92| ├── optimized 93| ├── portable # Reference implementations of ATen operators. 94| ├── prim_ops # Special ops used in executorch runtime for control flow and symbolic primitives. 95| ├── quantized 96├── profiler # Utilities for profiling runtime execution. 97├── runtime # Core C++ runtime. 98| ├── backend # Backend delegate runtime APIs. 99| ├── core # Core structures used across all levels of the runtime. 100| ├── executor # Model loading, initialization, and execution. 101| ├── kernel # Kernel registration and management. 102| ├── platform # Layer between architecture specific code and portable C++. 103├── schema # ExecuTorch PTE file format flatbuffer 104schemas. 105├── scripts # Utility scripts for size management, dependency management, etc. 106├── devtools # Model profiling, debugging, and introspection. 107├── shim # Compatibility layer between OSS and Internal builds 108├── test # Broad scoped end-to-end tests. 109├── third-party # Third-party dependencies. 110├── util # Various helpers and scripts. 111``` 112 113## License 114ExecuTorch is BSD licensed, as found in the LICENSE file. 115