Expand description
Distributed backends for nuvec: MLX’s TCP ring, and MLX’s JACCL (RDMA over
Thunderbolt 5; experimental, feature jaccl).
init reads MLX’s launch environment, connects a backend and makes it the default
group of nuvec::distributed’s collectives, as mx.distributed.init(). The ring reads
MLX_HOSTFILE (a JSON list with one entry per rank of "host:port" addresses) and
MLX_RANK; JACCL reads the variables mlx.launch --backend jaccl writes
(jaccl::Config::from_env). init_backend names the backend. Every rank runs the
same program; the processes may share one Mac (over loopback) or run on several (over
Ethernet or Thunderbolt IP for the ring, Thunderbolt 5 cables for JACCL).
use nuvec_core::{array, distributed};
let group = nuvec_distributed::init(false)?; // size 1 without a hostfile
let x = array![1.0, 2.0];
let total = distributed::all_sum(&x, None); // the sum over every rank
println!("rank {} of {}: {:?}", group.rank(), group.size(), total.to_vec::<f32>()?);Stability: no promise when this crate is depended on directly; depend on nuvec,
whose re-exports are semver-tracked.
Modules§
- jaccl
- Experimental: MLX’s JACCL backend, RDMA over Thunderbolt 5 (macOS 26.2+), behind the
jacclfeature. It is unverified on Thunderbolt 5 hardware; its algorithms are tested on an emulated fabric.
Structs§
Enums§
- Backend
- A distributed backend (MLX’s
backendargument).
Functions§
- init
- Initialises a backend from MLX’s environment and makes it the default group, as
mx.distributed.init():init_backendwithBackend::Any. - init_
backend - Initialises
backendfrom MLX’s environment and makes it the default group, as MLX’sinit(strict, backend). A backend initialised before returns its group (Any: the first group initialised). Without the environment: an error naming the missing variables ifstrict, else the group of this process alone. - init_
with - Connects rank
rankof the ring overnodes(per rank its addresses, one connection per address, as MLX’s hostfile) and returns its group (not made the default). A single rank is the group of this process alone. - is_
available - Whether
backendcan run here, as MLX’sis_available(backend): the ring always; JACCL when built in and the system’s RDMA library lists a device.