pub struct LoraAttnWeights {
pub layer_idx: usize,
pub q: Option<LoraPair>,
pub k: Option<LoraPair>,
pub v: Option<LoraPair>,
pub o: Option<LoraPair>,
pub kernels: LoraKernels,
pub q_route: Option<LoraRoute>,
pub k_route: Option<LoraRoute>,
pub v_route: Option<LoraRoute>,
pub o_route: Option<LoraRoute>,
}Expand description
Per-layer attention-side LoRA weights, installed by copy onto
Qwen3AttentionLayer.
The q pair folds the delta into the RAW q_proj output at offset 0, full
width = q_proj_dim (on a gated model the interleaved [Q|gate], width
2·q_heads·head_dim), BEFORE the deinterleave_qg split — the PEFT
lora_B was trained against exactly that interleaved basis, so the delta
applies like k/v/o, just wider.
Fields§
§layer_idx: usize#30: the TRUE global layer index (0..num_hidden_layers), stamped at
install from the global idx. The prefill apply sites index the
request slot’s GLOBAL-layer-indexed pairs with THIS (not attn_layer_idx,
an attention-only counter that diverges from the global index on hybrid
GDN/attention models).
q: Option<LoraPair>§k: Option<LoraPair>§v: Option<LoraPair>§o: Option<LoraPair>§kernels: LoraKernels§q_route: Option<LoraRoute>M2 per-request routing tables (per module). None = single/global
adapter with no routing (the n==1 path uses the pair above and stays
byte-identical). Some when a multi-adapter pool is resident; the
batched decode path reads these + the per-seq seq_slot via the bgmv.
k_route: Option<LoraRoute>§v_route: Option<LoraRoute>§o_route: Option<LoraRoute>Trait Implementations§
Source§impl Clone for LoraAttnWeights
impl Clone for LoraAttnWeights
Source§fn clone(&self) -> LoraAttnWeights
fn clone(&self) -> LoraAttnWeights
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more