Closed AEProgrammer closed 7 months ago
Indeed the issue is that AdaLoRA has determined that layer to have such low importance that its rank is reduced to 0. Probably that means some hyper-parameters should be changed to avoid getting into this situation.
Now that you have the trained model, I wonder, however, if we could theoretically allow rank 0 or if something else would break later on. Could you please try something: Could please comment out the check in lines 41-42 of /root/miniconda3/envs/llama_factory/lib/python3.10/site-packages/peft/tuners/adalora/layer.py
and see if the model works correctly?
Indeed the issue is that AdaLoRA has determined that layer to have such low importance that its rank is reduced to 0. Probably that means some hyper-parameters should be changed to avoid getting into this situation.
Now that you have the trained model, I wonder, however, if we could theoretically allow rank 0 or if something else would break later on. Could you please try something: Could please comment out the check in lines 41-42 of
/root/miniconda3/envs/llama_factory/lib/python3.10/site-packages/peft/tuners/adalora/layer.py
and see if the model works correctly?
I am very glad to get your reply. As you said, the modification will be effective. I got model works correctly and get the right inference results. But in my own dataset, adalora's test metrics were much lower than lora's,I wonder if there's something wrong with my training parameters or something else. I use huggingface trainer and add "model.base_model.update_and_allocate(self.state.global_step)" after line 2022 to train the model with adalora. I don't know if it's right.
I am very glad to get your reply. As you said, the modification will be effective. I got model works correctly and get the right inference results.
Thanks for testing this. I created a PR to adjust the check so that rank 0 is allowed.
But in my own dataset, adalora's test metrics were much lower than lora's,I wonder if there's something wrong with my training parameters or something else.
Hard to say, as there are many hyper-parameters associated with AdaLoRA that could be tweaked. I don't have any practical experience with it.
I use huggingface trainer and add "model.base_model.update_and_allocate(self.state.global_step)" after line 2022 to train the model with adalora. I don't know if it's right.
Not sure what line you're referring to, but the idea would be to call this at the end of each training step, like in this example.
System Info
transformers
version: 4.38.2Who can help?
No response
Information
Tasks
examples
folderReproduction
Expected behavior
when i load a adalora weights,i got the error:
this is my rank_pattern some layers are all false in rank_pattern might lead to this error? hope some one can help me!~