From dcb8319f3d6eed77387dc7dda8af64dc32f469c5 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Fri, 25 Jul 2025 12:13:19 -0700 Subject: [PATCH] update install docs and requirements (#2419) --- README.md | 21 +++++++++++++-------- docs/src/install.rst | 22 +++++++++++++++++++--- python/scripts/repair_linux.sh | 1 + 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3666509f2..87dcfd18e 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ brought to you by Apple machine learning research. Some key features of MLX include: - - **Familiar APIs**: MLX has a Python API that closely follows NumPy. MLX + - **Familiar APIs**: MLX has a Python API that closely follows NumPy. MLX also has fully featured C++, [C](https://github.com/ml-explore/mlx-c), and [Swift](https://github.com/ml-explore/mlx-swift/) APIs, which closely mirror - the Python API. MLX has higher-level packages like `mlx.nn` and + the Python API. MLX has higher-level packages like `mlx.nn` and `mlx.optimizers` with APIs that closely follow PyTorch to simplify building more complex models. @@ -68,18 +68,23 @@ in the documentation. ## Installation -MLX is available on [PyPI](https://pypi.org/project/mlx/). To install the Python API, run: +MLX is available on [PyPI](https://pypi.org/project/mlx/). To install MLX on +macOS, run: -**With `pip`**: - -``` +```bash pip install mlx ``` -**With `conda`**: +To install the CUDA backend on Linux, run: +```bash +pip install "mlx[cuda]" ``` -conda install -c conda-forge mlx + +To install a CPU-only Linux package, run: + +```bash +pip install "mlx[cpu]" ``` Checkout the diff --git a/docs/src/install.rst b/docs/src/install.rst index 70491ac64..268141567 100644 --- a/docs/src/install.rst +++ b/docs/src/install.rst @@ -13,7 +13,7 @@ silicon computer is pip install mlx -To install from PyPI you must meet the following requirements: +To install from PyPI your system must meet the following requirements: - Using an M series chip (Apple silicon) - Using a native Python >= 3.9 @@ -26,13 +26,22 @@ To install from PyPI you must meet the following requirements: CUDA ^^^^ -MLX has a CUDA backend which you can use on any Linux platform with CUDA 12 -and SM 7.0 (Volta) and up. To install MLX with CUDA support, run: +MLX has a CUDA backend which you can install with: .. code-block:: shell pip install "mlx[cuda]" +To install the CUDA package from PyPi your system must meet the following +requirements: + +- Nvidia architecture >= SM 7.0 (Volta) +- Nvidia driver >= 550.54.14 +- CUDA toolkit >= 12.0 +- Linux distribution with glibc >= 2.35 +- Python >= 3.9 + + CPU-only (Linux) ^^^^^^^^^^^^^^^^ @@ -42,6 +51,13 @@ For a CPU-only version of MLX that runs on Linux use: pip install "mlx[cpu]" +To install the CPU-only package from PyPi your system must meet the following +requirements: + +- Linux distribution with glibc >= 2.35 +- Python >= 3.9 + + Troubleshooting ^^^^^^^^^^^^^^^ diff --git a/python/scripts/repair_linux.sh b/python/scripts/repair_linux.sh index 82cf49060..880c43f4b 100644 --- a/python/scripts/repair_linux.sh +++ b/python/scripts/repair_linux.sh @@ -2,6 +2,7 @@ auditwheel repair dist/* \ --plat manylinux_2_35_x86_64 \ + --only-plat \ --exclude libmlx* \ -w wheel_tmp