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: usizeRows 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: usizeQuery and key head width — 48 on the shipped model.
v_head_dim: usizeValue head width — 64. Unlike v2, this differs from qk_head_dim.
max_seq_len: usize§hada_n: usizeHadamard width in HadamardMLP: d_model rounded up to a power of two.
mhc_lanes: usize§rope_theta: f32§sliding_window: usizeLocal 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: usizeCausal depthwise convolution width over Q, K and V. 0 means none.
engram: V3EngramImplementations§
Source§impl V3Config
impl V3Config
Sourcepub fn q_dim(&self) -> usize
pub fn q_dim(&self) -> usize
Width of the concatenated query projection, num_heads * qk_head_dim.
Sourcepub fn attn_out_dim(&self) -> usize
pub fn attn_out_dim(&self) -> usize
Width of the attention output before out_proj, num_heads * v_head_dim.
Sourcepub fn logit_rows(&self) -> usize
pub fn logit_rows(&self) -> usize
Rows of the tied head used for logits.
Sourcepub fn attention_span(&self, layer: usize) -> Option<usize>
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.
Sourcepub fn active_lane(&self, layer: usize) -> usize
pub fn active_lane(&self, layer: usize) -> usize
The lane layer i is assigned to, as eye(n)[i % n] in the
reference Stack.
Sourcepub fn kv_bytes(&self, seq_len: usize, bytes_per: usize) -> usize
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.
Sourcepub fn kv_bytes_at(&self, seq_len: usize, precision: KvPrecision) -> usize
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.