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
impl LayeredPartitionDriver
Sourcepub fn new<G, A>(
partition: &ArchitecturePartition<G, A>,
group_index: usize,
storage_range: Range<usize>,
) -> Result<Self, LayeredPartitionError>
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.
Sourcepub const fn group_index(&self) -> usize
pub const fn group_index(&self) -> usize
Returns the canonical architecture execution-group slot.
Sourcepub const fn state_layout(&self) -> &StateLayout
pub const fn state_layout(&self) -> &StateLayout
Returns the architecture-global state layout for this partition.
Sourcepub fn input<'a, T, A>(
&self,
input: LayeredPartitionInput<'a, T, A>,
) -> Result<LayeredPartitionInput<'a, T, A>, LayeredPartitionError>
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.
Sourcepub fn exchange_boundary<B>(
&self,
value: B::Tensor,
group: &B::Group,
executor: &B::Executor,
) -> Result<B::Tensor, B::CollectiveError>where
B: CollectiveBackend,
pub fn exchange_boundary<B>(
&self,
value: B::Tensor,
group: &B::Group,
executor: &B::Executor,
) -> Result<B::Tensor, B::CollectiveError>where
B: CollectiveBackend,
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.
Sourcepub 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>, M::Error>
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>, M::Error>
Prepares the partition and starts its canonical execution group.
Sourcepub 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>
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
impl Clone for LayeredPartitionDriver
Source§fn clone(&self) -> LayeredPartitionDriver
fn clone(&self) -> LayeredPartitionDriver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more