mlx

ml-exploreMIT活跃维护

面向 Apple silicon 的数组计算框架,让机器学习模型能直接在 Mac 芯片上高效训练和推理,省去折腾 CUDA 的麻烦。

MLX: An array framework for Apple silicon

v0.32.4发布于 2026-10-14 23:37 UTC29,113star +26 / 7 天2,417fork同步于 2026-11-10 05:21 UTC

怎么上手

由 README 提炼,执行前请确认
pip install mlx
硬件要求按 README 说明

面向 Apple silicon;README 说明运算可跑在 CPU 和 GPU 上,Linux 另提供 CUDA 后端和纯 CPU 包,但未给出具体显存或 GPU 型号要求。

纯 CPU 可运行支持 Apple Silicon需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Apple 出品的数组框架,让 Mac 统一内存上高效训练和部署模型

面向 Apple silicon 的数组计算框架,让机器学习模型能直接在 Mac 芯片上高效训练和推理,省去折腾 CUDA 的麻烦。

核心能力

  • Python API 贴近 NumPy,mlx.nn 和 mlx.optimizers 贴近 PyTorch
  • 支持自动微分、自动向量化与计算图优化的可组合变换
  • 惰性计算,数组仅在需要时才实际生成
  • 动态构建计算图,改形状不触发慢编译,便于调试
  • 统一内存模型,CPU 与 GPU 间无需拷贝数据

容易踩的坑

Linux 上默认包不含 CUDA,需装 mlx[cuda];纯 CPU 的 Linux 环境要装 mlx[cpu];示例代码在单独的 mlx-examples 仓库,不在本仓库内。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.32.4
  1. v0.32.4最新正式版2026-10-14 · 2026-10-14 23:37 UTC

    What's Changed

  2. v0.32.32026-09-29 · 2026-09-29 00:37 UTC
    查看更新说明

    What's Changed

  3. v0.32.22026-08-25 · 2026-08-25 10:58 UTC
    查看更新说明

    What's Changed

  4. v0.32.12026-08-18 · 2026-08-18 03:45 UTC
    查看更新说明

    What's Changed

  5. v0.32.02026-07-07 · 2026-07-07 22:29 UTC
    查看更新说明

    What's Changed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    MLX

    Quickstart | Installation | Documentation | Examples

    CircleCI

    MLX is an array framework for machine learning on Apple silicon, 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 also has fully featured C++, C, and Swift APIs, which closely mirror 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.

    • Composable function transformations: MLX supports composable function transformations for automatic differentiation, automatic vectorization, and computation graph optimization.

    • Lazy computation: Computations in MLX are lazy. Arrays are only materialized when needed.

    • Dynamic graph construction: Computation graphs in MLX are constructed dynamically. Changing the shapes of function arguments does not trigger slow compilations, and debugging is simple and intuitive.

    • Multi-device: Operations can run on any of the supported devices (currently the CPU and the GPU).

    • Unified memory: A notable difference from MLX and other frameworks is the unified memory model. Arrays in MLX live in shared memory. Operations on MLX arrays can be performed on any of the supported device types without transferring data.

    MLX is designed by machine learning researchers for machine learning researchers. The framework is intended to be user-friendly, but still efficient to train and deploy models. The design of the framework itself is also conceptually simple. We intend to make it easy for researchers to extend and improve MLX with the goal of quickly exploring new ideas.

    The design of MLX is inspired by frameworks like NumPy, PyTorch, Jax, and ArrayFire.

    Examples

    The MLX examples repo has a variety of examples, including:

    Quickstart

    See the quick start guide in the documentation.

    Installation

    MLX is available on PyPI. To install MLX on macOS, run:

    pip install mlx
    

    To install the CUDA backend on Linux, run:

    pip install mlx[cuda]
    

    To install a CPU-only Linux package, run:

    pip install mlx[cpu]
    

    Checkout the documentation for more information on building the C++ and Python APIs from source.

    Contributing

    Check out the contribution guidelines for more information on contributing to MLX. See the docs for more information on building from source, and running tests.

    We are grateful for all of our contributors. If you contribute to MLX and wish to be acknowledged, please add your name to the list in your pull request.

    Citing MLX

    The MLX software suite was initially developed with equal contribution by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find MLX useful in your research and wish to cite it, please use the following BibTex entry:

    @software{mlx2023,
      author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},
      title = {{MLX}: Efficient and flexible machine learning on Apple silicon},
      url = {https://github.com/ml-explore},
      version = {0.0},
      year = {2023},
    }