pub struct PipelineParallelCoordinator { /* private fields */ }Expand description
Pipeline parallelism coordinator.
Implementations§
Source§impl PipelineParallelCoordinator
impl PipelineParallelCoordinator
Sourcepub fn new(
config: DistributedConfig,
backend: Arc<RwLock<dyn CommunicationBackend>>,
num_stages: usize,
) -> Self
pub fn new( config: DistributedConfig, backend: Arc<RwLock<dyn CommunicationBackend>>, num_stages: usize, ) -> Self
Create a new pipeline parallel coordinator.
Sourcepub fn set_micro_batch_size(&mut self, size: usize)
pub fn set_micro_batch_size(&mut self, size: usize)
Set micro-batch size for pipeline parallelism.
Sourcepub fn stage_for_rank(&self, rank: usize) -> usize
pub fn stage_for_rank(&self, rank: usize) -> usize
Get the stage assignment for this rank.
Sourcepub fn send_activations(&self, stage: usize) -> Result<(), ExecutorError>
pub fn send_activations(&self, stage: usize) -> Result<(), ExecutorError>
Send activations to next stage.
Sourcepub fn recv_activations(&self, stage: usize) -> Result<(), ExecutorError>
pub fn recv_activations(&self, stage: usize) -> Result<(), ExecutorError>
Receive activations from previous stage.
Sourcepub fn send_gradients(&self, stage: usize) -> Result<(), ExecutorError>
pub fn send_gradients(&self, stage: usize) -> Result<(), ExecutorError>
Send gradients to previous stage.
Sourcepub fn recv_gradients(&self, stage: usize) -> Result<(), ExecutorError>
pub fn recv_gradients(&self, stage: usize) -> Result<(), ExecutorError>
Receive gradients from next stage.
Sourcepub fn num_stages(&self) -> usize
pub fn num_stages(&self) -> usize
Get the number of stages in the pipeline.
Sourcepub fn micro_batch_size(&self) -> usize
pub fn micro_batch_size(&self) -> usize
Get the micro-batch size.
Sourcepub fn config(&self) -> &DistributedConfig
pub fn config(&self) -> &DistributedConfig
Get the configuration.
Auto Trait Implementations§
impl Freeze for PipelineParallelCoordinator
impl RefUnwindSafe for PipelineParallelCoordinator
impl Send for PipelineParallelCoordinator
impl Sync for PipelineParallelCoordinator
impl Unpin for PipelineParallelCoordinator
impl UnwindSafe for PipelineParallelCoordinator
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