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

remove bias exporting if possible in autogptq format #375

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions auto_round/export/export_to_autogptq/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def pack_layer(name, model, layer_config, backend, pbar):
in_features = layer.weight.shape[0]
out_features = layer.weight.shape[1]

##bias = layer.bias is not None and torch.any(layer.bias)
bias = True ## if using the above, llama3 lambada RTN will be NAN , TODO why?
bias = layer.bias is not None
##bias = True ## if using the above, llama3 lambada RTN will be NAN , TODO why?
new_layer = QuantLinear( ##pylint: disable=E1123
bits, group_size, in_features, out_features, bias, weight_dtype=layer.weight.dtype
)
Expand Down
2 changes: 1 addition & 1 deletion auto_round/export/export_to_autoround/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def pack_layer(name, model, layer_config, backend, pbar):
elif isinstance(layer, transformers.pytorch_utils.Conv1D):
in_features = layer.weight.shape[0]
out_features = layer.weight.shape[1]
bias = layer.bias is not None and torch.any(layer.bias)
bias = layer.bias is not None

if "awq" not in backend:
new_layer = QuantLinear( ##pylint: disable=E1123
Expand Down
Loading