Skip to main content

V3Config

Struct V3Config 

Source
pub struct V3Config {
Show 16 fields pub vocab_size: usize, pub out_vocab: usize, pub d_model: usize, pub num_heads: usize, pub num_kv_heads: usize, pub num_layers: usize, pub qk_head_dim: usize, pub v_head_dim: usize, pub max_seq_len: usize, pub hada_n: usize, pub mhc_lanes: usize, pub rope_theta: f32, pub sliding_window: usize, pub global_layers: Vec<usize>, pub qkv_conv_taps: usize, pub engram: V3Engram,
}
Expand description

Full v3 model geometry.

Fields§

§vocab_size: usize§out_vocab: usize

Rows of the tied head actually used for logits. Rows beyond this are input-only code embeddings. 0 means the full vocabulary.

§d_model: usize§num_heads: usize§num_kv_heads: usize§num_layers: usize§qk_head_dim: usize

Query and key head width — 48 on the shipped model.

§v_head_dim: usize

Value head width — 64. Unlike v2, this differs from qk_head_dim.

§max_seq_len: usize§hada_n: usize

Hadamard width in HadamardMLP: d_model rounded up to a power of two.

§mhc_lanes: usize§rope_theta: f32§sliding_window: usize

Local attention width for layers that are not global. 0 means full causal everywhere.

§global_layers: Vec<usize>

Layers attending over the whole sequence instead of sliding_window.

§qkv_conv_taps: usize

Causal depthwise convolution width over Q, K and V. 0 means none.

§engram: V3Engram

Implementations§

Source§

impl V3Config

Source

pub fn q_dim(&self) -> usize

Width of the concatenated query projection, num_heads * qk_head_dim.

Source

pub fn k_dim(&self) -> usize

Width of the concatenated key projection.

Source

pub fn v_dim(&self) -> usize

Width of the concatenated value projection.

Source

pub fn attn_out_dim(&self) -> usize

Width of the attention output before out_proj, num_heads * v_head_dim.

Source

pub fn kv_repeat(&self) -> usize

Query heads served by one key/value head.

Source

pub fn mhc_width(&self) -> usize

Flattened mHC lane-stream width, mhc_lanes * d_model.

Source

pub fn logit_rows(&self) -> usize

Rows of the tied head used for logits.

Source

pub fn is_global(&self, layer: usize) -> bool

True when layer attends over the whole sequence.

Source

pub fn attention_span(&self, layer: usize) -> Option<usize>

How many past positions layer can attend to, counting the current one. None means unbounded — the caller must keep full history.

This is the distinction that drives the KV allocation: local layers need a fixed ring, global layers need everything.

Source

pub fn active_lane(&self, layer: usize) -> usize

The lane layer i is assigned to, as eye(n)[i % n] in the reference Stack.

Source

pub fn kv_bytes(&self, seq_len: usize, bytes_per: usize) -> usize

Bytes of key/value cache for a session of seq_len positions, at bytes_per per stored scalar.

Local layers cost a fixed ring; global layers cost the real sequence length, which is why they are sized to what a session actually uses rather than to max_seq_len.

Source

pub fn kv_bytes_at(&self, seq_len: usize, precision: KvPrecision) -> usize

Bytes of key/value cache for a session of seq_len positions at a given storage precision.

Prefer this to Self::kv_bytes when the answer decides whether a session fits: the int8 figure is not simply a quarter, because each stored head vector also carries an f32 scale.

Trait Implementations§

Source§

impl Clone for V3Config

Source§

fn clone(&self) -> V3Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for V3Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for V3Config

Source§

fn eq(&self, other: &V3Config) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for V3Config

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.