-
Notifications
You must be signed in to change notification settings - Fork 1.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
AdaLoRA: where does the Rankallocator work #432
Comments
I have double-checked the second issue, |
Thanks for pointing this out. I've also encountered some weird behavior when benchmarking for my Bachelor's Thesis. |
Where/how do you manually call it? |
I add the following code in https://github.com/huggingface/transformers/blob/v4.29.1/src/transformers/trainer.py#L2013 to explicitly call this allocate function . from peft import PeftModel
if isinstance(model, PeftModel):
if getattr(model.base_model, "update_and_allocate", None) is not None:
model.base_model.update_and_allocate(total_batched_samples) Besides this, you should also set corresponding |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. |
I found that this issue still exists in the current version. Can you share your code? Thank you very much! |
This issue still exists. Any suggestion on how to make @QingruZhang maybe? |
Note that PEFT does not contain training code, as such calling |
Hi, I have used
adalora
to do parameter-efficient fine-tuning for a while. It works very well and significantly better than the vanillalora
in my case. But recently I just found two issues.adalora
did not use the orthogonal regularization since its forward function in https://github.com/huggingface/peft/blob/main/src/peft/tuners/adalora.py#L216 can't be called. This happened when I used PeftModel to call adalora as below:I found the reason is that the
self.get_base_model()
inforward()
function of PeftModel did not point to the AdaLoraModel as base model. (https://github.com/huggingface/peft/blob/main/src/peft/peft_model.py#L300)The original code is as follows:
After modifying it as the following, it can use the AdaLoraModel
forward
function as expected.Rankallocator
inadalora
is called. If I understand correctly, this function is implemented indef update_and_allocate(self, global_step):
in https://github.com/huggingface/peft/blob/main/src/peft/tuners/adalora.py#L284. However, when I add a breakpoint here, the program will not stop. Maybe for this reason, I cannot find those masked rank (elements on some rank positions = 0) inlora_E
of the peft saved model.Anyone has idea on this issue? I really appreciate any help you can provide.
The text was updated successfully, but these errors were encountered: