About this project

MLX is an array framework for machine learning on Apple silicon, developed by Apple's machine learning research team. It provides a Python API closely following NumPy, with fully featured C++, C, and Swift APIs that mirror the Python interface. Higher-level packages like `mlx.nn` and `mlx.optimizers` follow PyTorch conventions for building complex models. Key features include: - **Familiar APIs**: NumPy-like Python API, plus C++, C, and Swift versions. - **Composable function transformations**: Supports automatic differentiation, vectorization, and computation graph optimization. - **Lazy computation**: Arrays are materialized only when needed. - **Dynamic graph construction**: Computation graphs are built dynamically, avoiding slow recompilations when shapes change. - **Multi-device**: Operations run on CPU and GPU. - **Unified memory**: Arrays live in shared memory, enabling operations across devices without data transfer. MLX is designed for machine learning researchers, aiming for user-friendliness and efficiency in training and deployment. It draws inspiration from NumPy, PyTorch, Jax, and ArrayFire. Installation is via pip on macOS (`pip install mlx`), with Linux options for CUDA (`mlx[cuda]`) or CPU-only (`mlx[cpu]`). The MLX examples repository includes transformer language model training, LLaMA text generation with LoRA finetuning, Stable Diffusion image generation, and Whisper speech recognition. Documentation, quickstart guides, and contribution guidelines are available in the repository. The project is open-source and acknowledges contributors.