@@ -131,3 +120,133 @@ class KMoEGate(BaseInjectedModule, KMoEGateBase):
...
@@ -131,3 +120,133 @@ class KMoEGate(BaseInjectedModule, KMoEGateBase):
self.weight=None
self.weight=None
ifself.e_score_correction_biasisnotNone:
ifself.e_score_correction_biasisnotNone:
self.e_score_correction_bias=None
self.e_score_correction_bias=None
# adapted from https://github.com/vllm-project/vllm/blob/c77620d22d43daa7e0440e6267cbdd83f849ac64/vllm/model_executor/layers/fused_moe/fused_moe.py#L1071
# This is used by the Deepseek-V2 and Deepseek-V3 model