Expand description
Communication abstraction for collective operations — lazy-only.
Defines the Communicator trait that backends (NCCL, Gloo, etc.) implement
to provide collective primitives. Code in tensor_parallel
and pipeline_parallel is generic over this trait.
§Which shape do I want?
This crate carries two collective surfaces, and they are not competitors:
Communicator | DeviceGroup | |
|---|---|---|
| Model | SPMD — one process per rank | one process, N devices |
| You pass | your shard | every shard |
| Transport | external (NCCL/Gloo/MPI) | in-graph Op::Copy |
| Works today | only at world_size == 1 | yes |
A single process driving four GPUs holds all four shards at once and has no
peer to rendezvous with, so the per-rank signature does not fit it — use
DeviceGroup. Communicator is the seam an out-of-process transport plugs
into, and Fuel deliberately does not implement one: which process is rank 3,
and how ranks meet, is consumer policy (see docs/architecture/15-consumer-contract.md).
§Lazy-only
These signatures take Tensor. The eager fuel::Tensor surface is
being retired, and a collective written against it could not reduce lazy
shards — which is the likeliest reason this crate never acquired a consumer.
§Example
use fuel_parallel::comm::{Communicator, ReduceOp, CommInfo};
// A mock communicator for testing (passes data through unchanged).
let info = CommInfo { rank: 0, world_size: 2 };
assert_eq!(info.is_root(), true);
assert_eq!(info.world_size, 2);Structs§
- Comm
Info - Basic communicator metadata.
- Identity
Comm - A single-process “communicator” that passes tensors through unchanged.
Enums§
- Reduce
Op - Reduce operation type.
Traits§
- Communicator
- Abstraction over collective communication backends.