Three paths off the GPU
Server inference is one deployment target. Mobile and edge are very different. The PyTorch ecosystem has dedicated tools:
- ExecuTorch — PyTorch's mobile / edge runtime. Targets iOS, Android, and microcontrollers. The successor to the old PyTorch Mobile.
- CoreML — Apple's on-device ML framework. Maximum performance on iOS / macOS. Convert from PyTorch via the
coremltoolsbridge. - MLX — Apple's native ML framework for Apple Silicon. Built around the unified memory architecture. The right choice when you're squeezing every last bit out of a Mac or iPhone.
The flow
For ExecuTorch and CoreML, the modern path is the same: torch.export → backend-specific lowering. ExecuTorch lowers to a .pte file you ship with your app. CoreML lowers to .mlpackage.
For MLX, you have two options: convert PyTorch weights to MLX format (works for many architectures) or rewrite the model in MLX directly (best perf, but a porting effort).