Editorial illustration for Experimental MLX Delegate Enables PyTorch Models on Apple Silicon GPUs
Experimental MLX Delegate Enables PyTorch Models on...
For Mac developers, PyTorch has always demanded a choice: sacrifice GPU performance or abandon your established tools. That compromise just narrowed. A new, experimental backend for ExecuTorch, called the MLX delegate, now compiles PyTorch models to run directly on Apple Silicon's Metal GPU kernels.
The MLX delegate achieves 3-6x higher throughput on generative AI workloads compared to existing ExecuTorch delegates on macOS. Moving inference to MLX’s optimized Metal kernels makes a meaningful difference for ExecuTorch applications like chat and real-time transcription.
The impact is immediate: a 3x to 6x throughput boost on generative AI workloads. That figure isn't hypothetical. It's the raw result of partitioning the computational graph and dispatching to MLX's optimized kernels, all while supporting the roughly 90 core ATen ops needed for modern transformers.
This is an active experiment, not a final product. But its performance is the entire argument.
It builds a bridge. This delegate directly connects the massive PyTorch ecosystem to the specific silicon in Apple hardware. Developers keep their pipeline.
They just get far more compute from the machine already on their desk. No rewrites. That 3-6x speedup on a standard workflow is a prototype for a much smoother future, where the old friction finally melts away.
Common Questions Answered
What is the MLX delegate and how does it improve PyTorch performance on Apple Silicon?
The MLX delegate is an experimental backend for ExecuTorch that compiles PyTorch models to run directly on Apple Silicon's Metal GPU kernels. This eliminates the previous compromise between GPU performance and using established PyTorch tools, delivering a 3x to 6x throughput boost on generative AI workloads.
How many core ATen operations does the MLX delegate support for transformer models?
The MLX delegate supports approximately 90 core ATen operations, which is sufficient to handle the computational requirements of modern transformer models. This comprehensive operation support enables seamless execution of complex PyTorch architectures on Apple Silicon GPUs.
What is the computational approach used by the MLX delegate to achieve its performance gains?
The MLX delegate partitions the computational graph and dispatches it to MLX's optimized kernels, which are specifically designed for Apple Silicon's Metal GPU architecture. This targeted optimization approach is what drives the significant 3x to 6x throughput improvements for generative AI workloads.
Is the MLX delegate a production-ready solution or still in development?
The MLX delegate is currently an active experiment and not a final product. However, its impressive performance metrics demonstrate its potential value, and it serves as a bridge connecting the massive PyTorch ecosystem to Apple Silicon's GPU capabilities.
Further Reading
- Running PyTorch Models on Apple Silicon GPUs with the ExecuTorch MLX Delegate — PyTorch Blog
- Explore large language models on Apple silicon with MLX — Apple Developer
- Exploring LLMs with MLX and the Neural Accelerators in the M5 GPU — Apple Machine Learning Research
- Why not implement this in Pytorch? · Issue #12 · ml-explore/mlx — GitHub
- How to run PyTorch, TensorFlow, and JAX on your Mac (Apple Silicon) — YouTube