pub struct PipelineParallel { /* private fields */ }Expand description
Pipeline parallelism
Splits model into stages and processes micro-batches in a pipeline.
Implementations§
Source§impl PipelineParallel
impl PipelineParallel
pub fn new(num_stages: usize, num_micro_batches: usize) -> Self
Sourcepub fn create_micro_batches(&self, batch: &Tensor) -> Vec<Tensor>
pub fn create_micro_batches(&self, batch: &Tensor) -> Vec<Tensor>
Split batch into micro-batches
Sourcepub fn current_stage(&self) -> usize
pub fn current_stage(&self) -> usize
Get current pipeline stage
Sourcepub fn next_stage(&mut self)
pub fn next_stage(&mut self)
Advance to next stage
Auto Trait Implementations§
impl Freeze for PipelineParallel
impl RefUnwindSafe for PipelineParallel
impl Send for PipelineParallel
impl Sync for PipelineParallel
impl Unpin for PipelineParallel
impl UnwindSafe for PipelineParallel
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> 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