Skip to main content

Module comm

Module comm 

Source
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:

CommunicatorDeviceGroup
ModelSPMD — one process per rankone process, N devices
You passyour shardevery shard
Transportexternal (NCCL/Gloo/MPI)in-graph Op::Copy
Works todayonly at world_size == 1yes

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§

CommInfo
Basic communicator metadata.
IdentityComm
A single-process “communicator” that passes tensors through unchanged.

Enums§

ReduceOp
Reduce operation type.

Traits§

Communicator
Abstraction over collective communication backends.