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>
impl<A, B, S> ResidentRuntime<A, B, S>
Sourcepub fn new(
architecture: A,
context: &<B::Tensor as Tensor>::Context,
) -> Result<Self, A::Error>
pub fn new( architecture: A, context: &<B::Tensor as Tensor>::Context, ) -> Result<Self, A::Error>
Builds every execution unit once and keeps it resident.
Sourcepub fn forward<'a>(
&mut self,
input: A::Input<'a>,
state: &mut S,
context: &<B::Tensor as Tensor>::Context,
) -> Result<B::Tensor, A::Error>
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.
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub const fn architecture(&self) -> &A
pub const fn architecture(&self) -> &A
Borrows the architecture and its pinned parameter topology.
Sourcepub fn architecture_mut(&mut self) -> &mut A
pub fn architecture_mut(&mut self) -> &mut A
Mutably borrows the architecture.
Sourcepub fn units(&self) -> &[Vec<A::Unit>]
pub fn units(&self) -> &[Vec<A::Unit>]
Borrows resident execution units for loading or inspection.
Sourcepub fn units_mut(&mut self) -> &mut [Vec<A::Unit>]
pub fn units_mut(&mut self) -> &mut [Vec<A::Unit>]
Mutably borrows resident execution units for parameter binding.
Sourcepub fn into_parts(self) -> (A, Vec<A::Unit>)
pub fn into_parts(self) -> (A, Vec<A::Unit>)
Decomposes the runtime without cloning backend-native values.