pub struct RowParallel<C: Communicator> { /* private fields */ }Expand description
Row-parallel linear layer.
Each rank holds rows [rank * in/N .. (rank+1) * in/N] of the weight.
Forward pass: Y_local = X_local @ W_local, then AllReduce(Sum) to combine.
§This is the SPMD form
It reduces via a Communicator, so it describes one rank’s half of the
work. Fuel ships no multi-process Communicator (see crate::comm), so
with the only in-tree impl — IdentityComm, world_size == 1 — the
all-reduce is an identity and the result is the single rank’s own product.
That is correct for one rank and is not a multi-device reduction.
For one process driving N devices, hold all N partials and fold them with
DeviceGroup::all_reduce,
which is a real cross-device collective.
Implementations§
Source§impl<C: Communicator> RowParallel<C>
impl<C: Communicator> RowParallel<C>
Auto Trait Implementations§
impl<C> Freeze for RowParallel<C>where
C: Freeze,
impl<C> RefUnwindSafe for RowParallel<C>where
C: RefUnwindSafe,
impl<C> Send for RowParallel<C>
impl<C> Sync for RowParallel<C>where
C: Sync,
impl<C> Unpin for RowParallel<C>where
C: Unpin,
impl<C> UnsafeUnpin for RowParallel<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for RowParallel<C>where
C: UnwindSafe,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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