@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 77a6bf07ae
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Bug] Fix Unexpected Keyword Argument 'w1_bias' (#22757)

Signed-off-by: yewentao256 <zhyanwentao@126.com>

Wentao Ye committed Aug 13, 2025 at 00:31 UTC 77a6bf07aedf132aad2b6719f6d87abc5d3311ab
1 file changed +13 -3
vllm/model_executor/layers/fused_moe/layer.py
+13 -3
@@ -475,12 +475,11 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, CustomOp):
475 activation=activation,
476 apply_router_weight_on_input=apply_router_weight_on_input)
477 else:
478 - return self.fused_experts(
478 + # add w1_bias/w2_bias to kwargs if they exist
479 + kwargs = dict(
480 hidden_states=x,
481 w1=layer.w13_weight,
482 w2=layer.w2_weight,
482 - w1_bias=layer.w13_bias if self.has_bias else None,
483 - w2_bias=layer.w2_bias if self.has_bias else None,
483 topk_weights=topk_weights,
484 topk_ids=topk_ids,
485 inplace=True,
@@ -489,6 +488,17 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, CustomOp):
488 global_num_experts=global_num_experts,
489 expert_map=expert_map,
490 )
491 + if isinstance(self.fused_experts,
492 + FusedMoEModularKernel) and self.has_bias:
493 + raise ValueError(
494 + "FusedMoEModularKernel does not support bias.")
495 + if self.has_bias:
496 + kwargs.update({
497 + "w1_bias": getattr(layer, "w13_bias", None),
498 + "w2_bias": getattr(layer, "w2_bias", None),
499 + })
500 +
501 + return self.fused_experts(**kwargs)
502
503 def forward_cpu(
504 self,