pub enum LoraModule {
QProj,
KProj,
VProj,
OProj,
GateProj,
UpProj,
DownProj,
OutProj,
}Variants§
QProj
KProj
VProj
OProj
GateProj
UpProj
DownProj
OutProj
GDN block OUTPUT projection (linear_attn.out_proj), value_dim ->
hidden. Not OProj: different contract dim, disjoint layer set.
Implementations§
Source§impl LoraModule
impl LoraModule
pub const ALL: [LoraModule; 8]
Sourcepub fn is_dense_ffn(&self) -> bool
pub fn is_dense_ffn(&self) -> bool
Dense SwiGLU FFN module — see Self::applies_to_layer.
Sourcepub fn is_gdn_out(&self) -> bool
pub fn is_gdn_out(&self) -> bool
Whether this module is the GDN block’s output projection.
Sourcepub fn applies_to_layer(&self, cfg: &ModelConfig, layer: usize) -> bool
pub fn applies_to_layer(&self, cfg: &ModelConfig, layer: usize) -> bool
Which layers may carry this module: attention q/k/v/o on full-attention layers only; dense gate/up/down on EVERY layer of a dense-FFN model (a hybrid’s linear-attention layers carry the SwiGLU FFN too); GDN out_proj on linear-attention layers only. THE authority for BOTH the pool layout and the packing walk, so reserved and written bytes cannot disagree.
Sourcepub fn dims(&self, cfg: &ModelConfig) -> (usize, usize)
pub fn dims(&self, cfg: &ModelConfig) -> (usize, usize)
(out_dim, in_dim) of the base projection. Holo-3.1-0.8B (verified
against the checkpoint header): k/v [512,1024], o [1024,2048],
gate/up [3584,1024], down [1024,3584].
q_proj: on a gated-attention model (attn_gated) the raw projection
emits the interleaved [Q|gate] at width 2·q_heads·head_dim (the
FULL width the PEFT lora_B was trained against — verified [8192,16]
on holo-3.1-35b); ungated q is q_heads·head_dim.
Trait Implementations§
Source§impl Clone for LoraModule
impl Clone for LoraModule
Source§fn clone(&self) -> LoraModule
fn clone(&self) -> LoraModule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoraModule
impl Debug for LoraModule
Source§impl Ord for LoraModule
impl Ord for LoraModule
Source§fn cmp(&self, other: &LoraModule) -> Ordering
fn cmp(&self, other: &LoraModule) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for LoraModule
impl PartialEq for LoraModule
Source§impl PartialOrd for LoraModule
impl PartialOrd for LoraModule
impl Copy for LoraModule
impl Eq for LoraModule
impl StructuralPartialEq for LoraModule
Auto Trait Implementations§
impl Freeze for LoraModule
impl RefUnwindSafe for LoraModule
impl Send for LoraModule
impl Sync for LoraModule
impl Unpin for LoraModule
impl UnwindSafe for LoraModule
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.