pub struct DataParallelCoordinator { /* private fields */ }Expand description
Data parallelism coordinator.
Implementations§
Source§impl DataParallelCoordinator
impl DataParallelCoordinator
Sourcepub fn new(
config: DistributedConfig,
backend: Arc<RwLock<dyn CommunicationBackend>>,
) -> Self
pub fn new( config: DistributedConfig, backend: Arc<RwLock<dyn CommunicationBackend>>, ) -> Self
Create a new data parallel coordinator.
Sourcepub fn distribute_batch(&self, batch_size: usize) -> Vec<(usize, usize)>
pub fn distribute_batch(&self, batch_size: usize) -> Vec<(usize, usize)>
Distribute batch across devices.
Sourcepub fn synchronize_gradients(&self) -> Result<(), ExecutorError>
pub fn synchronize_gradients(&self) -> Result<(), ExecutorError>
Synchronize gradients across devices.
Auto Trait Implementations§
impl Freeze for DataParallelCoordinator
impl RefUnwindSafe for DataParallelCoordinator
impl Send for DataParallelCoordinator
impl Sync for DataParallelCoordinator
impl Unpin for DataParallelCoordinator
impl UnwindSafe for DataParallelCoordinator
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