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 torch_dtype override #25894

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Changes from 2 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
10 changes: 5 additions & 5 deletions src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2578,11 +2578,11 @@ def from_pretrained(
if quantization_method_from_config == QuantizationMethod.GPTQ:
quantization_config = GPTQConfig.from_dict(config.quantization_config)
config.quantization_config = quantization_config
logger.info(
f"Overriding torch_dtype={torch_dtype} with `torch_dtype=torch.float16` due to "
"requirements of `auto-gptq` to enable model quantization "
)
torch_dtype = torch.float16
if torch_dtype is None:
torch_dtype = torch.float16
else:
logger.info("`We suggest you to set torch_dtype=torch.float16` for better efficiency with GPTQ.")
SunMarc marked this conversation as resolved.
Show resolved Hide resolved

quantizer = GPTQQuantizer.from_dict(quantization_config.to_dict())

if (
Expand Down
Loading