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

mlx-0.26.2-cp313-cp313-macosx_15_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

mlx-0.26.2-cp313-cp313-macosx_14_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

mlx-0.26.2-cp313-cp313-macosx_13_0_arm64.whl (33.1 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

mlx-0.26.2-cp312-cp312-macosx_15_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

mlx-0.26.2-cp312-cp312-macosx_14_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mlx-0.26.2-cp312-cp312-macosx_13_0_arm64.whl (33.1 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

mlx-0.26.2-cp311-cp311-macosx_15_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

mlx-0.26.2-cp311-cp311-macosx_14_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mlx-0.26.2-cp311-cp311-macosx_13_0_arm64.whl (33.1 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

mlx-0.26.2-cp310-cp310-macosx_15_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

mlx-0.26.2-cp310-cp310-macosx_14_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mlx-0.26.2-cp310-cp310-macosx_13_0_arm64.whl (33.1 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

mlx-0.26.2-cp39-cp39-macosx_15_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

mlx-0.26.2-cp39-cp39-macosx_14_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

mlx-0.26.2-cp39-cp39-macosx_13_0_arm64.whl (33.1 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

File details

Details for the file mlx-0.26.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.26.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 36e34dd119d77a000a0d788268d20f9e926bdc0a706045fa30de8a26d8a9e059
MD5 1d3e96715177e27c1bc24e34c8ffd774
BLAKE2b-256 65ce0df9ac206dfd20998a2838b09f7566b495b560a6e1b987af712707da690d

See more details on using hashes here.

File details

Details for the file mlx-0.26.2-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.26.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 80be08dcdc4da45311fd01a05e1a40e2ad47e4128ffa79abc52ab0725ec0dbdf
MD5 06a625fa643fa5cc1cbb3b9c4a87a6fe
BLAKE2b-256 22f0f6fd97514e8556a0611289aca555977d3561289ce4ef9b7a691052c15d20

See more details on using hashes here.

File details

Details for the file mlx-0.26.2-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.26.2-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ee59e1ebf1f3a6fb90bfff187b1a71dd11de29c0c79f7e3d04abdf3d2c2df88b
MD5 8e73bb3e379fe1cf296bd683d4117b88
BLAKE2b-256 c1b2367c5f3ae199db0abfd6e8945b8996efa86fda20524de322de3c34e0b379

See more details on using hashes here.

File details

Details for the file mlx-0.26.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.26.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7e18fc05e85e4bd1519b55fb62b58a93760d927e12acc7b1bfe2cb531b284e04
MD5 564a5c6dc4e5a623f5bf26b2d1066eaf
BLAKE2b-256 89c325729ead37a6f196838aaf48e467dfc2aa0ff7f8008f79421cf7684f8c6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.26.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0decf09ea33dc58c3365af2f437f519ba0765da9b0199b5eaf6e09f90f2f1d6f
MD5 194c1943fd89c02d95d29e82e94f122f
BLAKE2b-256 b9dbccde1938bc7d65e918e7b062fd5128d9c0e00d699c1ef28a57068a539ffc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.26.2-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ee14eebe6625f1344c13246a5b67ea40015706a7ff9affd9a4c943811ecb5b53
MD5 beafc65d54887b5a9c7bfeade7419a9e
BLAKE2b-256 31b857f16154ae3b859e5388e4ca0c816510f3137ea61c0da61db35188372944

See more details on using hashes here.

File details

Details for the file mlx-0.26.2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.26.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c1dea89c317023b1e419c337bb9b7af32e4a29ecd881df14a2429eb001afd72c
MD5 38e6bed932cf49f53fab20068f34bd54
BLAKE2b-256 b53c2075296d53285538407afca1f2d65ee002895b9b99f76bd99867d4de6c61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.26.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bc006c9db31fb8962f522fc45af2258fe093eb15f38b62937810fe2e11a06ead
MD5 d8f9d491110115d2d18d19907f394888
BLAKE2b-256 27da6aad0f95182ddfea1979a077a4c4c6c9e56a7fc9b7a04b9aa16673850e5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.26.2-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 d9d2e886482dc86847ea25ef71bd103c5772dc69ea4c3516621626a009bf5b76
MD5 a9bc5a79ec3de3573863b4715b1d739a
BLAKE2b-256 1619895838604ccb8c68b34b284d94a9b0d0cef9d08d67f7525fe8d86f43e238

See more details on using hashes here.

File details

Details for the file mlx-0.26.2-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.26.2-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d63d2023cb4958938ed75e976444f2a212039a2facf04a3020ced8544485b662
MD5 b5fee32883247b0f7945c415decd9f99
BLAKE2b-256 7ec65ada90f493f48b9897f5ae0abe4ddac855fe9f721ec2c72c2cf2b14b7ec2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.26.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 cc2b1faf65e97e1b4b62018b76888772ea2daac11d4b7c3ee31af7a2fb8c6c9a
MD5 dc615d7868558676ab16e2fadde260f2
BLAKE2b-256 4828ded06fe4a5fb6ab7648925e66088342eb7dd2950299b5dd277f4b67f7604

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.26.2-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 547297872a84c768b176885c7995666c77eceaeb58ae907cafc1999dba959a75
MD5 bc21f4435110f2694c925a3f9238d031
BLAKE2b-256 2baa8f21ff5a6f17216146f277a66b5b5a6a92277aa7cc28cc432716c93170d9

See more details on using hashes here.

File details

Details for the file mlx-0.26.2-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

  • Download URL: mlx-0.26.2-cp39-cp39-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 32.5 MB
  • Tags: CPython 3.9, macOS 15.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mlx-0.26.2-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 cc407d8c039e9c2bc0adfdb9ecd4f6d8ae49a3c05797d60d51b9ae5ae05b5185
MD5 d20f95c2efba79efee941b40acbccd14
BLAKE2b-256 8ee69548b49d6558c089fefc0f87f43dce20992b38e2175bb122b05e52f7dfe4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.26.2-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 32.5 MB
  • Tags: CPython 3.9, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mlx-0.26.2-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f6471769f5f2b7006b729fd02cb61ad808833ccc61f50b501da795e3302f600d
MD5 a1f1e128068cb8dbd8ce30afa39c0b7b
BLAKE2b-256 ed58014c489891a8530333868673da3b4c1ed070fe785a6bdd78e1403e575d98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.26.2-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 33.1 MB
  • Tags: CPython 3.9, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mlx-0.26.2-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 cb1cad0f810550b5902596ad59501e60d8d3016b755dc45b7b1fbf09d956dc2b
MD5 87f6fdd4411bfd26fc883897425f1af8
BLAKE2b-256 9b3efbbd3364fd49381837b5532f5d39f5cd2bf499137e3bee8c31b0f6621729

See more details on using hashes here.

Supported by

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