Favicon of MLX

MLX

An open-source machine learning array framework with shared CPU and GPU memory on Apple silicon and Linux CPU or CUDA support.

Screenshot of MLX website

MLX is a machine learning array framework for researchers and developers building and testing models on their own hardware. It supports model training and inference, with APIs for numerical work and neural networks.

  • Shared CPU and GPU memory: On Apple silicon, both processors can operate on the same arrays without transferring data between them.
  • Familiar model development APIs: The Python interface follows NumPy, while neural network and optimizer packages use PyTorch-style conventions; C++, C and Swift APIs are also available.
  • Training and optimization: Developers can combine automatic differentiation, vectorization and computation graph optimization when building models.
  • Flexible computation: MLX delays computation until results are needed, and its dynamic graphs accommodate changes in input shape without slow recompilation.
  • Model examples: Example projects cover transformer training, LLaMA text generation and LoRA fine-tuning, plus image generation with Stable Diffusion and speech recognition with OpenAI's Whisper.

MLX is open source under the MIT license. It runs on macOS with Apple silicon CPU and GPU support. Linux packages offer CUDA or CPU-only execution.

Similar to MLX