fix: add noop in TensorParallelAdapterRowLinear too

This commit is contained in:
drbh 2024-06-24 22:06:04 +00:00
parent 3c9b28eaec
commit c927cffbf7

View File

@ -258,6 +258,9 @@ class TensorParallelAdapterRowLinear(LoraLinear):
) -> torch.Tensor:
result = self.base_layer(input)
if self.layer_name is None:
return result
# Fused all-gather + all-reduce from S-LoRA paper: https://arxiv.org/abs/2311.03285
stride = result.shape[-1] // self.process_group.size()
start_idx = self.process_group.rank() * stride