pub struct ExecutionStrategy {
pub mode: ExecutionMode,
pub gradient: GradientStrategy,
pub precision: PrecisionMode,
pub memory: MemoryStrategy,
pub parallelism: ParallelismStrategy,
pub enable_fusion: bool,
pub enable_profiling: bool,
}Expand description
Complete execution strategy configuration
Fields§
§mode: ExecutionMode§gradient: GradientStrategy§precision: PrecisionMode§memory: MemoryStrategy§parallelism: ParallelismStrategy§enable_fusion: bool§enable_profiling: boolImplementations§
Source§impl ExecutionStrategy
impl ExecutionStrategy
Sourcepub fn memory_efficient() -> Self
pub fn memory_efficient() -> Self
Memory-efficient strategy for large models
Sourcepub fn high_throughput() -> Self
pub fn high_throughput() -> Self
High-throughput strategy for batch processing
pub fn with_mode(self, mode: ExecutionMode) -> Self
pub fn with_gradient(self, gradient: GradientStrategy) -> Self
pub fn with_precision(self, precision: PrecisionMode) -> Self
pub fn with_memory(self, memory: MemoryStrategy) -> Self
pub fn with_parallelism(self, parallelism: ParallelismStrategy) -> Self
pub fn enable_fusion(self) -> Self
pub fn enable_profiling(self) -> Self
Sourcepub fn computes_gradients(&self) -> bool
pub fn computes_gradients(&self) -> bool
Check if gradient computation is enabled
Sourcepub fn uses_checkpointing(&self) -> bool
pub fn uses_checkpointing(&self) -> bool
Check if strategy uses checkpointing
Sourcepub fn is_inference_mode(&self) -> bool
pub fn is_inference_mode(&self) -> bool
Check if strategy is optimized for inference
Sourcepub fn checkpoint_interval(&self) -> Option<usize>
pub fn checkpoint_interval(&self) -> Option<usize>
Get checkpoint interval if using checkpointing
Sourcepub fn accumulation_steps(&self) -> Option<usize>
pub fn accumulation_steps(&self) -> Option<usize>
Get gradient accumulation steps if using accumulation
Sourcepub fn num_workers(&self) -> usize
pub fn num_workers(&self) -> usize
Get number of parallel workers
Trait Implementations§
Source§impl Clone for ExecutionStrategy
impl Clone for ExecutionStrategy
Source§fn clone(&self) -> ExecutionStrategy
fn clone(&self) -> ExecutionStrategy
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 ExecutionStrategy
impl Debug for ExecutionStrategy
Auto Trait Implementations§
impl Freeze for ExecutionStrategy
impl RefUnwindSafe for ExecutionStrategy
impl Send for ExecutionStrategy
impl Sync for ExecutionStrategy
impl Unpin for ExecutionStrategy
impl UnwindSafe for ExecutionStrategy
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