pub trait MeshComm: Debug {
// Required methods
fn all_reduce(
&self,
buf: &mut [u8],
dtype: DType,
op: ReduceOp,
group: &str,
) -> Result<(), String>;
fn all_gather(
&self,
local: &[u8],
out: &mut [u8],
dtype: DType,
group: &str,
) -> Result<(), String>;
fn broadcast(
&self,
buf: &mut [u8],
root_rank: usize,
group: &str,
) -> Result<(), String>;
fn reduce_scatter(
&self,
buf: &mut [u8],
out: &mut [u8],
op: ReduceOp,
group: &str,
) -> Result<(), String>;
fn barrier(&self, group: &str) -> Result<(), String>;
fn send(&self, buf: &[u8], dest_rank: usize) -> Result<(), String>;
fn recv(&self, buf: &mut [u8], src_rank: usize) -> Result<(), String>;
}Expand description
Communication operations for distributed execution
Required Methods§
Sourcefn all_reduce(
&self,
buf: &mut [u8],
dtype: DType,
op: ReduceOp,
group: &str,
) -> Result<(), String>
fn all_reduce( &self, buf: &mut [u8], dtype: DType, op: ReduceOp, group: &str, ) -> Result<(), String>
All-reduce operation: reduce values across all ranks in a group
Sourcefn all_gather(
&self,
local: &[u8],
out: &mut [u8],
dtype: DType,
group: &str,
) -> Result<(), String>
fn all_gather( &self, local: &[u8], out: &mut [u8], dtype: DType, group: &str, ) -> Result<(), String>
All-gather: gather data from all ranks
Sourcefn broadcast(
&self,
buf: &mut [u8],
root_rank: usize,
group: &str,
) -> Result<(), String>
fn broadcast( &self, buf: &mut [u8], root_rank: usize, group: &str, ) -> Result<(), String>
Broadcast from root rank to all ranks in group
Sourcefn reduce_scatter(
&self,
buf: &mut [u8],
out: &mut [u8],
op: ReduceOp,
group: &str,
) -> Result<(), String>
fn reduce_scatter( &self, buf: &mut [u8], out: &mut [u8], op: ReduceOp, group: &str, ) -> Result<(), String>
Reduce-scatter: reduce and distribute results