Skip to main content

ArchitecturePartition

Struct ArchitecturePartition 

Source
pub struct ArchitecturePartition<G, A> { /* private fields */ }
Expand description

Complete backend-neutral realization of one rank’s architecture ownership.

G is family-owned local construction geometry. A is the family-owned primary and auxiliary wire schema carried by the partition realization.

Implementations§

Source§

impl<G, A> ArchitecturePartition<G, A>

Source

pub fn from_architecture<B, S, M, N>( architecture: &M, group_ranges: impl IntoIterator<Item = (N, Range<usize>)>, ownership: PartitionOwnership, local_geometry: G, boundary_schema: A, parameters: &ArchitectureParameterDescription, ) -> Result<Self, ArchitecturePartitionError>

Creates a partition from the topology declared by one concrete neutral architecture.

This is the only public constructor: it derives the graph and unit layout from architecture, preventing a backend realization from publishing a parallel topology that merely resembles, but is not the canonical topology of, the architecture it will execute.

Source

pub const fn graph(&self) -> &ExecutionGraph

Returns the canonical architecture execution graph.

Source

pub const fn unit_layout(&self) -> &ExecutionUnitLayout

Returns the canonical complete execution-unit layout.

Source

pub fn groups(&self) -> &[PartitionGroup]

Returns groups and group-local global unit ranges owned by this rank.

Source

pub fn units(&self) -> impl Iterator<Item = ExecutionUnitAddress> + '_

Traverses rank-owned execution units in canonical architecture order.

Source

pub fn owns_unit(&self, group: &str, global_unit: usize) -> bool

Returns whether this rank owns one group-local global unit.

Source

pub const fn ownership(&self) -> &PartitionOwnership

Returns input, output, and static-module ownership.

Source

pub const fn state(&self) -> Option<&PartitionState>

Returns rank-local state geometry when this partition owns mutable state.

Source

pub fn prompt_cache_identity<B, M>( &self, architecture: &M, topology: PromptCacheTopology, ) -> Result<PromptCacheModelIdentity, ArchitecturePartitionError>

Derives prompt-cache identity from this partition’s canonical state.

Source

pub fn resolve_state_partition( &self, complete: &StateLayout, plan: &ArchitectureStatePartitionPlan, ) -> Result<Option<PartitionState>, ArchitectureStatePartitionError>

Resolves the architecture-authored state plan for this realized partition.

The current partition representation stores one contiguous global state interval. A valid plan may describe multiple semantic ranges, but the ranges selected by any one partition must be adjacent.

Source

pub const fn local_geometry(&self) -> &G

Returns family-owned rank-local construction geometry.

Source

pub const fn boundary_schema(&self) -> &A

Returns the family-owned primary and auxiliary boundary schema.

Source

pub fn boundary_schema_mut(&mut self) -> &mut A

Mutably returns the family-owned primary and auxiliary boundary schema.

Source

pub fn parameter_bindings(&self) -> &[OwnedParameterGroupSpec]

Returns neutral semantic parameter bindings owned by this rank.

Source

pub fn parameter_bindings_for_owner<'a>( &'a self, owner: &'a ParameterGroupOwner, ) -> impl Iterator<Item = &'a ParameterGroupSpec> + 'a

Returns the exact neutral groups assigned to one architecture owner.

Source

pub fn validate_architecture<B, S, M>( &self, architecture: &M, ) -> Result<(), ArchitecturePartitionError>

Proves that this partition still describes the supplied concrete neutral architecture.

Loaders may use this when a partition crosses a backend boundary or is restored from a prepared plan. Both dependency edges and exact unit counts are compared; matching group names alone are insufficient.

Trait Implementations§

Source§

impl<G: Clone, A: Clone> Clone for ArchitecturePartition<G, A>

Source§

fn clone(&self) -> ArchitecturePartition<G, A>

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<G: Debug, A: Debug> Debug for ArchitecturePartition<G, A>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<G, A> Freeze for ArchitecturePartition<G, A>
where G: Freeze, A: Freeze,

§

impl<G, A> RefUnwindSafe for ArchitecturePartition<G, A>

§

impl<G, A> Send for ArchitecturePartition<G, A>
where G: Send, A: Send,

§

impl<G, A> Sync for ArchitecturePartition<G, A>
where G: Sync, A: Sync,

§

impl<G, A> Unpin for ArchitecturePartition<G, A>
where G: Unpin, A: Unpin,

§

impl<G, A> UnsafeUnpin for ArchitecturePartition<G, A>
where G: UnsafeUnpin, A: UnsafeUnpin,

§

impl<G, A> UnwindSafe for ArchitecturePartition<G, A>
where G: UnwindSafe, A: 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.