pub struct MemoryPlanOptions {
pub allocate_params: bool,
pub allocate_inputs: bool,
pub allocate_constants: bool,
}Expand description
Assign buffers using a greedy best-fit algorithm.
Sorts buffers by size (largest first), then for each buffer finds the smallest free gap in the arena during its live interval. This is a simplified version of XLA’s GlobalDecreasingSizeBestFitHeap. Controls which graph boundaries receive arena slots during planning.
Inference graphs use Self::inference (all boundaries allocated).
Backward graphs in a training pair use Self::backward_activations_only:
parameters borrow offsets from the forward plan via SharedWeightLayout
so weights are not stored twice in the activation arena.
Fields§
§allocate_params: bool§allocate_inputs: bool§allocate_constants: boolImplementations§
Source§impl MemoryPlanOptions
impl MemoryPlanOptions
pub fn inference() -> Self
Sourcepub fn backward_activations_only() -> Self
pub fn backward_activations_only() -> Self
Activations + inputs/constants only; params bound via SharedWeightLayout.
Trait Implementations§
Source§impl Clone for MemoryPlanOptions
impl Clone for MemoryPlanOptions
Source§fn clone(&self) -> MemoryPlanOptions
fn clone(&self) -> MemoryPlanOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MemoryPlanOptions
impl Debug for MemoryPlanOptions
Source§impl Default for MemoryPlanOptions
impl Default for MemoryPlanOptions
Source§impl PartialEq for MemoryPlanOptions
impl PartialEq for MemoryPlanOptions
Source§fn eq(&self, other: &MemoryPlanOptions) -> bool
fn eq(&self, other: &MemoryPlanOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for MemoryPlanOptions
impl Eq for MemoryPlanOptions
impl StructuralPartialEq for MemoryPlanOptions
Auto Trait Implementations§
impl Freeze for MemoryPlanOptions
impl RefUnwindSafe for MemoryPlanOptions
impl Send for MemoryPlanOptions
impl Sync for MemoryPlanOptions
impl Unpin for MemoryPlanOptions
impl UnsafeUnpin for MemoryPlanOptions
impl UnwindSafe for MemoryPlanOptions
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