pub struct CollectiveShape {
pub input: Shape,
pub output: Shape,
pub input_elements: usize,
pub output_elements: usize,
}Expand description
Logical input and rank-ordered output of an equal-size collective.
Fields§
§input: ShapeEach rank’s original tensor shape.
output: ShapeGathered shape or this rank’s contiguous reduced shard.
input_elements: usizeLogical input element count, independent of view strides.
output_elements: usizeLogical output element count.
Implementations§
Source§impl CollectiveShape
impl CollectiveShape
Sourcepub fn all_gather(
input: Shape,
world_size: usize,
) -> Result<CollectiveShape, MetadataError>
pub fn all_gather( input: Shape, world_size: usize, ) -> Result<CollectiveShape, MetadataError>
Concatenate each rank’s tensor along axis zero, in rank order.
Sourcepub fn reduce_scatter(
input: Shape,
world_size: usize,
) -> Result<CollectiveShape, MetadataError>
pub fn reduce_scatter( input: Shape, world_size: usize, ) -> Result<CollectiveShape, MetadataError>
Partition a reduced tensor into equal contiguous axis-zero shards. The leading axis, not just the total volume, must divide by world size.
Trait Implementations§
Source§impl Clone for CollectiveShape
impl Clone for CollectiveShape
Source§fn clone(&self) -> CollectiveShape
fn clone(&self) -> CollectiveShape
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CollectiveShape
impl Debug for CollectiveShape
impl Eq for CollectiveShape
Source§impl PartialEq for CollectiveShape
impl PartialEq for CollectiveShape
impl StructuralPartialEq for CollectiveShape
Auto Trait Implementations§
impl Freeze for CollectiveShape
impl RefUnwindSafe for CollectiveShape
impl Send for CollectiveShape
impl Sync for CollectiveShape
impl Unpin for CollectiveShape
impl UnsafeUnpin for CollectiveShape
impl UnwindSafe for CollectiveShape
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.