LoraAttnWeights

Struct LoraAttnWeights 

Source
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

Source§

fn clone(&self) -> LoraAttnWeights

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LoraAttnWeights

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more