mlx README

The project's README from github.com/ml-explore/mlx. As one markdown file: README.md.

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:

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},
}

mlx (ml-explore/mlx)

Searching Database…

28.8K ·GitHub
这是什么?MLX 是苹果机器学习研究团队打造的一个数组计算框架,面向 Apple 芯片上的机器学习任务。
它是一个 Python 库,还是一个完整的框架?两个层面都有:既有紧贴 NumPy 风格的 Python API,也有与之对应的 C++、C 和 Swift API,还有仿照 PyTorch 设计的更高层软件包 mlx.nn 和 mlx.optimizers。
我的电脑能跑吗?是不是只能在 Mac 上用?它优先支持搭载 Apple 芯片的 Mac,不过 Linux 也支持,可以通过 CUDA 后端或纯 CPU 的安装包来用。没有提到支持 Windows。
MLX 和 NumPy、PyTorch 有什么不一样?关键在于它的统一内存模型:数组存放在共享内存里,所以操作可以直接在 CPU 或 GPU 上运行,不需要来回搬运数据。计算是惰性执行的,计算图动态构建,自动求导和向量化也都是内置的。
用它实际能做出什么?官方示例仓库覆盖了 transformer 语言模型训练、用 LLaMA 进行大规模文本生成以及 LoRA 微调、用 Stable Diffusion 生成图像,还有用 Whisper 做语音识别。
苹果为什么不直接用 PyTorch,而要自己做一个?它是机器学习研究者为研究者打造的:既好用,又能高效地训练和部署模型,而且概念上简单、容易扩展,方便快速验证新想法。它的设计借鉴了 NumPy、PyTorch、Jax 和 ArrayFire。
Creator
ml-explore
Size
69.4 MB
Stars
28.8K
Age
2y
Commits · 90 Days