Backend

Trait Backend 

Source
pub trait Backend: Send + Sync {
Show 13 methods // Required methods fn name(&self) -> &str; fn rank(&self) -> usize; fn world_size(&self) -> usize; fn all_reduce(&self, data: &mut [f32], op: ReduceOp); fn broadcast(&self, data: &mut [f32], src: usize); fn all_gather(&self, send_data: &[f32], recv_data: &mut [f32]); fn reduce_scatter( &self, send_data: &[f32], recv_data: &mut [f32], op: ReduceOp, ); fn gather(&self, send_data: &[f32], recv_data: &mut [f32], dst: usize); fn scatter(&self, send_data: &[f32], recv_data: &mut [f32], src: usize); fn reduce( &self, send_data: &[f32], recv_data: &mut [f32], dst: usize, op: ReduceOp, ); fn barrier(&self); fn send(&self, data: &[f32], dst: usize, tag: usize); fn recv(&self, data: &mut [f32], src: usize, tag: usize);
}
Expand description

Trait for distributed communication backends.

Required Methods§

Source

fn name(&self) -> &str

Returns the name of the backend.

Source

fn rank(&self) -> usize

Returns the rank of this process.

Source

fn world_size(&self) -> usize

Returns the total world size.

Source

fn all_reduce(&self, data: &mut [f32], op: ReduceOp)

Performs all-reduce operation.

Source

fn broadcast(&self, data: &mut [f32], src: usize)

Broadcasts data from a source rank.

Source

fn all_gather(&self, send_data: &[f32], recv_data: &mut [f32])

Performs all-gather operation.

Source

fn reduce_scatter(&self, send_data: &[f32], recv_data: &mut [f32], op: ReduceOp)

Performs reduce-scatter operation.

Source

fn gather(&self, send_data: &[f32], recv_data: &mut [f32], dst: usize)

Performs gather operation.

Source

fn scatter(&self, send_data: &[f32], recv_data: &mut [f32], src: usize)

Performs scatter operation.

Source

fn reduce( &self, send_data: &[f32], recv_data: &mut [f32], dst: usize, op: ReduceOp, )

Performs reduce operation (result only on dst rank).

Source

fn barrier(&self)

Synchronizes all processes.

Source

fn send(&self, data: &[f32], dst: usize, tag: usize)

Sends data to a specific rank.

Source

fn recv(&self, data: &mut [f32], src: usize, tag: usize)

Receives data from a specific rank.

Implementors§