Skip to main content

TalkerEngine

Struct TalkerEngine 

Source
pub struct TalkerEngine { /* private fields */ }

Implementations§

Source§

impl TalkerEngine

Source

pub fn open( store: &Qwen3TtsWeightStore, talker: &TalkerConfig, device: Device, ) -> Result<TalkerEngine, Error>

Source

pub fn open_at( model_dir: &Path, store: &Qwen3TtsWeightStore, talker: &TalkerConfig, device: Device, ) -> Result<TalkerEngine, Error>

Source

pub fn open_with_weights( model_dir: &Path, store: &Qwen3TtsWeightStore, talker: &TalkerConfig, weights: HashMap<String, (Vec<f32>, Vec<usize>)>, device: Device, ) -> Result<TalkerEngine, Error>

Source

pub fn open_with_weights_and_profiles( _model_dir: &Path, store: &Qwen3TtsWeightStore, talker: &TalkerConfig, weights: HashMap<String, (Vec<f32>, Vec<usize>)>, device: Device, prefill_profile: CompileProfile, decode_profile: CompileProfile, ) -> Result<TalkerEngine, Error>

Source

pub fn decode_bucket_upper(&self, past_seq: usize) -> usize

Bucket upper bound for talker decode at past_seq (power-of-two ladder).

Source

pub fn precompile_decode_bucket_for_past( &mut self, past_seq: usize, ) -> Result<(), Error>

Pre-compile the single decode bucket that contains past_seq (cheap first-frame insurance).

Source

pub fn preinstall_gpu_kv_horizon(&mut self, horizon: usize) -> Result<(), Error>

Pre-bind GPU K/V handles for horizon buckets (boundary crossings by default).

Source

pub fn preinstall_gpu_kv_current(&mut self) -> Result<(), Error>

Bind GPU K/V for the current prefill bucket (no dry decode).

Skips re-upload when handles are already live for this bucket — rebinding from host kv would clobber GPU-updated prefix rows after the first decode step.

Source

pub fn warmup_bucket_executions_from( &mut self, from_horizon: usize, new_horizon: usize, ) -> Result<(), Error>

Dry-run only bucket boundaries in (from_horizon, new_horizon] not yet warmed.

Source

pub fn warmup_bucket_executions(&mut self, horizon: usize) -> Result<(), Error>

Dry decode to warm Metal/CUDA graphs (restores KV after).

Source

pub fn precompile_decode_buckets_up_to( &mut self, horizon: usize, parent: Option<&Progress>, ) -> Result<(), Error>

Pre-compile decode buckets with upper <= horizon (skips unused large past lengths).

Source

pub fn warmup(&mut self, prefill_seq: usize) -> Result<(), Error>

Warm compile caches (prefill + one decode step). Call before timed runs.

Source

pub fn warmup_embeds( &mut self, embeds: ArrayBase<ViewRepr<&f32>, Dim<[usize; 2]>>, max_frames: usize, ) -> Result<ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>, Error>

Warm prefill (and optionally one decode step when buckets are fully lazy).

Source

pub fn warm_eager_decode_rope(&mut self) -> Result<(), Error>

Precompute eager decode RoPE bank after prefill (rope_delta must be set).

Source

pub fn ensure_eager_horizon(&mut self, horizon: usize)

Grow eager attention scratch + RoPE bank for a horizon larger than the default (256). No-op when no eager talker is loaded or the buffers already fit.

Source

pub fn reset_kv(&mut self)

Source

pub fn ensure_prefill_compiled(&mut self, seq: usize) -> Result<(), Error>

Compile prefill graph for seq (no-op when cached or eager).

Source

pub fn prefill( &mut self, embeds: ArrayBase<ViewRepr<&f32>, Dim<[usize; 2]>>, ) -> Result<ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>, Error>

Source

pub fn past_len(&self) -> usize

Source

pub fn rope_delta(&self) -> i64

Source

pub fn last_hidden_view(&self) -> ArrayBase<ViewRepr<&f32>, Dim<[usize; 1]>>

Source

pub fn set_last_hidden( &mut self, row: ArrayBase<ViewRepr<&f32>, Dim<[usize; 1]>>, ) -> Result<(), Error>

Source

pub fn decode_hidden_step( &mut self, embed: ArrayBase<ViewRepr<&f32>, Dim<[usize; 1]>>, ) -> Result<(), Error>

KV decode step; updates Self::last_hidden without sampling.

Source

pub fn decode_step( &mut self, embed: ArrayBase<ViewRepr<&f32>, Dim<[usize; 1]>>, ) -> Result<(ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>, u32), Error>

Source

pub fn import_fused_decode_outputs( &mut self, hidden_vec: &[f32], layers_k: &[Vec<f32>], layers_v: &[Vec<f32>], past_seq: usize, ) -> Result<(), Error>

Import bucketed decode outputs from a fused codec-frame graph run.

Source

pub fn decode_hidden_into( &mut self, embed: ArrayBase<ViewRepr<&f32>, Dim<[usize; 1]>>, hidden_out: &mut [f32], ) -> Result<(), Error>

KV decode; writes the last hidden row into hidden_out.

Source

pub fn hidden_size(&self) -> usize

Source

pub fn is_eager(&self) -> bool

Source

pub fn uses_gpu_kv(&self) -> bool

Source

pub fn codec_eos(&self) -> u32

Source

pub fn codec_head(&self) -> ArrayBase<ViewRepr<&f32>, Dim<[usize; 2]>>

Source

pub fn codec_head_flat(&self) -> (&[f32], usize, usize)

Source

pub fn kv_state(&self) -> LayerKvCache

Snapshot host K/V after prefill (parity / isolation tests).

Source

pub fn restore_kv_state(&mut self, kv: LayerKvCache, rope_delta: i64)

Restore host K/V, past_len, and MRoPE delta (parity / isolation tests).

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V