pub trait ProcessGroup: Send + Sync {
// Required methods
fn all_reduce(&self, tensor: &mut ArrayD<f32>) -> Result<()>;
fn barrier(&self) -> Result<()>;
fn broadcast(&self, tensor: &mut ArrayD<f32>, root: usize) -> Result<()>;
fn get_rank(&self) -> usize;
fn get_world_size(&self) -> usize;
}
Expand description
Process group trait for different communication backends
Required Methods§
Sourcefn all_reduce(&self, tensor: &mut ArrayD<f32>) -> Result<()>
fn all_reduce(&self, tensor: &mut ArrayD<f32>) -> Result<()>
Perform all-reduce operation on tensor across all processes
Sourcefn broadcast(&self, tensor: &mut ArrayD<f32>, root: usize) -> Result<()>
fn broadcast(&self, tensor: &mut ArrayD<f32>, root: usize) -> Result<()>
Broadcast tensor from root process to all others
Sourcefn get_world_size(&self) -> usize
fn get_world_size(&self) -> usize
Get the total number of processes