Skip to main content

LayeredPartitionDriver

Struct LayeredPartitionDriver 

Source
pub struct LayeredPartitionDriver { /* private fields */ }
Expand description

Validated execution metadata for one rank-local layered partition.

This driver is the single owner of partition input/output checks, canonical storage and state ranges, execution-group setup/completion, and final output projection. Concrete backends retain only state storage and unit residency.

Implementations§

Source§

impl LayeredPartitionDriver

Source

pub fn new<G, A>( partition: &ArchitecturePartition<G, A>, group_index: usize, storage_range: Range<usize>, ) -> Result<Self, LayeredPartitionError>

Validates a canonical partition against its concrete unit storage.

Source

pub fn new_with_state_ownership<G, A>( partition: &ArchitecturePartition<G, A>, group_index: usize, storage_range: Range<usize>, group_owns_state: bool, ) -> Result<Self, LayeredPartitionError>

Validates a partition while explicitly declaring whether this group owns state slots.

Architecture selection must pass false for parameter-only composite roots. A rank can still own decoder state for another local group without falsely comparing that state range with this group’s unrelated unit indices.

Source

pub fn range(&self) -> Range<usize>

Returns the canonical group-local global unit range.

Source

pub const fn group_index(&self) -> usize

Returns the canonical architecture execution-group slot.

Source

pub fn state_layout(&self) -> &StateLayout

Returns state geometry for a driver created through the strict stateful constructor.

Source

pub const fn optional_state_layout(&self) -> Option<&StateLayout>

Returns rank-local state geometry, or None for stateless roots and ranks.

Source

pub const fn owns_input(&self) -> bool

Returns whether this partition receives request ingress directly.

Source

pub const fn owns_output(&self) -> bool

Returns whether this partition owns architecture output projection.

Source

pub fn input<'a, T, A>( &self, input: LayeredPartitionInput<'a, T, A>, ) -> Result<LayeredPartitionInput<'a, T, A>, LayeredPartitionError>

Validates input form against architecture boundary ownership.

Source

pub fn exchange_boundary<B>( &self, value: B::Tensor, group: &B::Group, executor: &B::Executor, ) -> Result<B::Tensor, B::CollectiveError>

Transports this partition’s realized boundary through the selected opaque collective group.

Keeping the operation on the validated driver makes boundary movement part of partition execution rather than an unrelated backend call.

Source

pub fn begin<'a, B, S, M>( &self, architecture: &mut M, input: LayeredPartitionInput<'a, B::Tensor, <M::Boundary as ArchitectureBoundary>::Boundary<B::Tensor>>, mask: Option<&B::Tensor>, state: &mut S, parallel: Option<&B::ParallelContext>, context: &<B::Tensor as Tensor>::Context, ) -> Result<LayeredForwardState<B::Tensor, M::ForwardContext>, LayeredPartitionBeginError<M::Error>>

Prepares the partition and starts its canonical execution group.

Source

pub fn finish<B, S, M>( &self, architecture: &mut M, hidden: &B::Tensor, state: &mut S, forward: &mut M::ForwardContext, parallel: Option<&B::ParallelContext>, context: &<B::Tensor as Tensor>::Context, ) -> Result<LayeredPartitionOutput<B::Tensor, <M::Boundary as ArchitectureBoundary>::Boundary<B::Tensor>>, M::Error>

Completes the canonical group and applies output projection only on its owner.

Trait Implementations§

Source§

impl Clone for LayeredPartitionDriver

Source§

fn clone(&self) -> LayeredPartitionDriver

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 Debug for LayeredPartitionDriver

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, !>

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.