vllm.model_executor.layers.fused_moe.lora_experts_mixin ¶
LoRAExpertsMixin ¶
Mixin for FusedMoEExpertsModular subclasses that natively handle MoELoRAContext inside their apply() implementation.
Mixing this class in: - Flips supports_lora() to True so _can_fused_experts_support lets LoRA through the gate check. - Stashes a MoELoRAContext on the experts instance via set_lora_context(), which apply() consumes from self._lora_context. - Provides apply_w13_lora / apply_w2_lora helpers that dispatch to the PunicaWrapper kernels.
The helper methods are pure functions of their inputs; all required state is on lora_context or passed as arguments.
Source code in vllm/model_executor/layers/fused_moe/lora_experts_mixin.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |