Expand description
Platform-neutral node driver — the piece a non-desktop shell links.
Everything a node needs to join a mesh and serve work, with no
environment variables, no process spawning, and no stdout contract. That
matters because the existing node driver lives in an example
(rlx-collectives/examples/dist_node.rs), and an example cannot be linked
into an Android .so, an iOS framework, or an embedded host shim.
let cfg = NodeConfig::new(1, 2)
.peers(["192.168.1.10:29500", "192.168.1.11:29501"])?
.device("auto");
let group = cfg.connect().map_err(|e| e.to_string())?;
let report = serve_worker(&group, |_uri| Vec::new())?;§Roles
NodeRole::Worker— the general case: compile and run whatever stage the coordinator ships. Any host with a CPU qualifies (phone, SBC, laptop).NodeRole::FixedFunction— a pre-synthesized accelerator whose datapath is baked into a bitstream (an FPGA). It cannot compile a shipped graph, so it advertises the one stage it implements and refuses anything else. SeeFixedFunction.
Structs§
- Fixed
Function - A stage baked into hardware that cannot be reprogrammed at run time.
- Loopback
Fixed Function - A software stand-in for a synthesized board, so the fixed-function mesh path can be exercised in tests and on a dev machine with no FPGA attached.
- Node
Caps - What a node tells the coordinator about itself, so placement is driven by what the hardware can actually do rather than by assumption.
- Node
Config - Programmatic node configuration.
- Node
Control - Bounds a serving loop: a step budget, plus a stop flag another thread can raise.
- Node
Report - What a node did, returned instead of printed — a mobile shell has no stdout to scrape.
- Node
Stop Handle - Raises the stop flag on a
NodeControlfrom another thread. - Process
Group - Re-exported so a shell can name what
NodeConfig::connecthands back without adding a dependency on the transport crate. The node API is meant to be the whole surface a non-Rust shell needs —.star()/.mesh()exist for the same reason. A handle to the collective-communication world: a rank, a size, and the transport that connects them. - Train
Report - What a node did in a training run.
Enums§
- Node
Role - What kind of work a node accepts.
- Peer
Source - How this node finds its peers.
- Topology
- Re-exported so a shell can name what
NodeConfig::connecthands back without adding a dependency on the transport crate. The node API is meant to be the whole surface a non-Rust shell needs —.star()/.mesh()exist for the same reason. Wire topology.
Traits§
- Fixed
Function Device - The host-side driver for a piece of fixed-function hardware.
Functions§
- collect_
caps - Coordinator: collect every worker’s capabilities (ranks
1..world). - mean_
reduce - Average a flat gradient buffer across every rank in
group. - node_
device - Resolve this node’s device directive to a concrete backend.
- platform_
tag - Compile-time platform tag. Not a capability — just an identifier, so a coordinator log says which kind of node answered.
- send_
caps - Worker: announce capabilities to the coordinator (rank 0).
- serve_
fixed_ function_ n - Serve as a fixed-function rank: announce the one stage this hardware implements, then stream activations through the board.
- serve_
trainer - Serve as a training worker: announce capabilities, receive a
TrainSpecthe coordinator ships, and run the data-parallel loop against this node’s own hardware. - serve_
trainer_ here serve_trainerwith capabilities derived from this node.- serve_
worker serve_worker_nwith default capabilities and no step bound.- serve_
worker_ n - Serve as a general worker: announce caps, receive a stage, then run activations until the peer closes the link.
- weight_
cache - Weight cache constructor re-exported for shells that resolve their own URIs.