MLX is an array framework for machine learning on Apple silicon by Apple ML Research. Features NumPy-like APIs, composable function transformations, lazy computation, dynamic graph construction, and a unified memory model for seamless CPU/GPU computation. Includes higher-level packages like mlx.nn and mlx.optimizers mirroring PyTorch conventions. Enables efficient ML development on M-series chips without manual data transfer between devices.
git clone https://github.com/ml-explore/mlx.git
import mlx.core as mx
import mlx.nn as nn
# NumPy-like array operations on Apple Silicon
a = mx.array([1, 2, 3, 4])
b = mx.array([5, 6, 7, 8])
result = mx.matmul(a.reshape(2,2), b.reshape(2,2))
# Automatic GPU acceleration on M-series chips
print(result)