Backends#
Backend Overview#
ExecuTorch backends provide hardware acceleration for specific hardware targets, enabling models to run efficiently on devices ranging from mobile phones to embedded systems and DSPs. During the export and lowering process, ExecuTorch optimizes your model for the chosen backend, resulting in a .pte
file specialized for that hardware. To support multiple platforms (e.g., Core ML on iOS, Arm CPU on Android), you typically generate a dedicated .pte
file for each backend.
The choice of backend is informed by the hardware your model will run on. Each backend has its own hardware requirements and level of model/operator support. See the documentation for each backend for details.
As part of .pte
file creation, ExecuTorch identifies model partitions supported by the backend. These are processed ahead of time for efficient execution. Operators not supported by the delegate are executed using the portable CPU fallback (e.g., XNNPACK), allowing for partial acceleration. You can also specify multiple partitioners in order of priority, so unsupported GPU ops can fall back to CPU, for example.
Why Backends Matter#
Backends are the bridge between your exported model and the hardware it runs on. Choosing the right backend ensures your model takes full advantage of device-specific acceleration, balancing performance, compatibility, and resource usage.
Choosing a Backend#
Backend |
Platform(s) |
Hardware Type |
Typical Use Case |
---|---|---|---|
All |
CPU |
General-purpose, fallback |
|
iOS, macOS |
NPU/GPU |
Apple devices, high performance |
|
iOS, macOS |
GPU |
Apple GPU acceleration |
|
Android |
GPU |
Android GPU acceleration |
|
Android |
NPU |
Qualcomm SoCs |
|
Android |
NPU |
MediaTek SoCs |
|
Embedded |
NPU |
ARM MCUs |
|
Android |
NPU |
ARM platforms |
|
Embedded |
CPU/GPU/NPU |
Intel SoCs |
|
Embedded |
NPU |
NXP SoCs |
|
Embedded |
DSP |
DSP-optimized workloads |
|
Android |
NPU |
Samsung Socs |
Tip: For best performance, export a .pte
file for each backend you plan to support.
Best Practices#
Test on all target devices: Operator support may vary by backend.
Use fallback wisely: If a backend doesn’t support an operator, ExecuTorch will run it on CPU.
Consult backend docs: Each backend has unique setup and tuning options.