pub struct ProcessGroup { /* private fields */ }Expand description
A group of processes that can communicate with each other.
Implementations§
Source§impl ProcessGroup
impl ProcessGroup
Sourcepub fn with_ranks(backend: Arc<dyn Backend>, ranks: Vec<usize>) -> Self
pub fn with_ranks(backend: Arc<dyn Backend>, ranks: Vec<usize>) -> Self
Creates a process group with specific ranks.
Sourcepub fn world_size(&self) -> usize
pub fn world_size(&self) -> usize
Returns the world size.
Sourcepub fn all_reduce_tensor(&self, tensor: &mut Tensor<f32>, op: ReduceOp)
pub fn all_reduce_tensor(&self, tensor: &mut Tensor<f32>, op: ReduceOp)
Performs all-reduce on a tensor.
Sourcepub fn broadcast_tensor(&self, tensor: &mut Tensor<f32>, src: usize)
pub fn broadcast_tensor(&self, tensor: &mut Tensor<f32>, src: usize)
Broadcasts a tensor from a source rank.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcessGroup
impl !RefUnwindSafe for ProcessGroup
impl Send for ProcessGroup
impl Sync for ProcessGroup
impl Unpin for ProcessGroup
impl !UnwindSafe for ProcessGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more