How to train multiple LoRA at the same time, then esemble outputs to make prediction? #2303
Unanswered
ngocquanai
asked this question in
Q&A
Replies: 1 comment
-
Could you describe in more detail what exactly is not working? One common issue users have with this type of training is that the optimizer is not aware of all the LoRA parameters when it is initialized. So e.g. if you do:
and at this time, only LoRA adapter 0 is active, then the optimizer does not know about adapter 1, 2, etc. and will not update them. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I want to train k LoRA at the same time, with the same 1 base_model. For example, in my forward_logits function, I loop over self.adapter_names, then for each adapter, I use self.set_adapter(adapter) and forward through model and get corresponding output. After for loop, I concat these prediction to return a 3d tensor with shape (number of lora adapters, batchsize, dimension)
In fit function, I average the output of forward_logits function above along dimension 0, then I want to turn on all adapters at the same time to train all of them using self.set_adapter(self.adapter_names).
I think this idea will work correctly, but when evaluating I find that it does not work. Can anyone help me, thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions