Expand description
Safe, ergonomic Rust API for MLX tensors and operations.
mlx-core provides the foundational types (Tensor, Device, DType, Shape)
and a backend-agnostic interface for lazy tensor computation.
§Architecture
Operations on tensors build a lazy computation graph. Calling eval() (or
to_vec_f32()) triggers a topological walk that dispatches each node to the
active Backend. A default CPU reference backend is provided out of the box.
§Backends
- Built-in CPU reference: simple, safe Rust — always available
ffifeature: delegates to the MLX C++ runtime viamlx-sysmlx-cpucrate: optimized pure-Rust CPU backend (future)mlx-metalcrate: native Apple Silicon acceleration (future)
Re-exports§
pub use graph::NodeId;pub use tensor::Device;pub use tensor::Tensor;pub use types::DType;pub use types::Shape;
Modules§
- backend
- Backend trait and Stream — pluggable compute engine for tensor evaluation.
- cpu_
kernels - Built-in CPU reference backend — correctness oracle.
- graph
- Lazy computation graph IR.
- tensor
- Tensor type — a lazy handle to a node in the computation graph.
- types
- Core type definitions: DType, Shape.