Skip to main content

Executor

Struct Executor 

Source
pub struct Executor<P: RuntimePrimitives> { /* private fields */ }

Implementations§

Source§

impl<P: RuntimePrimitives> Executor<P>

Source

pub fn new(prim: P, cfg: ExecutorConfig) -> Executor<P>

Source

pub fn primitives(&self) -> &P

Source

pub fn primitives_mut(&mut self) -> &mut P

Source

pub fn descriptor(&self) -> &RuntimeDescriptor

Source

pub fn lane_committed(&self, lane_tag: u64) -> Option<&[u32]>

Source

pub fn inject_fault(&mut self, lane_tag: u64, code: u32)

Source

pub fn cache_bytes(&self) -> u64

Pool bytes the prefix cache accounts for.

Source

pub fn cache_exported_tokens(&self) -> u64

Tokens of state the prefix cache holds out of the runtime’s pool.

Source

pub fn match_lengths(&self, span: &[u32]) -> Vec<u64>

Source

pub fn live_sequences(&self) -> u64

Sequences the runtime holds for this executor: lanes, bare sequences and the cache entries in its pool.

Source

pub fn last_logprobs(&self) -> Vec<LaneLogprob>

Source

pub fn compat_identity(&self) -> [u8; 32]

Trait Implementations§

Source§

impl<P: RuntimePrimitives> Engine for Executor<P>

Source§

fn tick<'a>( &'a mut self, plan: &TickPlan, arena: &RecordArena, rings: &mut dyn Rings, ) -> Result<&'a TickEvents, Status>

Source§

fn pump(&mut self)

Source§

fn state_spaces(&self) -> &[StateSpaceDesc]

Source§

fn strategy_register( &mut self, reg: &StrategyRegistration, ) -> Result<&StrategyGrant, Status>

Source§

fn space_match( &mut self, space_id: u32, span_tokens: &[u32], _media_deps: &[[u8; 32]], ) -> Result<&MatchResult, Status>

Source§

fn seed_acquire( &mut self, span_tokens: &[u32], prefix_len: u64, determinism_class: u8, ) -> Result<u64, Status>

Source§

fn seed_lease_ticks(&self) -> Option<u64>

Source§

fn seed_release(&mut self, seed_handle: u64) -> Result<(), Status>

Source§

fn seed_adopt( &mut self, seq: SeqHandle, span_tokens: &[u32], ) -> Result<u64, Status>

Source§

fn seq_fork( &mut self, parent: SeqHandle, flags: u32, ) -> Result<SeqHandle, Status>

Source§

fn lane_sequence(&self, lane_tag: u64) -> Option<SeqHandle>

Source§

fn create_sequence(&mut self) -> Result<SeqHandle, Status>

Source§

fn free_sequence(&mut self, seq: SeqHandle) -> Result<(), Status>

Source§

fn publish_sequence( &mut self, seq: SeqHandle, tokens: &[u32], ) -> Result<(), Status>

Source§

fn space_export_size( &mut self, seq: SeqHandle, space_id: u32, range: TokenRange, encoding: u8, ) -> Result<(u64, u64), Status>

Source§

fn space_snapshot( &mut self, seq: SeqHandle, space_id: u32, boundary_pos: u64, dst_len: u64, sizing_gen: u64, ) -> Result<OpHandle, Status>

Source§

fn space_snapshot_boundary( &mut self, seq: SeqHandle, space_id: u32, cap: u64, ) -> Result<u64, Status>

Source§

fn space_restore( &mut self, seq: SeqHandle, space_id: u32, src: &[u8], ) -> Result<OpHandle, Status>

Source§

fn space_trim( &mut self, seq: SeqHandle, space_id: u32, new_len: u64, ) -> Result<(), Status>

Source§

fn space_demote( &mut self, seq: SeqHandle, space_id: u32, range: TokenRange, encoding: u8, dst_len: u64, sizing_gen: u64, ) -> Result<OpHandle, Status>

Source§

fn space_promote( &mut self, _seq: SeqHandle, _space_id: u32, _range: TokenRange, _src: &[u8], ) -> Result<OpHandle, Status>

Source§

fn op_poll(&mut self, op: OpHandle) -> Result<OpStatus, Status>

Source§

fn take_op_output(&mut self, op: OpHandle) -> Option<Vec<u8>>

Source§

fn op_cancel(&mut self, op: OpHandle) -> Result<(), Status>

Source§

fn cache_evict( &mut self, evictable_cache_classes: u64, protected_quota_bytes: u64, max_evict_bytes: u64, bytes_target: u64, ) -> Result<u64, Status>

Source§

fn cache_evict_entries( &mut self, keys: &[([u8; 32], [u8; 32])], ) -> Result<(), Status>

Source§

fn unpublish(&mut self, tokens: &[u32]) -> Result<(), Status>

Drops the prefix-cache entry published under exactly tokens, unless a seed holds it; none there is not an error.
Source§

fn logit_bias_create( &mut self, tokens: &[i32], values: &[f32], ) -> Result<u32, Status>

Source§

fn logit_bias_free(&mut self, handle: u32) -> Result<(), Status>

Source§

fn grammar_create(&mut self, json_schema: &str) -> Result<u32, Status>

Source§

fn grammar_create_structural(&mut self, tag_json: &str) -> Result<u32, Status>

Source§

fn grammar_free(&mut self, handle: u32) -> Result<(), Status>

Source§

fn capability_descriptor(&self) -> Option<String>

Source§

fn attach_ring(&mut self, _ring: &RingAttachment) -> Result<(), Status>

Source§

fn kv_bits(&self) -> u32

Source§

fn space_match_ref( &mut self, space_id: u32, _span: &TokenRef, span_tokens: &[u32], media_deps: &[[u8; 32]], ) -> Result<&MatchResult, Status>

Source§

fn seed_acquire_ref( &mut self, _span: &TokenRef, span_tokens: &[u32], prefix_len: u64, determinism_class: u8, ) -> Result<u64, Status>

Source§

fn media_probe(&mut self, _image_path: &str) -> Result<MediaInfo, Status>

Source§

fn media_encode( &mut self, _image_path: &str, ) -> Result<(u64, MediaInfo), Status>

Source§

fn media_release(&mut self, _media_handle: u64) -> Result<(), Status>

Source§

fn media_bind( &mut self, _lane_tag: u64, _media_handle: u64, _token_offset: u32, ) -> Result<(), Status>

Source§

fn seed_adopt_ref( &mut self, seq: u64, _span: &TokenRef, span_tokens: &[u32], ) -> Result<u64, Status>

Source§

fn embed(&mut self, _tokens: &[u32]) -> Result<Vec<f32>, Status>

Source§

fn transcribe( &mut self, _audio_path: &str, _params: &TranscribeParams, _on_segment: Option<&mut dyn FnMut(i32, i32, &str) -> bool>, ) -> Result<Transcription, Status>

Source§

fn lora_load(&mut self, _adapter_path: &str) -> Result<(), Status>

Source§

fn lora_unload(&mut self) -> Result<(), Status>

Source§

fn lora_id(&self) -> Option<String>

Source§

fn n_layers(&self) -> u32

Source§

fn forward_stage( &mut self, _tokens: &[u32], _start_layer: u32, _end_layer: u32, _hidden_in: Option<Vec<u8>>, ) -> Result<StageOutput, Status>

Source§

impl<P: RuntimePrimitives> EngineInspect for Executor<P>

Source§

fn lane_committed(&self, lane_tag: u64) -> Option<&[u32]>

Source§

fn inject_fault(&mut self, lane_tag: u64, code: u32)

Auto Trait Implementations§

§

impl<P> !Freeze for Executor<P>

§

impl<P> !RefUnwindSafe for Executor<P>

§

impl<P> !UnwindSafe for Executor<P>

§

impl<P> Send for Executor<P>
where P: Send,

§

impl<P> Sync for Executor<P>
where P: Sync,

§

impl<P> Unpin for Executor<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for Executor<P>
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.