"vscode:/vscode.git/clone" did not exist on "6881107948c00a8564bc2fa85308f6fc2f065d64"
Unverified Commit 61fed92c authored by ZincCat's avatar ZincCat Committed by GitHub
Browse files

[Bugfix] Fix ColumnParallelLinearWithLoRA slice (#11708)


Signed-off-by: default avatarZincCat <zincchloride@outlook.com>
parent 80c751e7
...@@ -479,7 +479,7 @@ class ColumnParallelLinearWithLoRA(BaseLinearLayerWithLoRA): ...@@ -479,7 +479,7 @@ class ColumnParallelLinearWithLoRA(BaseLinearLayerWithLoRA):
# ColumnParallelLinear. # ColumnParallelLinear.
else: else:
tensor_model_parallel_rank = get_tensor_model_parallel_rank() tensor_model_parallel_rank = get_tensor_model_parallel_rank()
shard_size = self.output_dim shard_size = self.output_size
start_idx = tensor_model_parallel_rank * shard_size start_idx = tensor_model_parallel_rank * shard_size
end_idx = (tensor_model_parallel_rank + 1) * shard_size end_idx = (tensor_model_parallel_rank + 1) * shard_size
lora_b = lora_b[:, start_idx:end_idx] lora_b = lora_b[:, start_idx:end_idx]
...@@ -490,7 +490,7 @@ class ColumnParallelLinearWithLoRA(BaseLinearLayerWithLoRA): ...@@ -490,7 +490,7 @@ class ColumnParallelLinearWithLoRA(BaseLinearLayerWithLoRA):
if bias is None: if bias is None:
return bias return bias
tensor_model_parallel_rank = get_tensor_model_parallel_rank() tensor_model_parallel_rank = get_tensor_model_parallel_rank()
shard_size = self.output_dim shard_size = self.output_size
start_idx = tensor_model_parallel_rank * shard_size start_idx = tensor_model_parallel_rank * shard_size
end_idx = (tensor_model_parallel_rank + 1) * shard_size end_idx = (tensor_model_parallel_rank + 1) * shard_size
bias = bias[start_idx:end_idx] bias = bias[start_idx:end_idx]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment