Skip to main content

A framework for machine learning on Apple silicon.

Project description

MLX

Quickstart | Installation | Documentation | Examples

CircleCI

MLX is an array framework for machine learning research 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 the Python API, run:

With pip:

pip install mlx

With conda:

conda install -c conda-forge mlx

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mlx-0.4.0-cp312-cp312-macosx_14_0_arm64.whl (32.4 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mlx-0.4.0-cp312-cp312-macosx_13_0_arm64.whl (26.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

mlx-0.4.0-cp311-cp311-macosx_14_0_arm64.whl (32.4 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mlx-0.4.0-cp311-cp311-macosx_13_0_arm64.whl (26.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

mlx-0.4.0-cp310-cp310-macosx_14_0_arm64.whl (32.4 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mlx-0.4.0-cp310-cp310-macosx_13_0_arm64.whl (26.5 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

mlx-0.4.0-cp39-cp39-macosx_14_0_arm64.whl (32.4 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

mlx-0.4.0-cp39-cp39-macosx_13_0_arm64.whl (26.5 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

mlx-0.4.0-cp38-cp38-macosx_14_0_arm64.whl (32.4 MB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

mlx-0.4.0-cp38-cp38-macosx_13_0_arm64.whl (26.5 MB view details)

Uploaded CPython 3.8macOS 13.0+ ARM64

File details

Details for the file mlx-0.4.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp312-cp312-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 32.4 MB
  • Tags: CPython 3.12, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for mlx-0.4.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bd52bfe950ef48d2f9fa1748b5345772251c25b9babfcb2bfb75d55e17873537
MD5 c5b9900a26e5a84229f3ccd3080423c8
BLAKE2b-256 e0b2a8654d069b5a27a37bc774ed60c1e1bb93bcb8c762035f9f0277c70a2188

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp312-cp312-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 26.5 MB
  • Tags: CPython 3.12, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for mlx-0.4.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 033171ab1ddb006b58e1056656f1680ddbca30e5478913d28c45a75768305406
MD5 34e1c8818b5c5069b3c55e401b43e08e
BLAKE2b-256 7fafdc9f87f1874d0bd5c69578d4a6d07b13e0d611166af6887cece476811295

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp311-cp311-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 32.4 MB
  • Tags: CPython 3.11, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for mlx-0.4.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 767bc42cdb561b7768561cb08e77add4d44fe170249b4ecd9df29b7467ddef20
MD5 461a562f3129d63c43cbeac9b367fd65
BLAKE2b-256 3813d3d6241867f838f2a559677cd409cd2e6b31119a2b0ede9a881c5b256418

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp311-cp311-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 26.5 MB
  • Tags: CPython 3.11, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for mlx-0.4.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 b452014bd9ef876a36770c62377beda47d474eff827c8e85b9fa1e429e3c10d9
MD5 145884746f83aba94a8b9ee9bba10e9d
BLAKE2b-256 efa25bfb7c35721b15ced3dd2af04f14f954a34a971b695d9e495cc65bbbdde3

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp310-cp310-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 32.4 MB
  • Tags: CPython 3.10, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for mlx-0.4.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e61f24e7334821d09b45a00a5ae8d0c5a16e42e7990f84f4f541c37170b068f6
MD5 0695710cf50419127515a58d20b23c7e
BLAKE2b-256 429971ab6885ae6b67542aa63414c66c85e40f94c0339da006d0c15367604033

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp310-cp310-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 26.5 MB
  • Tags: CPython 3.10, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for mlx-0.4.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e80bfbad807a6f5ca514bedba6bf2fdb26829452484350c7b199c47f1bd3af5b
MD5 1095e6c26fbccc71106e37760bbf4e0f
BLAKE2b-256 0afd6a965c49f838ad3eea2af9ef1eee28c4d902ca0b9dd67176e9b36506c40a

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 32.4 MB
  • Tags: CPython 3.9, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for mlx-0.4.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 63a32e319743dcb9a4986a675164eea10a92071512ecee5beec76446b1999b83
MD5 47b1e4f7c29172256b46b1720e5b39cd
BLAKE2b-256 f4eba9526da5437163ac27e799d8f066d4a29586227f903b92cfab15ddf6a920

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 26.5 MB
  • Tags: CPython 3.9, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for mlx-0.4.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7b716619b26fa03b0b24eddfa9859890667a437fa05699fcd4b0b86c7660e7c6
MD5 d4b26c8fc8b359ce2df572f164c20206
BLAKE2b-256 1347ca7543e14e47f6bae321ca0c1e26a58023e2f115c35b91cbb71309480b6e

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp38-cp38-macosx_14_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp38-cp38-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 32.4 MB
  • Tags: CPython 3.8, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for mlx-0.4.0-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ff5587d7e268f6fe0ac3f81536d37a3503fd9700f939dbf9918a5d7631d001aa
MD5 bfb6d3aa84feb68839a6a4c5f7d114a5
BLAKE2b-256 6d9d3f24a6d3825adfad0fc22c5e6918b6a6350534137cc64ebe1b7e83d99398

See more details on using hashes here.

File details

Details for the file mlx-0.4.0-cp38-cp38-macosx_13_0_arm64.whl.

File metadata

  • Download URL: mlx-0.4.0-cp38-cp38-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 26.5 MB
  • Tags: CPython 3.8, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for mlx-0.4.0-cp38-cp38-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 75a78ecffba08fdbbdf282eb464678170f20bfa7cf4ef1fb645575de1f4ac4b8
MD5 971ffdb6d7eac64518bac0a5c85371af
BLAKE2b-256 194641f18d1fb0456a65f0199c8ecba14f2b10eefee0c8279a416496dd5ab1ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page