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 maximum seqlen for gptq quantization #1748

Merged
merged 1 commit into from
Mar 18, 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
3 changes: 2 additions & 1 deletion optimum/gptq/quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ def quantize_model(self, model: nn.Module, tokenizer: Optional[Any] = None):
self.use_cuda_fp16 = model.dtype == torch.float16

if self.model_seqlen is None:
self.model_seqlen = get_seqlen(model)
# We allow a max value of 4028 to avoid passing data with huge length to the model during the calibration step
self.model_seqlen = min(4028, get_seqlen(model))

device = get_device(model)

Expand Down
Loading