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

[FIX] allow auto_round lm_head quantization #282

Merged
merged 2 commits into from
Jul 23, 2024
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
5 changes: 2 additions & 3 deletions gptqmodel/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ def quantize(
logger.warning("According to the issue https://github.com/ModelCloud/GPTQModel/issues/278, transformers version 4.43.0 has broken batch_size. until the issue is resolved, hard set the batch_size to 1.")
batch_size = 1

# TODO: lm_head quantization is yet ready but pending
if self.quantize_config.lm_head:
raise ValueError("lm_head quantization is currently inference only and not applicable for quantization. Please set `lm_head=False`.")
if self.quantize_config.lm_head and not isinstance(self.quantize_config, AutoRoundQuantizeConfig):
raise ValueError("`lm_head=True` quantization is only available with AutoRound quantizer. Please use `AutoRoundQuantizeConfig` instead of `QuantizeConfig` and set `lm_head=True` or set `lm_head=False`.")

if len(calibration_dataset) == 0:
raise ValueError("Calibration dataset must not be empty.")
Expand Down
Loading