Expand description
One-call node bring-up.
Joining a distributed job used to mean hand-wiring a transport (mesh vs.
star), resolving peer addresses, and wrapping the result in an
Arc<ProcessGroup>. Node collapses that to a builder:
// From env (RANK/WORLD/PEERS or DISCOVER/TOPOLOGY):
let group = Node::from_env()?.connect()?;
// Or explicitly:
let group = Node::new(/*rank*/ 1, /*world*/ 2)
.topology(Topology::Star) // worker dials the coordinator
.peers(["10.0.0.1:29500"])? // just the coordinator address
.connect()?;
let _ = group;The returned ProcessGroup carries every collective (all_reduce,
all_reduce_typed, federated_average, broadcast, …). This is the
entry point a model runner or an edge worker calls to get on the mesh.
Structs§
- Node
- Builder that turns minimal config into a connected
ProcessGroup.
Enums§
- Topology
- Wire topology.
Functions§
- announce_
coordinator - Coordinator side of star discovery: a pure unicast responder on
disc_port— a worker sendsRLXQ, we replyRLXPORT <data_port>. Runs untilstop. Deliberately does NOT broadcast on this socket: a coordinator that both beacons and receives on one socket starves incoming queries (its own zero-latency loopback beacons always win the recv race). LAN zero-config is handled by mDNS instead ([mdns_advertise]); this responder covers a worker that reaches us by name/IP (LAN,host.docker.internal, or a Tailscale MagicDNS name — anything routable). - discover_
coordinator - Worker side of star discovery: return the coordinator’s dial address.
host = Some(h)(NAT/Docker) unicasts a query toh:disc_portand dialsh:portfrom the reply;Nonelistens for the LAN broadcast and dials the announcing host’s own IP. - discover_
peers - UDP-broadcast rendezvous: announce
rank → ip:(data_base+rank)ondisc_portand collect until allworldaddresses are known; return them sorted by rank. Zero-config peer discovery on a shared LAN. - local_
ip - The default-route local IP (picks the outbound interface); loopback if the probe fails.