Skip to content

Commit fb53f59

Browse files
frreissminpeter
authored andcommitted
[Bugfix] Fix for issue 17396 (vllm-project#18773)
Signed-off-by: Fred Reiss <[email protected]> Signed-off-by: minpeter <[email protected]>
1 parent c0273a3 commit fb53f59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vllm/lora/ops/torch_ops/lora_ops.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ def bgmv_expand(inputs: torch.Tensor,
3636
if outputs.shape[0] == 1 and output_tensor.shape[0] != 1:
3737
limit = 1
3838

39+
# LoRA adapter and model may add different amounts of padding to output
40+
common_len = min(outputs.shape[1], output_tensor.shape[1])
41+
3942
if add_inputs:
40-
output_tensor[:, :outputs.shape[1]] += outputs[:limit, :]
43+
output_tensor[:, :common_len] += outputs[:limit, :common_len]
4144
else:
42-
output_tensor[:, :outputs.shape[1]] = outputs[:limit, :]
45+
output_tensor[:, :common_len] = outputs[:limit, :common_len]
4346

4447

4548
def sgmv_shrink(

0 commit comments

Comments
 (0)