Skip to main content

ObservedExpertProvider

Struct ObservedExpertProvider 

Source
pub struct ObservedExpertProvider<'a, P, O: ?Sized, E> { /* private fields */ }
Expand description

Decorates a routed provider with normalized routing observation.

The decorator sees the exact request and output of canonical provider execution. It therefore adds observation without reimplementing a model family’s block, routing, shape, or residency lifecycle. Tensor-parallel requests are delegated without an event because their provider result may still require an architecture-owned reduction before it is observable.

Implementations§

Source§

impl<'a, P, O: ?Sized, E> ObservedExpertProvider<'a, P, O, E>

Source

pub fn new( provider: &'a mut P, observer: &'a mut O, point: RoutedObservationPoint, ) -> Self

Wraps provider for one canonical routed module invocation.

Trait Implementations§

Source§

impl<B, P, O, E> RoutedExpertProvider<B> for ObservedExpertProvider<'_, P, O, E>

Source§

type Error = ObservedExpertProviderError<<P as RoutedExpertProvider<B>>::Error, E>

Provider-specific acquisition or execution failure.
Source§

fn routing_control( &mut self, token_rows: u64, ) -> Result<Option<GroupSelectionControl>, Self::Error>

Optional pre-dispatch control supplied by an instrumented provider adapter.
Source§

fn routing_applied( &mut self, original: Option<RoutingDecision<'_, B::Tensor>>, effective: RoutingDecision<'_, B::Tensor>, ) -> Result<(), Self::Error>

Consumes bounded decision evidence before dispatch. Shared experts are not included.
Source§

fn routing_failed(&mut self, message: &str)

Attributes selector failure without claiming cache rollback.
Source§

fn forward_grouped( &mut self, resident_bank: &mut B::GatedProductGroups, request: RoutedExpertRequest<'_, B::Tensor>, context: &<B::Tensor as Tensor>::Context, ) -> Result<B::Tensor, Self::Error>

Executes one typed route batch while retaining its acquired resources.
Source§

fn forward_relu2_routed( &mut self, resident_bank: &mut B::Relu2Groups, request: RoutedExpertRequest<'_, B::Tensor>, context: &<B::Tensor as Tensor>::Context, ) -> Result<B::Tensor, Self::Error>

Executes one ReLU-squared route batch through the same residency boundary.
Source§

fn forward_compact_grouped( &mut self, resident_bank: &mut B::GatedProductGroups, request: RoutedExpertRequest<'_, B::Tensor>, context: &<B::Tensor as Tensor>::Context, ) -> Result<B::Tensor, Self::Error>

Executes destination-local rows that were already expanded to one owner-local expert per row by the neutral expert exchange. Read more
Source§

impl<B, P, O, E> TensorParallelRoutedExpertProvider<B> for ObservedExpertProvider<'_, P, O, E>

Source§

fn forward_grouped_tensor_parallel( &mut self, resident_bank: &mut B::GatedProductGroups, request: RoutedExpertRequest<'_, B::Tensor>, partitions: usize, context: &<B::Tensor as Tensor>::Context, ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>

Executes a rank-local gated-product contribution.
Source§

fn forward_relu2_routed_tensor_parallel( &mut self, resident_bank: &mut B::Relu2Groups, request: RoutedExpertRequest<'_, B::Tensor>, partitions: usize, context: &<B::Tensor as Tensor>::Context, ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>

Executes a rank-local ReLU-squared contribution.
Source§

fn forward_compact_grouped_tensor_parallel( &mut self, resident_bank: &mut B::GatedProductGroups, request: RoutedExpertRequest<'_, B::Tensor>, partitions: usize, context: &<B::Tensor as Tensor>::Context, ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>

Executes destination-local, one-expert-per-row contributions while preserving the backend’s TP reduction and post-bias structure.

Auto Trait Implementations§

§

impl<'a, P, O, E> !UnwindSafe for ObservedExpertProvider<'a, P, O, E>

§

impl<'a, P, O, E> Freeze for ObservedExpertProvider<'a, P, O, E>

§

impl<'a, P, O, E> RefUnwindSafe for ObservedExpertProvider<'a, P, O, E>

§

impl<'a, P, O, E> Send for ObservedExpertProvider<'a, P, O, E>
where &'a mut P: Send, &'a mut O: Send, PhantomData<fn() -> E>: Send, O: ?Sized,

§

impl<'a, P, O, E> Sync for ObservedExpertProvider<'a, P, O, E>
where &'a mut P: Sync, &'a mut O: Sync, PhantomData<fn() -> E>: Sync, O: ?Sized,

§

impl<'a, P, O, E> Unpin for ObservedExpertProvider<'a, P, O, E>

§

impl<'a, P, O, E> UnsafeUnpin for ObservedExpertProvider<'a, P, O, E>

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