mlx
mlx copied to clipboard
[Docs] Simple examples of using mlx.distributed
It would be nice to have 2-3 really simple standalone examples of using MLX distributed:
- Data parallel training with a simple model
- Tensor parallel inference with a simple model
Maybe some others.
i’m going to start with a runnable data parallel training script under examples/python. the docs added in #2973 explain the pieces, but the examples directory still has no script users can launch. i’ll base it on linear_regression.py, shard the synthetic data by rank, average gradients with nn.average_gradients, and test it locally with mlx.launch -n 2. i’ll keep tensor parallel inference out of this pr.