Skip to main content

FakePrimitives

Struct FakePrimitives 

Source
pub struct FakePrimitives {
    pub cfg: FakeConfig,
    pub feeds: Vec<(usize, bool)>,
    pub beside: Vec<u64>,
    pub synced: Option<bool>,
    /* private fields */
}

Fields§

§cfg: FakeConfig§feeds: Vec<(usize, bool)>§beside: Vec<u64>

For every step, the cells the pool held for sequences the step did not feed: what a runtime that attends over its whole pool (llama.cpp’s unified cache) pays for on each one.

§synced: Option<bool>

What the executor last asked of sync_steps.

Implementations§

Source§

impl FakePrimitives

Source

pub fn new(cfg: FakeConfig) -> FakePrimitives

Source

pub fn token_for(&self, content: &[u32]) -> u32

Source

pub fn row_for(&self, content: &[u32]) -> Vec<f32>

Source

pub fn contents(&self, seq: Seq) -> Option<&[u32]>

Source

pub fn script(&mut self, seq: Seq, tokens: Vec<u32>)

Source

pub fn fault_next_step(&mut self, code: u32)

Source

pub fn fail_next_step(&mut self, e: PrimError)

Source

pub fn poison_next_import(&mut self)

Trait Implementations§

Source§

impl Default for FakePrimitives

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl RuntimePrimitives for FakePrimitives

Source§

fn sync_steps(&mut self, on: bool)

Whether a step that reads no row is done when it returns, rather than queued.
Source§

fn describe(&self) -> RuntimeDescriptor

Source§

fn is_eos(&self, token: u32) -> bool

Source§

fn mem_counters(&self) -> MemCounters

Source§

fn seq_create(&mut self) -> Result<Seq, PrimError>

Source§

fn seq_free(&mut self, seq: Seq)

Source§

fn seq_len(&self, seq: Seq) -> u64

Source§

fn cells_released(&self, seqs: &[Seq]) -> u64

Source§

fn seq_copy(&mut self, src: Seq, dst: Seq, len: u64) -> Result<(), PrimError>

Source§

fn seq_truncate(&mut self, seq: Seq, new_len: u64) -> Result<(), PrimError>

Source§

fn seq_boundary(&self, seq: Seq, cap: u64) -> u64

Source§

fn seq_export( &mut self, seq: Seq, len: u64, enc: u8, ) -> Result<Vec<u8>, PrimError>

Source§

fn seq_import(&mut self, seq: Seq, payload: &[u8]) -> Result<u64, PrimError>

Source§

fn step(&mut self, feeds: &[Feed<'_>]) -> Result<Vec<Vec<f32>>, PrimError>

Source§

fn step_rows( &mut self, feeds: &[Feed<'_>], ) -> Result<Option<Vec<Vec<Vec<f32>>>>, PrimError>

step, answering for each feed that wants rows a row after every one of its tokens (in order), not only its last. Ok(None): not served, and nothing moved.
Source§

fn step_sampled( &mut self, feeds: &[Feed<'_>], specs: &[SampleSpec], ) -> Result<Option<Vec<u32>>, PrimError>

Source§

fn vocabulary(&self) -> Option<Vocabulary>

Source§

fn shed(&mut self, _bytes_target: u64) -> u64

Auto Trait Implementations§

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.