From e51e700470cd04dbb25cb470571882dcbfed2a8a Mon Sep 17 00:00:00 2001 From: lcheng Date: Tue, 23 Jun 2026 22:08:33 +0800 Subject: [PATCH] [LoRA] Gate all_gather on fully_sharded_loras inside _mcp_apply; rewrite regression test (#45715) Signed-off-by: lcheng Signed-off-by: Jee Jee Li Co-authored-by: Jee Jee Li Co-authored-by: Jee Jee Li --- vllm/lora/layers/column_parallel_linear.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vllm/lora/layers/column_parallel_linear.py b/vllm/lora/layers/column_parallel_linear.py index 4df468a2753..12151699ac4 100644 --- a/vllm/lora/layers/column_parallel_linear.py +++ b/vllm/lora/layers/column_parallel_linear.py @@ -22,10 +22,10 @@ from .utils import _fully_sharded_can_replace, _not_fully_sharded_can_replace def _mcp_apply(x, bias, layer: "ColumnParallelLinearWithLoRA"): - """ - For `ColumnParallelLinearWithLoRA` or classes that inherit from - `ColumnParallelLinearWithLoRA`, they share the same `apply` logic. - """ + """Fully-sharded (S-LoRA) apply path for column-parallel LoRA layers.""" + assert layer.lora_config.fully_sharded_loras, ( + "_mcp_apply is only used for fully sharded LoRA" + ) assert ( layer.n_slices == len(layer.lora_a_stacked) @@ -341,7 +341,7 @@ class MergedColumnParallelLinearWithLoRA(ColumnParallelLinearWithLoRA): and base_forward is not merged_forward ): return self._apply_base_forward(x) - return _mcp_apply(x, bias, self) + return super().apply(x, bias) @classmethod def can_replace_layer(