pub struct Executor<P: RuntimePrimitives> { /* private fields */ }Implementations§
Source§impl<P: RuntimePrimitives> Executor<P>
impl<P: RuntimePrimitives> Executor<P>
pub fn new(prim: P, cfg: ExecutorConfig) -> Executor<P>
pub fn primitives(&self) -> &P
pub fn primitives_mut(&mut self) -> &mut P
pub fn descriptor(&self) -> &RuntimeDescriptor
pub fn lane_committed(&self, lane_tag: u64) -> Option<&[u32]>
pub fn inject_fault(&mut self, lane_tag: u64, code: u32)
Sourcepub fn cache_bytes(&self) -> u64
pub fn cache_bytes(&self) -> u64
Pool bytes the prefix cache accounts for.
Sourcepub fn cache_exported_tokens(&self) -> u64
pub fn cache_exported_tokens(&self) -> u64
Tokens of state the prefix cache holds out of the runtime’s pool.
pub fn match_lengths(&self, span: &[u32]) -> Vec<u64>
Sourcepub fn live_sequences(&self) -> u64
pub fn live_sequences(&self) -> u64
Sequences the runtime holds for this executor: lanes, bare sequences and the cache entries in its pool.
pub fn last_logprobs(&self) -> Vec<LaneLogprob>
pub fn compat_identity(&self) -> [u8; 32]
Trait Implementations§
Source§impl<P: RuntimePrimitives> Engine for Executor<P>
impl<P: RuntimePrimitives> Engine for Executor<P>
fn tick<'a>( &'a mut self, plan: &TickPlan, arena: &RecordArena, rings: &mut dyn Rings, ) -> Result<&'a TickEvents, Status>
fn pump(&mut self)
fn state_spaces(&self) -> &[StateSpaceDesc]
fn strategy_register( &mut self, reg: &StrategyRegistration, ) -> Result<&StrategyGrant, Status>
fn space_match( &mut self, space_id: u32, span_tokens: &[u32], _media_deps: &[[u8; 32]], ) -> Result<&MatchResult, Status>
fn seed_acquire( &mut self, span_tokens: &[u32], prefix_len: u64, determinism_class: u8, ) -> Result<u64, Status>
fn seed_lease_ticks(&self) -> Option<u64>
fn seed_release(&mut self, seed_handle: u64) -> Result<(), Status>
fn seed_adopt( &mut self, seq: SeqHandle, span_tokens: &[u32], ) -> Result<u64, Status>
fn seq_fork( &mut self, parent: SeqHandle, flags: u32, ) -> Result<SeqHandle, Status>
fn lane_sequence(&self, lane_tag: u64) -> Option<SeqHandle>
fn create_sequence(&mut self) -> Result<SeqHandle, Status>
fn free_sequence(&mut self, seq: SeqHandle) -> Result<(), Status>
fn publish_sequence( &mut self, seq: SeqHandle, tokens: &[u32], ) -> Result<(), Status>
fn space_export_size( &mut self, seq: SeqHandle, space_id: u32, range: TokenRange, encoding: u8, ) -> Result<(u64, u64), Status>
fn space_snapshot( &mut self, seq: SeqHandle, space_id: u32, boundary_pos: u64, dst_len: u64, sizing_gen: u64, ) -> Result<OpHandle, Status>
fn space_snapshot_boundary( &mut self, seq: SeqHandle, space_id: u32, cap: u64, ) -> Result<u64, Status>
fn space_restore( &mut self, seq: SeqHandle, space_id: u32, src: &[u8], ) -> Result<OpHandle, Status>
fn space_trim( &mut self, seq: SeqHandle, space_id: u32, new_len: u64, ) -> Result<(), Status>
fn space_demote( &mut self, seq: SeqHandle, space_id: u32, range: TokenRange, encoding: u8, dst_len: u64, sizing_gen: u64, ) -> Result<OpHandle, Status>
fn space_promote( &mut self, _seq: SeqHandle, _space_id: u32, _range: TokenRange, _src: &[u8], ) -> Result<OpHandle, Status>
fn op_poll(&mut self, op: OpHandle) -> Result<OpStatus, Status>
fn take_op_output(&mut self, op: OpHandle) -> Option<Vec<u8>>
fn op_cancel(&mut self, op: OpHandle) -> Result<(), Status>
fn cache_evict( &mut self, evictable_cache_classes: u64, protected_quota_bytes: u64, max_evict_bytes: u64, bytes_target: u64, ) -> Result<u64, Status>
fn cache_evict_entries( &mut self, keys: &[([u8; 32], [u8; 32])], ) -> Result<(), Status>
Source§fn unpublish(&mut self, tokens: &[u32]) -> Result<(), Status>
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.fn logit_bias_create( &mut self, tokens: &[i32], values: &[f32], ) -> Result<u32, Status>
fn logit_bias_free(&mut self, handle: u32) -> Result<(), Status>
fn grammar_create(&mut self, json_schema: &str) -> Result<u32, Status>
fn grammar_create_structural(&mut self, tag_json: &str) -> Result<u32, Status>
fn grammar_free(&mut self, handle: u32) -> Result<(), Status>
fn capability_descriptor(&self) -> Option<String>
fn attach_ring(&mut self, _ring: &RingAttachment) -> Result<(), Status>
fn kv_bits(&self) -> u32
fn space_match_ref( &mut self, space_id: u32, _span: &TokenRef, span_tokens: &[u32], media_deps: &[[u8; 32]], ) -> Result<&MatchResult, Status>
fn seed_acquire_ref( &mut self, _span: &TokenRef, span_tokens: &[u32], prefix_len: u64, determinism_class: u8, ) -> Result<u64, Status>
fn media_probe(&mut self, _image_path: &str) -> Result<MediaInfo, Status>
fn media_encode( &mut self, _image_path: &str, ) -> Result<(u64, MediaInfo), Status>
fn media_release(&mut self, _media_handle: u64) -> Result<(), Status>
fn media_bind( &mut self, _lane_tag: u64, _media_handle: u64, _token_offset: u32, ) -> Result<(), Status>
fn seed_adopt_ref( &mut self, seq: u64, _span: &TokenRef, span_tokens: &[u32], ) -> Result<u64, Status>
fn embed(&mut self, _tokens: &[u32]) -> Result<Vec<f32>, Status>
fn transcribe( &mut self, _audio_path: &str, _params: &TranscribeParams, _on_segment: Option<&mut dyn FnMut(i32, i32, &str) -> bool>, ) -> Result<Transcription, Status>
fn lora_load(&mut self, _adapter_path: &str) -> Result<(), Status>
fn lora_unload(&mut self) -> Result<(), Status>
fn lora_id(&self) -> Option<String>
fn n_layers(&self) -> u32
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>
impl<P: RuntimePrimitives> EngineInspect for Executor<P>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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