Skip to content

Commit

Permalink
Fix ReplicatedLinear weight loading (vllm-project#6793)
Browse files Browse the repository at this point in the history
  • Loading branch information
qingquansong authored Jul 26, 2024
1 parent 2eb9f4f commit 062a1d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vllm/model_executor/layers/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,16 @@ def __init__(self,
self.input_size,
self.output_size,
self.params_dtype,
weight_loader=self.weight_loader,
prefix=prefix)

if bias:
self.bias = Parameter(
torch.empty(self.output_size, dtype=self.params_dtype))
set_weight_attrs(self.bias, {"output_dim": 0})
set_weight_attrs(self.bias, {
"output_dim": 0,
"weight_loader": self.weight_loader,
})
else:
self.register_parameter("bias", None)

Expand Down

0 comments on commit 062a1d0

Please sign in to comment.