pub struct Qwen38Cfg {Show 16 fields
pub d: usize,
pub layers: usize,
pub full_attn_every: usize,
pub dff: usize,
pub vocab: usize,
pub h: usize,
pub kv: usize,
pub hd: usize,
pub rope_dim: usize,
pub rope_theta: f64,
pub rms_eps: f64,
pub gdn_k_heads: usize,
pub gdn_v_heads: usize,
pub gdn_head_dim: usize,
pub conv_taps: usize,
pub ctx_len: usize,
}Expand description
Everything the emitter needs, read from the checkpoint rather than assumed. Field names mirror the GGUF metadata keys so a mismatch is easy to spot.
Fields§
§d: usize§layers: usize§full_attn_every: usize§dff: usize§vocab: usize§h: usize§kv: usize§hd: usize§rope_dim: usize§rope_theta: f64§rms_eps: f64§gdn_k_heads: usize§gdn_v_heads: usize§gdn_head_dim: usize§conv_taps: usize§ctx_len: usizeImplementations§
Source§impl Qwen38Cfg
impl Qwen38Cfg
Sourcepub fn real() -> Self
pub fn real() -> Self
The real Qwen3.8-27B shape, as read from Qwen3.8-27B-Q8_0.gguf (see benchmarks/results/qwen38_arch.json).
Sourcepub fn tiny() -> Self
pub fn tiny() -> Self
A structurally faithful miniature — same op sequence, same hybrid schedule, tiny dimensions. Used to exercise the whole authored program on every backend without 29 GB of weights.
Sourcepub fn mini() -> Self
pub fn mini() -> Self
Qwen38Cfg::tiny with the real model’s HEAD PATTERN at a size that splits: 8 query heads over 2 KV heads and
4/8 Gated-DeltaNet heads, so it admits 2 and 4 chips of tensor parallelism — at 4 each KV head is replicated on
two chips, as the real model’s 4 KV heads are over its 8.
Sourcepub fn from_spec(spec: &ModelSpec) -> Result<Qwen38Cfg, NotYet>
pub fn from_spec(spec: &ModelSpec) -> Result<Qwen38Cfg, NotYet>
Layer l is full attention when (l+1) % full_attn_every == 0 — indices 3, 7, 11 … for interval 4.
The configuration of a checkpoint’s own spec: a Qwen3.5/3.8 hybrid, its attention every full_attn_every-th
layer, every attention layer alike, every Gated-DeltaNet layer alike, every FFN a dense SwiGLU. Refused by name
for anything else — and refused unless the configuration writes the checkpoint’s own program, the decode step
the author writes for spec (model::program), so no bundle lowered from it can be another model’s.
pub fn is_attn(&self, l: usize) -> bool
Sourcepub fn attn_layers(&self) -> usize
pub fn attn_layers(&self) -> usize
How many of the layers are attention (the rest are GDN).
Sourcepub fn spec(&self) -> ModelSpec
pub fn spec(&self) -> ModelSpec
The model this configuration describes, as a ModelSpec: every full_attn_every-th layer gated attention
(partial NEOX rotation, QK-norm, a sigmoid output gate), the rest Gated DeltaNet, each with a dense SiLU FFN.
Sourcepub fn layer_spec(&self, l: usize) -> ModelSpec
pub fn layer_spec(&self, l: usize) -> ModelSpec
The spec of this configuration reaching layer l: its layers, or as many more of its pattern as layer l
needs — the model a single-layer form of layer l is written from.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Qwen38Cfg
impl RefUnwindSafe for Qwen38Cfg
impl Send for Qwen38Cfg
impl Sync for Qwen38Cfg
impl Unpin for Qwen38Cfg
impl UnsafeUnpin for Qwen38Cfg
impl UnwindSafe for Qwen38Cfg
Blanket Implementations§
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.