Skip to main content

ResidentRuntime

Struct ResidentRuntime 

Source
pub struct ResidentRuntime<A, B, S>{ /* private fields */ }
Expand description

Fully resident runtime using the same lifecycle as bounded execution.

Implementations§

Source§

impl<A, B, S> ResidentRuntime<A, B, S>

Source

pub fn new( architecture: A, context: &<B::Tensor as Tensor>::Context, ) -> Result<Self, A::Error>

Builds every execution unit once and keeps it resident.

Source

pub fn forward<'a>( &mut self, input: A::Input<'a>, state: &mut S, context: &<B::Tensor as Tensor>::Context, ) -> Result<B::Tensor, A::Error>

Runs one complete prefill or decode pass without dynamic dispatch.

Source

pub fn forward_with_context<'a>( &mut self, input: A::Input<'a>, state: &mut S, context: &<B::Tensor as Tensor>::Context, ) -> Result<(B::Tensor, A::ForwardContext), A::Error>

Runs one complete pass and returns its architecture-owned context.

This is the resident counterpart of the bounded runtime’s context result and lets callers retain target captures without storing request-local tensors on the model object.

Source

pub fn forward_with_traversal_hook<'a, H>( &mut self, input: A::Input<'a>, state: &mut S, context: &<B::Tensor as Tensor>::Context, hook: &mut H, ) -> Result<(B::Tensor, A::ForwardContext), A::Error>

Runs one resident pass through a statically dispatched traversal hook.

Source

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

Borrows the architecture and its pinned parameter topology.

Source

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

Mutably borrows the architecture.

Source

pub fn units(&self) -> &[Vec<A::Unit>]

Borrows resident execution units for loading or inspection.

Source

pub fn units_mut(&mut self) -> &mut [Vec<A::Unit>]

Mutably borrows resident execution units for parameter binding.

Source

pub fn into_parts(self) -> (A, Vec<A::Unit>)

Decomposes the runtime without cloning backend-native values.

Auto Trait Implementations§

§

impl<A, B, S> Freeze for ResidentRuntime<A, B, S>
where A: Freeze, Vec<Vec<<A as LayeredArchitecture<B, S>>::Unit>>: Freeze, PhantomData<fn() -> (B, S)>: Freeze,

§

impl<A, B, S> RefUnwindSafe for ResidentRuntime<A, B, S>

§

impl<A, B, S> Send for ResidentRuntime<A, B, S>
where A: Send, Vec<Vec<<A as LayeredArchitecture<B, S>>::Unit>>: Send, PhantomData<fn() -> (B, S)>: Send,

§

impl<A, B, S> Sync for ResidentRuntime<A, B, S>
where A: Sync, Vec<Vec<<A as LayeredArchitecture<B, S>>::Unit>>: Sync, PhantomData<fn() -> (B, S)>: Sync,

§

impl<A, B, S> Unpin for ResidentRuntime<A, B, S>
where A: Unpin, Vec<Vec<<A as LayeredArchitecture<B, S>>::Unit>>: Unpin, PhantomData<fn() -> (B, S)>: Unpin,

§

impl<A, B, S> UnsafeUnpin for ResidentRuntime<A, B, S>

§

impl<A, B, S> UnwindSafe for ResidentRuntime<A, B, S>

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