Skip to main content

Dash

Struct Dash 

Source
pub struct Dash {
Show 19 fields pub layers: Vec<DashLayer>, pub block: usize, pub local_blocks: usize, pub local_window: usize, pub index_dim: usize, pub head_dim: usize, pub inv_tok: Vec<f32>, pub image_id: u32, pub page_id: u32, pub rope: Option<PageRope>, pub guard: Option<PageGuard>, pub cs: Vec<(f32, f32)>, pub angles: Vec<f32>, pub allow: Vec<bool>, pub cands: Vec<u32>, pub coff: Vec<u32>, pub k_bar: Vec<Vec<f32>>, pub open: Vec<Vec<f32>>, pub on_device: bool, /* private fields */
}
Expand description

The router: weights, geometry and the sequence state on the host.

Fields§

§layers: Vec<DashLayer>§block: usize§local_blocks: usize§local_window: usize§index_dim: usize§head_dim: usize§inv_tok: Vec<f32>§image_id: u32§page_id: u32§rope: Option<PageRope>§guard: Option<PageGuard>

The answer’s page bookkeeping (_uocr_page_count_guard).

§cs: Vec<(f32, f32)>

(sin, cos) of the current position, one per frequency pair.

§angles: Vec<f32>

The angles of the current rows, one half per row.

§allow: Vec<bool>

Candidate blocks of the current query.

§cands: Vec<u32>

The blocks the device scores per row: remote and candidates, or every remote block when none is both. coff[row]..coff[row + 1].

§coff: Vec<u32>§k_bar: Vec<Vec<f32>>

Per layer: completed block summaries [n, index_dim].

§open: Vec<Vec<f32>>

Per layer: the keys of the open block.

§on_device: bool

Whether the graph holds the router state instead of the host.

Implementations§

Source§

impl Dash

Source

pub fn from_model(model: &CmfModel) -> Result<Self, String>

Source

pub fn begin(&mut self, ids: &[u32], eos_id: u32) -> Result<(), String>

A new sequence over the prompt ids.

Source

pub fn at_prompt(&mut self, pos: usize)

Set the coordinates and candidates of a prompt position.

Source

pub fn at_prompt_chunk(&mut self, pos: usize, k: usize)

The angles and candidates of the prompt rows pos..pos + k. allow is left at the last row.

Source

pub fn at_decode(&mut self, id: u32, pos: usize)

Advance over decoded token id at pos and set its candidates.

Auto Trait Implementations§

§

impl Forget for Dash

§

impl Freeze for Dash

§

impl Move for Dash

§

impl RefUnwindSafe for Dash

§

impl Send for Dash

§

impl Sync for Dash

§

impl Unpin for Dash

§

impl UnsafeUnpin for Dash

§

impl UnwindSafe for Dash

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more