-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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] fail to load LoRA weights, fail to load LoRA weights in 4-bit, fail to generate text with LoRA in 8-bit, UnboundLocalError: local variable 'new_module' referenced before assignment, ValueError: We need an offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'
#383
Comments
I found this maybe relevant:
|
I tried without the "--gptq-bits 4", that failed with another error:
|
offload_dir
offload_dir
offload_dir
Did you manage to find a solution? |
Yes (but no). I tried to load in 8-bit mode: In my opinion, this is not always the preferred solution, as it requires 8G VRAM, which is not possible for some users. EDIT:
|
offload_dir
offload_dir
offload_dir
offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'
offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'
offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'
I found a way to load a chat finetuned model, although it is not alpaca, it is still very good.
|
@wywywywy change the in Linux fixed @BadisG added those 2 instructions on the
|
Good fix thank you. It worked. But I wonder why not everybody faces the same problem? Other people can GPTQ 4bit without modifying |
offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'
And i thank @BadisG
I got my 4-bit weights from here: |
offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'offload_dir
, AttributeError: 'NoneType' object has no attribute 'device'
have any of you tested https://huggingface.co/chansung/alpaca-lora-30b? |
Yes I did some limited testing of the 30b Lora on a 3090 in GPTQ 4bit about an hour ago and it seems to work well. |
maybe this information needs to be in a pull request, as its difficult to find. |
I agree and the patch is at this time for the peft module, not for this repo, so someone would have to open a PR for |
Here is an example output of the 30b in GPTQ 4bit with the 30b Lora.
And these are the parameters that I used:
And this is the performance on a RTX3090 + Ryzen 5900x + 32GB RAM on Win 11, Python 3.10, CUDA 11.8 (with the Cudnn DLL files replaced in torch).
|
I'm stuck with this message too... Any solution to fix for Lora in 8bit mode? |
I think I'm running into this bug huggingface/peft#115 (comment) Looks like I may need to modify PeftModel.from_pretrained or PeftModelForCausalLM but I'm not sure where... |
are you splitting the model in a multi-gpu setup? |
no. |
Yeah I think that's my problem... Looks like this guy may have done it... something about autocast? huggingface/peft#115 (comment)
|
with I have tested and all 3 errors are gone (for me, with this peft fix), FIX:
|
Actually I have my doubts whether this fix actually does anything. Sure it stops the crashing, but it's not doing a find&replace anymore. This is because it tries to find all the So does the Lora even do anything at all in this case?! |
Me too. I think textgen/modules/LoRA.py could be patched, to output the models layers before applying the LoRA and after applying the LoRA. |
It's hard to compare by VRAM because LoRA doesn't use much. I'm pretty sure there's no explicit support from Here below are some comparisons of LoRA. 4bit without Lora
4bit with Lora (probably not actually using Lora?)
8bit without Lora
8bit with Lora (should actually be working)
|
There's additional discussion of whether this |
Thank you. I will close here. |
FIX:
https://rentry.org/i3qzn
Describe the bug
I have the following errors when loading in 4-bit mode with
--gptq-bits 4
,when loading LoRA weights and when loading LoRA weights in 8-bit mode with
--load-in-8bit
This one is alpaca lora:
https://huggingface.co/Yoshiii/alpaca.git
loras/alpaca/README.md
loras/alpaca/adapter_config.json
loras/alpaca/adapter_model.bin
Is there an existing issue for this?
Reproduction
Screenshot
No response
Logs
System Info
The text was updated successfully, but these errors were encountered: