pub struct LargeModelConfig {
pub enable_gradient_checkpointing: bool,
pub enable_model_parallelism: bool,
pub enable_parameter_offloading: bool,
pub enable_mixed_precision: bool,
pub max_memory_per_device_mb: usize,
pub checkpoint_granularity: usize,
pub num_devices: usize,
pub enable_dynamic_memory: bool,
pub enable_tensor_fusion: bool,
}Expand description
Configuration for large model optimization
Fields§
§enable_gradient_checkpointing: boolEnable gradient checkpointing to save memory
enable_model_parallelism: boolEnable model parallelism across devices
enable_parameter_offloading: boolEnable parameter offloading to CPU memory
enable_mixed_precision: boolEnable mixed precision training
max_memory_per_device_mb: usizeMaximum memory usage per device (MB)
checkpoint_granularity: usizeCheckpoint granularity (number of layers between checkpoints)
num_devices: usizeNumber of devices for model parallelism
enable_dynamic_memory: boolEnable dynamic memory management
enable_tensor_fusion: boolEnable tensor fusion for large operations
Trait Implementations§
Source§impl Clone for LargeModelConfig
impl Clone for LargeModelConfig
Source§fn clone(&self) -> LargeModelConfig
fn clone(&self) -> LargeModelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LargeModelConfig
impl Debug for LargeModelConfig
Auto Trait Implementations§
impl Freeze for LargeModelConfig
impl RefUnwindSafe for LargeModelConfig
impl Send for LargeModelConfig
impl Sync for LargeModelConfig
impl Unpin for LargeModelConfig
impl UnsafeUnpin for LargeModelConfig
impl UnwindSafe for LargeModelConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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