This package provides an R interface to Apple's MLX (Machine Learning eXchange) library for GPU-accelerated array operations on Apple Silicon.
Key Features
Lazy evaluation: Operations are not computed until explicitly evaluated
GPU acceleration: Leverage Metal on Apple Silicon
Familiar syntax: S3 methods for standard R operations
Unified memory: Efficient data sharing between CPU and GPU
Lazy Evaluation
MLX arrays use lazy evaluation by default. Operations are recorded but not executed until:
You call
mlx_eval()You convert to R with e.g.
as.array()oras.vector()The result is needed for another computation
The package implements most of the C++ API via calls with the mlx_ prefix,
but it also ships S3 methods for many base generics,
so common R matrix operations continue to work on MLX arrays. R conventions
are used throughout: for example, indexing is 1-based.
Author
Maintainer: David Hugh-Jones david@hughjones.com
Other contributors:
Apple Inc. (MLX library downloaded at install time) [copyright holder]