Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Set linear_weights directly on the layer #3977

Merged
merged 9 commits into from
Apr 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
Yard1 authored Apr 10, 2024
commit 3b46ae5e73062aefd02c17e033aaef8e9a035140
6 changes: 3 additions & 3 deletions vllm/model_executor/layers/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def __init__(
for name, weight in linear_weights.items():
if isinstance(weight, torch.Tensor):
self.register_parameter(name, weight)
self._linear_weights_names.append(name)
self._linear_weights_names.append(name)
if bias:
self.bias = Parameter(
torch.empty(self.output_size, dtype=self.params_dtype))
Expand Down Expand Up @@ -195,7 +195,7 @@ def __init__(
if isinstance(weight, torch.Tensor):
self.register_parameter(name, weight)
set_weight_attrs(weight, {"weight_loader": self.weight_loader})
self._linear_weights_names.append(name)
self._linear_weights_names.append(name)
if bias:
self.bias = Parameter(
torch.empty(self.output_size_per_partition,
Expand Down Expand Up @@ -550,7 +550,7 @@ def __init__(
if isinstance(weight, torch.Tensor):
self.register_parameter(name, weight)
set_weight_attrs(weight, {"weight_loader": self.weight_loader})
self._linear_weights_names.append(name)
self._linear_weights_names.append(name)

if not reduce_results and (bias and not skip_bias_add):
raise ValueError("When not reduce the results, adding bias to the "
Expand Down
Loading