Skip to main content

Module node

Module node 

Source
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. See FixedFunction.

Structs§

FixedFunction
A stage baked into hardware that cannot be reprogrammed at run time.
LoopbackFixedFunction
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.
NodeCaps
What a node tells the coordinator about itself, so placement is driven by what the hardware can actually do rather than by assumption.
NodeConfig
Programmatic node configuration.
NodeControl
Bounds a serving loop: a step budget, plus a stop flag another thread can raise.
NodeReport
What a node did, returned instead of printed — a mobile shell has no stdout to scrape.
NodeStopHandle
Raises the stop flag on a NodeControl from another thread.
ProcessGroup
Re-exported so a shell can name what NodeConfig::connect hands 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.
TrainReport
What a node did in a training run.

Enums§

NodeRole
What kind of work a node accepts.
PeerSource
How this node finds its peers.
Topology
Re-exported so a shell can name what NodeConfig::connect hands 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§

FixedFunctionDevice
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 TrainSpec the coordinator ships, and run the data-parallel loop against this node’s own hardware.
serve_trainer_here
serve_trainer with capabilities derived from this node.
serve_worker
serve_worker_n with 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.