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 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.0.11-cp312-cp312-macosx_14_0_arm64.whl (17.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mlx-0.0.11-cp312-cp312-macosx_13_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

mlx-0.0.11-cp311-cp311-macosx_14_0_arm64.whl (17.1 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mlx-0.0.11-cp311-cp311-macosx_13_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

mlx-0.0.11-cp310-cp310-macosx_14_0_arm64.whl (17.1 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mlx-0.0.11-cp310-cp310-macosx_13_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

mlx-0.0.11-cp39-cp39-macosx_14_0_arm64.whl (17.1 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

mlx-0.0.11-cp39-cp39-macosx_13_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

mlx-0.0.11-cp38-cp38-macosx_14_0_arm64.whl (17.1 MB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

mlx-0.0.11-cp38-cp38-macosx_13_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.8macOS 13.0+ ARM64

File details

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

File metadata

File hashes

Hashes for mlx-0.0.11-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 84339ccfacedb7518e0cb9dad27507767ba7d800b9a04df504393fdc9e4947c6
MD5 0e2b0cfd242a25ff911ac453f56b48dc
BLAKE2b-256 6170501007742d8f15b88fed5530284cf3402bcb3f2d3b606e17c61db8b480d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.0.11-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7eaa8b2d4f55c30bfae1c01a907a1ecf66829598a174a1973ffd23853ad24387
MD5 4099a5fbea579c15776b54420d8f8350
BLAKE2b-256 66942e031615bb536465cc245583844d3705c761063f6cd2bdd493df2827e4a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.0.11-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b0969b0aa2352aed07e134da7bffd4050d9bd4c96c81646d574f164010c3696f
MD5 98661ee77c177af750a6eeebd8d71206
BLAKE2b-256 8fe740e631abca0823399ad5f89e2fd849393d7e6a8f3efd2cf1a3ef4ceb0df0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.0.11-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 acdfa25996a1f7ee45d431df5544ff6ce85f5148618d591ae9d3aa5510ddf060
MD5 a2102fa236eb159450a3cda73a69f0fb
BLAKE2b-256 dd858a65b2c7b31d18b17b7c84771832afce28f943d4150a766a59443d722f5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.0.11-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 95211547630a9229fee97de1c25cbc9a1f17238317726e9d3470e96e3474422a
MD5 fe6cf19fd5d5abe23dc9be7d9b97cdd2
BLAKE2b-256 48ef8ab3220550d5073c17470011fad44c5fdef2386ea7e768b8f4a6f1e456e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mlx-0.0.11-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 9fe36002cfd5fa4a16e21b0dd9b9923cb412e4091d7d3b93bc94ae900513ce21
MD5 927c7f1487dce4ea794e770a98aeb334
BLAKE2b-256 d040fcb53985c0db6313611f68c77ab1029d7b6a3e758e8eb6a4f6172ad4e717

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mlx-0.0.11-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 30a8d2ced5383a49579472c8d9a100e33b34a31c4ed65d89d3120828856680fd
MD5 e6a116a32cec1bbcb4c70e9a10e9be30
BLAKE2b-256 23ffde67ef348503974b07911e0630d875639a5e2e4e67186afc57080763e051

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mlx-0.0.11-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 5e51383745cd471f138bf75251b43632b1695c281f723607fd9f034c792adb7c
MD5 cd6c39952283142aee294f0a54a65687
BLAKE2b-256 4ddebefa3ed1748da1587f5daf66e35739bc6adfcefa31866b4b328020be1467

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mlx-0.0.11-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0a48605fefa610a271830e8a5bbbe132ef7394a56f51befa3da6f52c79572244
MD5 f36a0438125b239ac77f81927bdd134c
BLAKE2b-256 c6c3d47264d68237a3a125c83857ccd519a54e872eb0995020649390fc13aff5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mlx-0.0.11-cp38-cp38-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 297de8b8784883cf1e85de10f9f187b93c35da8bee5a594c66eee47dee0968c5
MD5 8cb57c042c52367ce5fe886ff2e9fbb6
BLAKE2b-256 65b0b5c26f2a4682f953c45218d9b3ba68c7a1d7dcc305553f5d0c1555106b42

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