-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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: 'torch.dtype' object has no attribute 'element_size' #30304
Comments
Hi @ashmalvayani |
It seems that there is still a problem in Transformers (see huggingface/peft#1635) transformers/src/transformers/modeling_utils.py Lines 1164 to 1166 in 28a2283
It can be resolved after this pr is merged |
Please find below the complete traceback:
|
Upgrading the torch to 2.1.0, with this command: and changing the flash attention installation via this:
fixed both the issue of element_size and bf16 was solved. However, I think it's a work around and not the actual fix. I could be wrong, can you please let me know? |
I had the same issue with the transformers line that you mentioned. I managed to fix it using the solution from the issue you highlighted, but I'm not entirely sure if it will work properly since the fix only involved setting a constant. |
I see how there was a solution of manually adding a helper function like this quant_storage = self.hf_quantizer.quantization_config.bnb_4bit_quant_storage However, the current line you've highlighted "Lines 1164 to 1166" is the issue where the quant_storage neither has the item_size and neither has the element_size (in earlier and later versions of transformers respectively). |
System Info
transformer version: 4.40.0.dev
python version: 3.10
torch: 2.0.1 cu11.7
I am fine-tuning https://huggingface.co/CohereForAI/c4ai-command-r-v01 model with axolotl framework. The config lora.yaml file is as follows:
To reproduce, install the axolotl environment and run the following:
The problem exists when I run the quantized model in 4 bit, in 8 bit it does not have any issues and run smoothly.
Who can help?
@pacman100 @SunMarc @younesbelkada
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
It should start the training, but in 4_bit quantization qlora it's causing error.
The text was updated successfully, but these errors were encountered: