MLX.jl

Documentation Build Status Coverage Code Style: Blue

A Julia API for MLX, Apple's array framework for machine learning, via MLX C.

An MLXArray is an AbstractArray that can be used like an Array, but whose operations are computed lazily by MLX, on the CPU or on Apple silicon GPUs.

MLX.jl aims to provide two APIs:

  • An Array-compatible API, where Base functions operate on MLXArrays like they do on Array, with some differences, e.g. operations may return Float32 rather than Float64 results, as MLX does not support Float64 on GPUs.
  • An MLX-compatible API, where MLX.<function>s follow MLX's semantics, e.g. in broadcasting and type promotion, to ease porting code written for MLX in other languages.

Supported platforms

MLX.jl should support all of Julia's platforms, via the prebuilt binaries of MLX and MLX C, but it is tested on the following platforms.

Operating systemArchitectureDevices
macOSaarch64CPU, GPU (Metal)
macOSx86_64CPU
Linux (glibc)aarch64CPU
Linux (glibc)x86_64CPU

Installation

using Pkg
Pkg.add("MLX")

Usage

See the quick start.