Skip to main content

MeshComm

Trait MeshComm 

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

Source

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

Source

fn all_gather( &self, local: &[u8], out: &mut [u8], dtype: DType, group: &str, ) -> Result<(), String>

All-gather: gather data from all ranks

Source

fn broadcast( &self, buf: &mut [u8], root_rank: usize, group: &str, ) -> Result<(), String>

Broadcast from root rank to all ranks in group

Source

fn reduce_scatter( &self, buf: &mut [u8], out: &mut [u8], op: ReduceOp, group: &str, ) -> Result<(), String>

Reduce-scatter: reduce and distribute results

Source

fn barrier(&self, group: &str) -> Result<(), String>

Barrier synchronization

Source

fn send(&self, buf: &[u8], dest_rank: usize) -> Result<(), String>

Send data to a specific rank

Source

fn recv(&self, buf: &mut [u8], src_rank: usize) -> Result<(), String>

Receive data from a specific rank

Implementors§