pub struct ModelParallel { /* private fields */ }Expand description
Model parallel training
Splits the model across multiple GPUs. Different layers run on different devices.
Implementations§
Source§impl ModelParallel
impl ModelParallel
pub fn new(config: DistributedConfig) -> Self
Sourcepub fn place_layer(&mut self, layer_name: &str, device_id: usize)
pub fn place_layer(&mut self, layer_name: &str, device_id: usize)
Assign a layer to a specific device
Sourcepub fn get_device(&self, layer_name: &str) -> Option<usize>
pub fn get_device(&self, layer_name: &str) -> Option<usize>
Get device for a layer
Sourcepub fn auto_place_layers(&mut self, layer_names: &[String], num_devices: usize)
pub fn auto_place_layers(&mut self, layer_names: &[String], num_devices: usize)
Automatic layer placement using a simple strategy
Auto Trait Implementations§
impl Freeze for ModelParallel
impl RefUnwindSafe for ModelParallel
impl Send for ModelParallel
impl Sync for ModelParallel
impl Unpin for ModelParallel
impl UnwindSafe for ModelParallel
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