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, whereBasefunctions operate onMLXArrays like they do onArray, with some differences, e.g. operations may returnFloat32rather thanFloat64results, as MLX does not supportFloat64on 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.
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 system | Architecture | Devices |
|---|---|---|
| macOS | aarch64 | CPU, GPU (Metal) |
| macOS | x86_64 | CPU |
| Linux (glibc) | aarch64 | CPU |
| Linux (glibc) | x86_64 | CPU |
using Pkg
Pkg.add("MLX")See the quick start.