pub struct LoraLayerWeights {
pub layer_idx: usize,
pub q_proj: Option<LoraPair>,
pub k_proj: Option<LoraPair>,
pub v_proj: Option<LoraPair>,
pub o_proj: Option<LoraPair>,
pub gate_proj: Option<LoraPair>,
pub up_proj: Option<LoraPair>,
pub down_proj: Option<LoraPair>,
pub out_proj: Option<LoraPair>,
pub router: Option<LoraPair>,
pub experts: Option<ExpertLoraLayer>,
}Expand description
One full-attention layer’s adapted modules. None = module not adapted.
Pairs are the CANONICAL LoraPair from layers::ops::lora_delta
(Copy — installed by copy into the layer structs at model build).
Clone (LoraPair is Copy) so a slot’s layers can be re-installed onto the
layer structs on a runtime rotation (set_active_lora).
Fields§
§layer_idx: usize§q_proj: Option<LoraPair>§k_proj: Option<LoraPair>§v_proj: Option<LoraPair>§o_proj: Option<LoraPair>§gate_proj: Option<LoraPair>§up_proj: Option<LoraPair>§down_proj: Option<LoraPair>§out_proj: Option<LoraPair>GDN out_proj delta (linear-attention layers only).
router: Option<LoraPair>Feature-1: MoE router (mlp.gate) delta on the routing logits. None
unless the adapter targets the router AND ATLAS_LORA_EXPERTS=1.
experts: Option<ExpertLoraLayer>Feature-1: this layer’s routed-expert LoRA coverage (sparse per-expert
pairs). None for attention/dense-only adapters or when expert LoRA is
disabled. Packed into a SEPARATE expert allocation (not the equal-slot
attention pool), so the BGMV route tables + slot offset math are
untouched.
Implementations§
Source§impl LoraLayerWeights
impl LoraLayerWeights
Sourcepub fn module_pair(&self, module: LoraModule) -> Option<&LoraPair>
pub fn module_pair(&self, module: LoraModule) -> Option<&LoraPair>
Select this layer’s LoraPair for module (None = module not
adapted). The single source of truth for the (layer, module) → pair map,
shared by select_routed_pair and LoraWeights::refresh_slot_tables.
Trait Implementations§
Source§impl Clone for LoraLayerWeights
impl Clone for LoraLayerWeights
Source§fn clone(&self) -> LoraLayerWeights
fn clone(&self) -> LoraLayerWeights
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more