From a1f53addb132f75704710184f4c1cc4780343329 Mon Sep 17 00:00:00 2001 From: Runkai Tao <129432511+RunkaiTao@users.noreply.github.com> Date: Thu, 26 Feb 2026 13:03:10 -0500 Subject: [PATCH] [BugFix] Align fused MoE-LoRA kernel config with actual weight shapes (#34396) Signed-off-by: Runkai Tao --- vllm/lora/layers/fused_moe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vllm/lora/layers/fused_moe.py b/vllm/lora/layers/fused_moe.py index e08dcc87e..c13ed44e6 100644 --- a/vllm/lora/layers/fused_moe.py +++ b/vllm/lora/layers/fused_moe.py @@ -83,7 +83,11 @@ class FusedMoEWithLoRA(BaseLayerWithLoRA): ): if envs.VLLM_TUNED_CONFIG_FOLDER: hidden_size = layer.hidden_size - intermediate_size = layer.intermediate_size_per_partition + intermediate_size = ( + self.w2_lora_a_stacked[0].shape[-1] + if op_prefix == "w2" + else self.w13_lora_b_stacked[0].shape[-2] + ) shrink_config = get_lora_op_configs( op_type=f"fused_moe_lora_{op_prefix}_shrink", max_loras=num_loras,