-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
AttributeError: 'HQQLinear' object has no attribute 'weight' #30727
Comments
Hi @mxjmtxrm |
It is my own model based on hf llama2 7B. I just modify the bias of qkv proj is True. So the pretrained ckpt contains |
I use the distil-whisper model. I'm getting the same error. BitsAndBytesConfig optimization method works. HQQ method gives error. |
Can you check? |
Can you share a code snippet to reproduce this please? |
Thanks everyone ! Indeed I was able to repro with: from transformers import AutoModelForSpeechSeq2Seq, HqqConfig
model_id = "distil-whisper/distil-large-v2"
quant_config = HqqConfig(nbits=1, group_size=64, quant_zero=False, quant_scale=False, axis=0)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, quantization_config=quant_config, device_map="cuda")
print(model) |
Fixed it, will do a PR right now. |
Awesome, thanks ! |
System Info
transformers
version: 4.41.0.dev0Who can help?
@SunMarc and @younesbelkada
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
When I load model with HQQ quantization config, I met the following error:
It seems that there is a bug in
quantizer_hqq.py
:In the above code, it should check if the tensor_name is 'bias'. Otherwise the layer will be replace by HQQlinear if the tensor_name is bias.
How to solve this problem?
Expected behavior
--
The text was updated successfully, but these errors were encountered: