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

Uploaded CPython 3.12macOS 14.0+ ARM64

mlx-0.1.0-cp312-cp312-macosx_13_0_arm64.whl (15.0 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

mlx-0.1.0-cp311-cp311-macosx_13_0_arm64.whl (15.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

mlx-0.1.0-cp310-cp310-macosx_13_0_arm64.whl (15.0 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

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

Uploaded CPython 3.9macOS 14.0+ ARM64

mlx-0.1.0-cp39-cp39-macosx_13_0_arm64.whl (15.0 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

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

Uploaded CPython 3.8macOS 14.0+ ARM64

mlx-0.1.0-cp38-cp38-macosx_13_0_arm64.whl (15.0 MB view details)

Uploaded CPython 3.8macOS 13.0+ ARM64

File details

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

File metadata

  • Download URL: mlx-0.1.0-cp312-cp312-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 17.1 MB
  • Tags: CPython 3.12, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for mlx-0.1.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e0b8dd3f9c60f3038f4dc0c47668e6d1f4857812e0133c220fe6602330c01ad1
MD5 ca5b013657688d95449d19913f6e6473
BLAKE2b-256 0854de741cc90f47920b14f7c190d0f6bfeab34e041d5be0cb9d530b4d41f905

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.1.0-cp312-cp312-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.12, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for mlx-0.1.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 d965656311b017b134198bc8022797f78a5e47ebc6a19e1969249e92fb94124b
MD5 a8d509019687415abb115425459c8abe
BLAKE2b-256 b973f31a469b4f185909f1f73d0b7230c2d5a04e601edd7e5b767a52e8b1547f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.1.0-cp311-cp311-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 17.1 MB
  • Tags: CPython 3.11, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for mlx-0.1.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b93e81ec7c0eabaf61cfac0e579a4cc4c0de37be21b96ed68d52cd1fd983d089
MD5 82b940002481ebcd095af8a9f2291bc8
BLAKE2b-256 00fd4a1e3b7aab0d92a01980536bb9c1e5313d4f543d05acf68c1f7f2a5fba68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.1.0-cp311-cp311-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.11, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for mlx-0.1.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e89f55e2a6b0502c84d70de1282e4d872c9c14e9a617ebd2bc15cd8767358bd3
MD5 27a79f504a5438d4247bd1590d5f5072
BLAKE2b-256 890b5c1e3af43089aa83355e503995d0f8922bf58e7a18aa2d92047e308eca97

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mlx-0.1.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 aeea9b5f8cbc4d40351e37d6ec1fb23148ed119d965f49f37c6931ff0400a896
MD5 0bff37fd8983c1b0e5de9e618b1c1b9b
BLAKE2b-256 9350712c57721d1ee7d4bfee5d2fc200baaec9729ab9e68f6fd4152c22703c04

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mlx-0.1.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 2115692ea4944f8d214ebb619159de4226e9970a949a64948ec77e2248a69586
MD5 f334bc8340b8ddbd3b91dc3cd240a791
BLAKE2b-256 72272d80954409087cce44f2b66fae1666eb5107d82b5a5c49514351a44cea30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.1.0-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.1.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 29a108083777ace3525ef8f16666e9439d0a5a80da6e9e27c5de32b407540012
MD5 b4569fe8807d77a068748503fdf984fb
BLAKE2b-256 4eceaad9ab064b3a343962a120f68a58729cd0635a85866b066e3086bc0bcc7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.1.0-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 15.0 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.1.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 85f67eabd15888d7798a502deb502b2e28c28f6bb2cfb549cb6ab527765466ef
MD5 78aab5e86b76cf1e625fcc71304da917
BLAKE2b-256 fba8000ec760c8309eb22b38eda00575ef05cbc07a5be35e55c9abc610e7e4da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.1.0-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.1.0-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 31e8207253e4ecfd616b34315885ab071475d617daac1284fe233eb33c79b809
MD5 8300571186683c6c2f9726a456fd3021
BLAKE2b-256 8972f963a3fdafd1c871d985a9fba67790c365abcfc83f7195b1d7195a8e1fbd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx-0.1.0-cp38-cp38-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 15.0 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.1.0-cp38-cp38-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 45498f4abfc4d68b3579d154bd543b4a12fa2a49e2cb80f2af53eba3da075c95
MD5 c842c43f8a36535c10723c4560adf43f
BLAKE2b-256 5c1f9edcc8c36bec8ea2e2f517a01e5799552de084c8fad587bcf99f6a214ff8

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