pub struct MemoryOptimizationConfig {
pub enable_gradient_checkpointing: bool,
pub enable_memory_pooling: bool,
pub enable_in_place_operations: bool,
pub enable_tensor_reuse: bool,
pub enable_lifetime_optimization: bool,
pub checkpoint_memory_threshold: usize,
pub checkpoint_compute_threshold: f32,
pub pool_frequency_threshold: usize,
pub max_memory_usage: Option<usize>,
}Expand description
Configuration for memory optimization
Fields§
§enable_gradient_checkpointing: boolEnable gradient checkpointing
enable_memory_pooling: boolEnable memory pooling
enable_in_place_operations: boolEnable in-place operations
enable_tensor_reuse: boolEnable tensor reuse
enable_lifetime_optimization: boolEnable tensor lifetime optimization
checkpoint_memory_threshold: usizeMemory threshold for checkpointing (bytes)
checkpoint_compute_threshold: f32Compute threshold for checkpointing (relative cost)
pool_frequency_threshold: usizeFrequency threshold for creating memory pools
max_memory_usage: Option<usize>Maximum memory usage target (bytes)
Trait Implementations§
Source§impl Clone for MemoryOptimizationConfig
impl Clone for MemoryOptimizationConfig
Source§fn clone(&self) -> MemoryOptimizationConfig
fn clone(&self) -> MemoryOptimizationConfig
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 MemoryOptimizationConfig
impl Debug for MemoryOptimizationConfig
Auto Trait Implementations§
impl Freeze for MemoryOptimizationConfig
impl RefUnwindSafe for MemoryOptimizationConfig
impl Send for MemoryOptimizationConfig
impl Sync for MemoryOptimizationConfig
impl Unpin for MemoryOptimizationConfig
impl UnsafeUnpin for MemoryOptimizationConfig
impl UnwindSafe for MemoryOptimizationConfig
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