Skip to main content

SpeculativeRequestTable

Struct SpeculativeRequestTable 

Source
pub struct SpeculativeRequestTable<'cache, E, S, C, P>{ /* private fields */ }
Expand description

Canonical table and action coordinator for speculative requests.

Implementations§

Source§

impl<'cache, E, S, C, P> SpeculativeRequestTable<'cache, E, S, C, P>

Source

pub fn new( options: SpeculativeSchedulerOptions, topology: SpeculativeExecutionTopology, ) -> Result<Self, GenerationError>

Creates an empty validated request table.

Source

pub fn request( &self, id: SpeculativeRequestId, ) -> Option<&SpeculativeRequest<'cache, E, S, C, P>>

Returns one request by stable identity.

Source

pub fn status( &self, id: SpeculativeRequestId, ) -> Option<SpeculativeRequestStatus>

Returns one request’s current status.

Source

pub fn is_finished(&self) -> bool

Whether every request is terminal.

Source

pub const fn options(&self) -> SpeculativeSchedulerOptions

Validated scheduler options.

Source

pub fn submit<'context>( &mut self, executor: &mut E, cache: &'cache mut E::Cache, input: E::Input, config: SpeculativeConfig, runtime: SpeculativeOutputRuntime<S, C, P>, randomness: SpeculativeRandomness<S::RandomState, S::DraftRandomness>, component_timings_collected: bool, context: E::Context<'context>, ) -> Result<SpeculativeRequestId, SpeculativeDriverError<E::Error>>
where E: 'context, S: SpeculativeSampling<Logits = E::Logits, Error = E::Error, Context<'context> = E::Context<'context>> + 'context,

Prefills and inserts one request, or records its pre-existing terminal state.

Source

pub fn cancel( &mut self, id: SpeculativeRequestId, ) -> Result<(), SpeculativeDriverError<E::Error>>

Requests cancellation without releasing an exact in-flight transaction.

Source

pub fn step<'context>( &mut self, executor: &mut E, optimistic_execution_available: bool, context: E::Context<'context>, ) -> Result<bool, SpeculativeDriverError<E::Error>>
where E: 'context, S: SpeculativeSampling<Logits = E::Logits, Error = E::Error, Context<'context> = E::Context<'context>> + 'context,

Applies one fairly selected request action.

Source

pub fn run<'context>( &mut self, executor: &mut E, optimistic_execution_available: bool, context: E::Context<'context>, ) -> Result<(), SpeculativeDriverError<E::Error>>
where E: 'context, S: SpeculativeSampling<Logits = E::Logits, Error = E::Error, Context<'context> = E::Context<'context>> + 'context,

Drives every request to a terminal state.

Source

pub fn finish( self, ) -> Result<CompletedSpeculativeSchedule<S>, SpeculativeDriverError<E::Error>>

Consumes a terminal table and returns outputs in stable submission order.

Auto Trait Implementations§

§

impl<'cache, E, S, C, P> !RefUnwindSafe for SpeculativeRequestTable<'cache, E, S, C, P>

§

impl<'cache, E, S, C, P> !UnwindSafe for SpeculativeRequestTable<'cache, E, S, C, P>

§

impl<'cache, E, S, C, P> Freeze for SpeculativeRequestTable<'cache, E, S, C, P>
where Vec<SpeculativeRequest<'cache, E, S, C, P>>: Freeze,

§

impl<'cache, E, S, C, P> Send for SpeculativeRequestTable<'cache, E, S, C, P>
where Vec<SpeculativeRequest<'cache, E, S, C, P>>: Send,

§

impl<'cache, E, S, C, P> Sync for SpeculativeRequestTable<'cache, E, S, C, P>
where Vec<SpeculativeRequest<'cache, E, S, C, P>>: Sync,

§

impl<'cache, E, S, C, P> Unpin for SpeculativeRequestTable<'cache, E, S, C, P>
where Vec<SpeculativeRequest<'cache, E, S, C, P>>: Unpin,

§

impl<'cache, E, S, C, P> UnsafeUnpin for SpeculativeRequestTable<'cache, E, S, C, P>
where Vec<SpeculativeRequest<'cache, E, S, C, P>>: UnsafeUnpin,

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.