pub struct PlacementPlan { /* private fields */ }Expand description
Exact logical checkpoint placement for one rank.
Implementations§
Source§impl PlacementPlan
impl PlacementPlan
Sourcepub const fn new(rank: PlacementRank) -> Self
pub const fn new(rank: PlacementRank) -> Self
Creates a strict plan in which every checkpoint source must be named.
Sourcepub fn replicated(rank: PlacementRank) -> Self
pub fn replicated(rank: PlacementRank) -> Self
Creates a plan that replicates every checkpoint source.
Sourcepub const fn rank(&self) -> PlacementRank
pub const fn rank(&self) -> PlacementRank
Returns the selected logical rank.
Sourcepub fn with_default(self, placement: TensorPlacement) -> Self
pub fn with_default(self, placement: TensorPlacement) -> Self
Sets the placement for otherwise unnamed checkpoint sources.
Sourcepub fn insert(&mut self, source: impl Into<String>, placement: TensorPlacement)
pub fn insert(&mut self, source: impl Into<String>, placement: TensorPlacement)
Adds or replaces one exact source placement.
Sourcepub fn insert_expected(
&mut self,
source: impl Into<String>,
expected_source_shape: impl Into<Vec<usize>>,
placement: TensorPlacement,
) -> Result<(), PlacementPlanError>
pub fn insert_expected( &mut self, source: impl Into<String>, expected_source_shape: impl Into<Vec<usize>>, placement: TensorPlacement, ) -> Result<(), PlacementPlanError>
Adds one source placement with an exact pre-selection shape.
Sourcepub fn insert_quantized_companions(
&mut self,
prefix: &str,
placement: TensorPlacement,
has_biases: bool,
)
pub fn insert_quantized_companions( &mut self, prefix: &str, placement: TensorPlacement, has_biases: bool, )
Adds a packed weight and its scale and optional bias companions together.
Sourcepub fn placement(&self, source: &str) -> Option<&TensorPlacement>
pub fn placement(&self, source: &str) -> Option<&TensorPlacement>
Returns an explicit placement by exact source name.
Sourcepub fn validate(&self) -> Result<(), PlacementPlanError>
pub fn validate(&self) -> Result<(), PlacementPlanError>
Validates all geometry available before checkpoint access.
Sourcepub fn potentially_local(
&self,
source: &str,
) -> Result<bool, PlacementPlanError>
pub fn potentially_local( &self, source: &str, ) -> Result<bool, PlacementPlanError>
Returns whether a named source can require materialization on this rank.
Sourcepub fn resolve(
&self,
source: &str,
shape: &[usize],
) -> Result<ResolvedTensorPlacement, PlacementPlanError>
pub fn resolve( &self, source: &str, shape: &[usize], ) -> Result<ResolvedTensorPlacement, PlacementPlanError>
Resolves one named source against its admitted logical shape.
Sourcepub fn validate_loaded_sources(
&self,
loaded: &BTreeSet<String>,
unexpected: Vec<String>,
) -> Result<(), PlacementPlanError>
pub fn validate_loaded_sources( &self, loaded: &BTreeSet<String>, unexpected: Vec<String>, ) -> Result<(), PlacementPlanError>
Verifies exact locally required and unexpected source coverage.
Trait Implementations§
Source§impl Clone for PlacementPlan
impl Clone for PlacementPlan
Source§fn clone(&self) -> PlacementPlan
fn clone(&self) -> PlacementPlan
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 moreAuto Trait Implementations§
impl Freeze for PlacementPlan
impl RefUnwindSafe for PlacementPlan
impl Send for PlacementPlan
impl Sync for PlacementPlan
impl Unpin for PlacementPlan
impl UnsafeUnpin for PlacementPlan
impl UnwindSafe for PlacementPlan
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