pub struct GgufHyperparams {}Expand description
Architecture hyper-parameters parsed from the GGUF KV section.
Fields§
§n_layer: u32§n_embd: u32§n_head: u32§n_kv_head: u32Grouped-query KV heads; 0 means MHA (n_kv_head == n_head).
rope_freq_base: f32llama.rope.freq_base (FLOAT32 in GGUF); 0 → DEFAULT_ROPE_FREQ_BASE.
rope_scale: f32Linear RoPE scale from llama.rope.scale_linear / llama.rope.scaling.factor; 0 → 1.0.
head_dim: u32Explicit head dim (*.attention.key_length); 0 → derive n_embd / n_head.
head_dim_swa: u32SWA / local-attention head dim (*.attention.key_length_swa); 0 → same as head_dim.
sliding_window: u32Sliding-window size in tokens; 0 → full context attention only.
Last N layers share KV from the last non-shared layer of the same type (Gemma 4).
logit_softcap: f32Final logit softcapping (Gemma 2+); 0 → disabled.
architecture: u32[ARCH_*] id from general.architecture (and tensor-feature refinement).
arch_flags: u32[ARCH_FLAG_*] bitmask.
Implementations§
Source§impl GgufHyperparams
impl GgufHyperparams
pub fn effective_rope_freq_base(&self) -> f32
Sourcepub fn effective_rope_scale(&self) -> f32
pub fn effective_rope_scale(&self) -> f32
Effective position divisor for RoPE (scaled_pos = pos / scale).
Sourcepub fn effective_head_dim(&self) -> u32
pub fn effective_head_dim(&self) -> u32
Nominal head_dim (n_embd / n_head if head_dim == 0).
pub fn head_dim(&self) -> u32
pub fn effective_n_kv_head(&self) -> u32
pub fn q_heads_per_kv(&self) -> u32
pub fn gqa_ratio(&self) -> u32
pub fn head_dim_swa_or(&self) -> u32
Sourcepub fn architecture_name(&self) -> &'static str
pub fn architecture_name(&self) -> &'static str
Human-readable architecture name for logs / errors.
Sourcepub fn decode_supported(&self) -> Result<(), String>
pub fn decode_supported(&self) -> Result<(), String>
Whether the native decode path can run this architecture coherently.
Gemma 4 (E2B/E4B) requires PLE, dual-RoPE SWA/global head dims, QK-norm, post-norms,
variable FFN width, and shared KV — none of which the Llama-shaped decode path implements.
Running it produces multilingual garbage (measured 2026-07-09 on gemma-4-E2B-it-Q4_K_M).
Override with QUALIA_LLM_FORCE_UNSUPPORTED_ARCH=1 only for bring-up.
Trait Implementations§
Source§impl Clone for GgufHyperparams
impl Clone for GgufHyperparams
Source§fn clone(&self) -> GgufHyperparams
fn clone(&self) -> GgufHyperparams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GgufHyperparams
impl Debug for GgufHyperparams
Source§impl Default for GgufHyperparams
impl Default for GgufHyperparams
Source§fn default() -> GgufHyperparams
fn default() -> GgufHyperparams
Source§impl PartialEq for GgufHyperparams
impl PartialEq for GgufHyperparams
Source§fn eq(&self, other: &GgufHyperparams) -> bool
fn eq(&self, other: &GgufHyperparams) -> bool
self and other values to be equal, and is used by ==.impl Copy for GgufHyperparams
impl StructuralPartialEq for GgufHyperparams
Auto Trait Implementations§
impl Freeze for GgufHyperparams
impl RefUnwindSafe for GgufHyperparams
impl Send for GgufHyperparams
impl Sync for GgufHyperparams
impl Unpin for GgufHyperparams
impl UnsafeUnpin for GgufHyperparams
impl UnwindSafe for GgufHyperparams
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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