pub struct LocalTensorLayout<P = TensorPlacement> { /* private fields */ }Expand description
Rank-local shape and placement for one planned physical tensor.
Implementations§
Source§impl<P> LocalTensorLayout<P>
impl<P> LocalTensorLayout<P>
Sourcepub fn new(
logical_name: impl Into<String>,
role: ParameterRole,
global_shape: Vec<usize>,
local_shape: Vec<usize>,
placement: P,
logical_units: Option<usize>,
logical_range: Option<Range<usize>>,
fell_back_to_replication: bool,
) -> Self
pub fn new( logical_name: impl Into<String>, role: ParameterRole, global_shape: Vec<usize>, local_shape: Vec<usize>, placement: P, logical_units: Option<usize>, logical_range: Option<Range<usize>>, fell_back_to_replication: bool, ) -> Self
Creates one validated-planner output entry.
Sourcepub fn logical_name(&self) -> &str
pub fn logical_name(&self) -> &str
Returns the logical parameter group name.
Sourcepub const fn role(&self) -> ParameterRole
pub const fn role(&self) -> ParameterRole
Returns the semantic parameter role.
Sourcepub fn global_shape(&self) -> &[usize]
pub fn global_shape(&self) -> &[usize]
Returns the checkpoint-global shape.
Sourcepub fn local_shape(&self) -> &[usize]
pub fn local_shape(&self) -> &[usize]
Returns the shape materialized on this rank.
Sourcepub fn additional_placements(&self) -> &[TensorPlacement]
pub fn additional_placements(&self) -> &[TensorPlacement]
Returns independent checkpoint-global selections applied before the primary placement.
This is used when distinct parallel axes own distinct tensor axes, such as EP selection of packed experts followed by TP selection of each expert matrix. Empty means the primary placement is complete.
Sourcepub fn with_additional_placement(self, placement: TensorPlacement) -> Self
pub fn with_additional_placement(self, placement: TensorPlacement) -> Self
Adds one exact checkpoint-global selection preceding the primary placement.
Sourcepub fn logical_range(&self) -> Option<&Range<usize>>
pub fn logical_range(&self) -> Option<&Range<usize>>
Returns the rank-local range in the parameter group’s semantic domain.
Sourcepub const fn logical_units(&self) -> Option<usize>
pub const fn logical_units(&self) -> Option<usize>
Returns the size of the complete semantic partition domain.
Sourcepub const fn fell_back_to_replication(&self) -> bool
pub const fn fell_back_to_replication(&self) -> bool
Returns whether permissive planning replicated an unsupported shard.
Trait Implementations§
Source§impl<P: Clone> Clone for LocalTensorLayout<P>
impl<P: Clone> Clone for LocalTensorLayout<P>
Source§fn clone(&self) -> LocalTensorLayout<P>
fn clone(&self) -> LocalTensorLayout<P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more