Skip to main content

LocalTensorLayout

Struct LocalTensorLayout 

Source
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>

Source

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.

Source

pub fn logical_name(&self) -> &str

Returns the logical parameter group name.

Source

pub const fn role(&self) -> ParameterRole

Returns the semantic parameter role.

Source

pub fn global_shape(&self) -> &[usize]

Returns the checkpoint-global shape.

Source

pub fn local_shape(&self) -> &[usize]

Returns the shape materialized on this rank.

Source

pub const fn placement(&self) -> &P

Returns the backend-realized placement.

Source

pub fn logical_range(&self) -> Option<&Range<usize>>

Returns the rank-local range in the parameter group’s semantic domain.

Source

pub const fn logical_units(&self) -> Option<usize>

Returns the size of the complete semantic partition domain.

Source

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>

Source§

fn clone(&self) -> LocalTensorLayout<P>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug> Debug for LocalTensorLayout<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: Eq> Eq for LocalTensorLayout<P>

Source§

impl<P: PartialEq> PartialEq for LocalTensorLayout<P>

Source§

fn eq(&self, other: &LocalTensorLayout<P>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<P: PartialEq> StructuralPartialEq for LocalTensorLayout<P>

Auto Trait Implementations§

§

impl<P> Freeze for LocalTensorLayout<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for LocalTensorLayout<P>
where P: RefUnwindSafe,

§

impl<P> Send for LocalTensorLayout<P>
where P: Send,

§

impl<P> Sync for LocalTensorLayout<P>
where P: Sync,

§

impl<P> Unpin for LocalTensorLayout<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for LocalTensorLayout<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for LocalTensorLayout<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.