mlx-rs
mlx-rs provides Rust bindings for Apple's MLX array framework, giving Rust programs access to MLX's lazy evaluation, dynamic computation graphs and unified memory for machine learning on Apple Silicon.
mlx-rs provides Rust bindings for MLX, Apple's array framework for machine learning on Apple Silicon. It aims to be a safe, idiomatic Rust interface to MLX rather than a reimplementation, so programs get MLX's own performance characteristics from Rust.
Inherited from MLX, arrays use lazy evaluation and are only materialized when needed, computation graphs are built dynamically so changing an argument's shape does not require recompilation, and an array can run on any supported device — currently CPU or GPU — through a unified memory model that avoids copying data between devices. Optional feature flags enable Metal GPU support and the Accelerate framework.
Automatic differentiation works differently than in Python's MLX: because Rust does not implicitly capture and trace variables in closures, arrays that should be traced through a computation must be passed explicitly as function inputs rather than captured from the surrounding scope.