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

[General Quant Linear] Register quant params of general quant linear for friendly post process. #226

Merged
merged 1 commit into from
Aug 4, 2023
Merged
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
9 changes: 4 additions & 5 deletions auto_gptq/nn_modules/qlinear/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def __init__(self, quant_linear_module):
out_features=quant_linear_module.outfeatures,
bias=True
)

self.infeatures = quant_linear_module.infeatures
self.outfeatures = quant_linear_module.outfeatures
self.bits = quant_linear_module.bits
Expand All @@ -18,15 +17,15 @@ def __init__(self, quant_linear_module):
self.weight.requires_grad = False

self.weight.data = quant_linear_module.qweight
self.qweight = self.weight
self.register_buffer('qweight', quant_linear_module.qweight)
self.bias.data = quant_linear_module.bias

self.qweight.requires_grad = False
self.bias.requires_grad = False

self.qzeros = quant_linear_module.qzeros
self.scales = quant_linear_module.scales
self.g_idx = quant_linear_module.g_idx
self.register_buffer('qzeros', quant_linear_module.qzeros)
self.register_buffer('scales', quant_linear_module.scales)
self.register_buffer('g_idx', quant_linear_module.g_idx)

if hasattr(quant_linear_module, "wf"):
self.wf = quant_linear_module.wf
Expand Down