vllm.models.inkling2.nvidia.lora
¶
LoRA for Inkling2.
Adapters use the checkpoint's names (model.llm.layers.N...):
- attention
wq_du/wr_du/gate_attn/attn_sink_proj/wk_dv/wv_dv, packed intoqkvr(vLLM's variable-slice merged column LoRA layer), andwo_ud; - routed experts
mlp.experts.w13_weight/mlp.experts.w2_weight, one 3D tensor per projection:lora_A[E, r, in],lora_B[E, out, r](w13rows interleave gate / up like the base weight), packed intomlp.
The experts are not a vLLM FusedMoE, so Inkling2MoEWithLoRA wraps
the whole mlp (vLLM's manager special-cases modules named *.experts)
and adds the deltas between the expert GEMMs through moe.ExpertsLoRA,
which needs BF16 experts (the NVFP4 / MXFP8 ones raise).
The attention layers run their GEMMs on qkvr.weight / wo_ud.weight
directly (ops.linear), past the LoRA wrappers' forward, and add the deltas
with add_linear_lora.
vLLM only wraps LinearBase / MoERunner modules; register adds
Inkling2MoE to the modules it considers and this class to its LoRA layers.
Classes:
-
Inkling2MoEWithLoRA–Inkling2MoEplus per-expert LoRA onw13andw2. -
Inkling2QKVRWithLoRA–qkvrLoRA; its trailing alignment slice (Inkling2Attention, at
Functions:
-
add_linear_lora–Add
layer's LoRA deltas forxtooutin place, for callers -
register–Let vLLM's LoRA manager wrap
Inkling2MoEwith
Inkling2MoEWithLoRA
¶
Bases: BaseLayerWithLoRA
Inkling2MoE plus per-expert LoRA on w13 and w2.
Source code in vllm/models/inkling2/nvidia/lora.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
_local(tensor)
¶
This rank's experts of an [E, ...] adapter tensor; a 2D tensor
(e.g. vLLM's warmup dummy) applies to every expert.
Source code in vllm/models/inkling2/nvidia/lora.py
Inkling2QKVRWithLoRA
¶
Bases: MergedColumnParallelLinearVariableSliceWithLoRA
qkvr LoRA; its trailing alignment slice (Inkling2Attention, at
some TP sizes) has no adapter.
Source code in vllm/models/inkling2/nvidia/lora.py
_expert_lora_capable(module)
¶
Whether module is an Inkling2MoE whose experts take LoRA. The
NVFP4 / MXFP8 experts do not, so their MoE is no LoRA target and only the
attention takes adapters.
Source code in vllm/models/inkling2/nvidia/lora.py
add_linear_lora(layer, out, x, slices=None)
¶
Add layer's LoRA deltas for x to out in place, for callers
that run the base GEMM on layer.weight themselves
(Inkling2Attention). slices picks the output slices of a merged
layer (default: all), whose deltas land in out's leading columns, in
order. No-op when layer has no LoRA. For a row-parallel layer the
delta is, like the base output, this rank's partial sum.
Source code in vllm/models/inkling2/nvidia/lora.py
register()
¶
Let vLLM's LoRA manager wrap Inkling2MoE with
Inkling2MoEWithLoRA, and qkvr with Inkling2QKVRWithLoRA
(ahead of the generic variable-slice class, which would also match it).
Idempotent.