pub struct MultiGpuSync<A: Float + GpuDataType> { /* private fields */ }
Expand description
Multi-GPU synchronization manager
Implementations§
Source§impl<A: Float + GpuDataType + Send + Sync> MultiGpuSync<A>
impl<A: Float + GpuDataType + Send + Sync> MultiGpuSync<A>
Sourcepub fn new(
context: Arc<GpuContext>,
config: MultiGpuConfig,
max_param_size: usize,
) -> Result<Self, GpuOptimError>
pub fn new( context: Arc<GpuContext>, config: MultiGpuConfig, max_param_size: usize, ) -> Result<Self, GpuOptimError>
Create a new multi-GPU synchronization manager
Sourcepub fn sync_gradients<S, D>(
&mut self,
gradients: &mut ArrayBase<S, D>,
) -> Result<(), GpuOptimError>
pub fn sync_gradients<S, D>( &mut self, gradients: &mut ArrayBase<S, D>, ) -> Result<(), GpuOptimError>
Synchronize gradients across GPUs
Sourcepub fn get_performance_stats(&self) -> CommunicationPerformanceStats
pub fn get_performance_stats(&self) -> CommunicationPerformanceStats
Get communication performance statistics
Sourcepub fn synchronize_all(&mut self) -> Result<(), GpuOptimError>
pub fn synchronize_all(&mut self) -> Result<(), GpuOptimError>
Force synchronization of all pending operations
Sourcepub fn compress_gradients<S, D>(
&mut self,
gradients: &ArrayBase<S, D>,
) -> Result<(Vec<A>, Vec<i32>), GpuOptimError>
pub fn compress_gradients<S, D>( &mut self, gradients: &ArrayBase<S, D>, ) -> Result<(Vec<A>, Vec<i32>), GpuOptimError>
Compress gradients for bandwidth optimization
Auto Trait Implementations§
impl<A> Freeze for MultiGpuSync<A>
impl<A> !RefUnwindSafe for MultiGpuSync<A>
impl<A> Send for MultiGpuSync<A>
impl<A> Sync for MultiGpuSync<A>
impl<A> Unpin for MultiGpuSync<A>where
A: Unpin,
impl<A> !UnwindSafe for MultiGpuSync<A>
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