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 a fully featured C++ API, which closely mirrors 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.3.0-cp312-cp312-macosx_14_0_arm64.whl (25.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mlx-0.3.0-cp312-cp312-macosx_13_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

mlx-0.3.0-cp311-cp311-macosx_14_0_arm64.whl (25.1 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mlx-0.3.0-cp311-cp311-macosx_13_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

mlx-0.3.0-cp310-cp310-macosx_14_0_arm64.whl (25.1 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mlx-0.3.0-cp310-cp310-macosx_13_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

mlx-0.3.0-cp39-cp39-macosx_14_0_arm64.whl (25.1 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

mlx-0.3.0-cp39-cp39-macosx_13_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

mlx-0.3.0-cp38-cp38-macosx_14_0_arm64.whl (25.1 MB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

mlx-0.3.0-cp38-cp38-macosx_13_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.8macOS 13.0+ ARM64

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp312-cp312-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 25.1 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.3.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b531db420bd5e6e7e9f679c50943e93d2bf9f720996eaaf060415735330d1d9d
MD5 5a43b6aa327fb42a4ebe520226f7dab4
BLAKE2b-256 e01a4c00d92568cf341ad6261eb7aef612cd32bea7174b9d8611ac95ae7785bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp312-cp312-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 20.6 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.3.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 4f3380273a318b55e345574fe9b9ce01c110c1bd351df69e3bf29dcf1f863c11
MD5 5b91f054ab0a6cac32306babb5d7a0ae
BLAKE2b-256 1c193f7a9b16aef7d86564da43a578f3e03deef788c4dde863c12e8fad8c53ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp311-cp311-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 25.1 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.3.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 839de69057b5a29e50b5c8389199e2b0d4bd47e74889f2118ea46dc2a39e3c79
MD5 aa38c3db65ec6d3daab3e46d3f39f9a8
BLAKE2b-256 c62c9b935baeeabc8d533a6ef867d0c7df7ceabedcd7d930a374da6e9a4372f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp311-cp311-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 20.6 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.3.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 b4697fd431aeaa56686501bb3a1146dbc727665e4d24d6991fe4131efe03e82b
MD5 b1e6dc795ed8673c610b32824b4a6626
BLAKE2b-256 d6f23e5d509a4f87c51bce63c2fb3e5465eb80b378acfd38837283566e2eb7ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp310-cp310-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 25.1 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.3.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3ee0bede2697086598919d7a360a01a0f2b764ba4df355aa8f9386440a0930b1
MD5 0490c8f77630d57bdf2ccacd084cf507
BLAKE2b-256 5e4cd5f289106cecc973b664289684e847e313df98d3b6ad24c0a8ed4110fa56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp310-cp310-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 20.6 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.3.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 74866337011c874c8ebff1350598f7e357f1ca6b863c6e305c3a107be43623c6
MD5 1a30e2d3c868287a17e0114797048d5a
BLAKE2b-256 3401d4bd799d57e936d0eab4581249beadd81daf99dc19e427809336abb69e83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 25.1 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.3.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 adad8685c7f44821fae6462742e9f2e96e6d3e6d367530a0cc4ac39c07700fa5
MD5 ac6e4a15b91d715982512fbef6fd0f74
BLAKE2b-256 a47025adec47bf9d421652cc1c39f092479eb8a17d1697512e5e8cea188aa95c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 20.6 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.3.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ddf460cb6851dcd5581a6a2eae25e61e427618b2a8678a5177df4bfb93bfea7c
MD5 ab86f41a88d68ed4762880c4a4a89e06
BLAKE2b-256 c6a0d619246866df5530373f64b1413b67a4bdba8c445756d378b4cd7284a60b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp38-cp38-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 25.1 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.3.0-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 241ace7274b692500441032ec8e7642b91945f093f7f7d8503396b42482a1e7f
MD5 5beeae686d2ae84eec1ac473d42107b2
BLAKE2b-256 1291b99156722556aeda95feeefa6d9d92377c63d22f9d526ce2d0aae72eda82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.3.0-cp38-cp38-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 20.6 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.3.0-cp38-cp38-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 70e45071781af8944ed01f22666cb52428e8d6da77423122c7f3587a1359840f
MD5 bfc5ca3601c25a5b9542bf31cc2eadc3
BLAKE2b-256 d1c4553bfbb6bc3c9c96255a317ac53b99675076b097400de1e62637fa762993

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