-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[WIP] Add LoRA multihead attention module #1324
base: main
Are you sure you want to change the base?
[WIP] Add LoRA multihead attention module #1324
Commits on Jan 5, 2024
-
[WIP] Add LoRA multihead attention module
For now, only works with _qkv_same_embed_dim=True.
Configuration menu - View commit details
-
Copy full SHA for 49fab86 - Browse repository at this point
Copy the full SHA 49fab86View commit details -
Configuration menu - View commit details
-
Copy full SHA for d8e9589 - Browse repository at this point
Copy the full SHA d8e9589View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e188a3 - Browse repository at this point
Copy the full SHA 0e188a3View commit details -
Remove assignment of weight to new module
This is no longer necessary when unloading the model because the base_layer is already the original layer. This is just a leftover from before we adopted the base_layer pattern.
Configuration menu - View commit details
-
Copy full SHA for b409d81 - Browse repository at this point
Copy the full SHA b409d81View commit details -
Make state_dict and named_parameters work
There was a bug because the removal of the parameter resulted in it no longer appearing in the state_dict and named_parameters. This commit fixes this bug. The bug also exists in the referenced lora-torch library.
Configuration menu - View commit details
-
Copy full SHA for 173062c - Browse repository at this point
Copy the full SHA 173062cView commit details
Commits on Jan 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1e007f5 - Browse repository at this point
Copy the full SHA 1e007f5View commit details
Commits on Jan 9, 2024
-
Clean ups after reviewer feedback:
- Some clarifying comments - Remove fan_in_fan_out Also: - Raise proper error instead of assert
Configuration menu - View commit details
-
Copy full SHA for 557c4a1 - Browse repository at this point
Copy the full SHA 557c4a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for add1f51 - Browse repository at this point
Copy the full SHA add1f51View commit details -
Configuration menu - View commit details
-
Copy full SHA for e44e030 - Browse repository at this point
Copy the full SHA e44e030View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d62579 - Browse repository at this point
Copy the full SHA 8d62579View commit details
Commits on Jan 12, 2024
-
Apply LoRA also to the out_proj of MHA
Before, LoRA was applied only to the in_proj. Now it is also applied to the out_proj. Unfortunately, there is no easy way to just apply a normal lora.Linear to the out_proj by targeting it with target_modules. If that worked, it would be much nicer to do that, so that users can decide for themselves if they want to apply LoRA to the out_proj or not. The reason why it doesn't work is twofold: 1. We cannot really control the order in which LoRA is applied, so when the LoRA adapter is injected to out_proj, the whole MHA layer may already be wrapped by lora.MultiheadAttention. 2. Even if we successfully applied a normal lora.Linear to the out_proj, it would not work correctly. This is because the forward method of out_proj is not used at all by nn.MultiheadAttention. Instead, it just passes the weight and bias to F.multi_head_attention_forward. Therefore, we must ensure that the weights are merged and unmerged correctly, same as for in_proj, and we cannot do that if we use a normal lora.Linear. Note that the test test_merge_layers for MHA fails. This is most likely because of an existing bug in now merging is implemented, see PR huggingface#1355. Once that is merged, the test should pass.
Configuration menu - View commit details
-
Copy full SHA for c5d8a6b - Browse repository at this point
Copy the full SHA c5d8a6bView commit details
Commits on Feb 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9dc4a4d - Browse repository at this point
Copy the full SHA 9dc4a4dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c3fb2ce - Browse repository at this point
Copy the full SHA c3fb2ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 17d407b - Browse repository at this point
Copy the full SHA 17d407bView commit details
Commits on Feb 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4cbf6e9 - Browse repository at this point
Copy the full SHA 4cbf6e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e0cae11 - Browse repository at this point
Copy the full SHA e0cae11View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52c8d9b - Browse repository at this point
Copy the full SHA 52c8d9bView commit details
Commits on Mar 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 977c84b - Browse repository at this point
Copy the full SHA 977c84bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96d376d - Browse repository at this point
Copy the full SHA 96d376dView commit details
Commits on Mar 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0c17476 - Browse repository at this point
Copy the full SHA 0c17476View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b8db0c - Browse repository at this point
Copy the full SHA 4b8db0cView commit details
Commits on May 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7e91712 - Browse repository at this point
Copy the full SHA 7e91712View commit details
Commits on Jul 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e12070b - Browse repository at this point
Copy the full SHA e12070bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b6c7cb - Browse repository at this point
Copy the full SHA 7b6c7cbView commit details -
Raise error for multi adapter batch inference
Not trivial to implement for MHA
Configuration menu - View commit details
-
Copy full SHA for e6ab8ed - Browse repository at this point
Copy the full SHA e6ab8edView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ec6c3c - Browse repository at this point
Copy the full SHA 8ec6c3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f6ba465 - Browse repository at this point
Copy the full SHA f6ba465View commit details
Commits on Jul 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for fb18886 - Browse repository at this point
Copy the full SHA fb18886View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ff2ec3 - Browse repository at this point
Copy the full SHA 4ff2ec3View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1f6ab2 - Browse repository at this point
Copy the full SHA d1f6ab2View commit details
Commits on Sep 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 65363be - Browse repository at this point
Copy the full SHA 65363beView commit details
Commits on Sep 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7ba2e68 - Browse repository at this point
Copy the full SHA 7ba2e68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ef04b0 - Browse repository at this point
Copy the full SHA 6ef04b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 07c7240 - Browse repository at this point
Copy the full SHA 07c7240View commit details -
There was a situation were loading the state dict would fail and require a workaround. For this, there was an xfail-ing test with strict=True. This test no longer fails, so the marker has been removed, as well as the test with the workaround.
Configuration menu - View commit details
-
Copy full SHA for cc3ac3d - Browse repository at this point
Copy the full SHA cc3ac3dView commit details
Commits on Sep 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 03c466f - Browse repository at this point
Copy the full SHA 03c466fView commit details
Commits on Sep 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e558caa - Browse repository at this point
Copy the full SHA e558caaView commit details -
ENH BOFT don't save boft_P buffer (huggingface#2050)
The buffer does not need to be part of the checkpoint, by making it non-persistent, the file size can be greatly reduced.
Configuration menu - View commit details
-
Copy full SHA for 38f4a98 - Browse repository at this point
Copy the full SHA 38f4a98View commit details -
FIX Command line args in PiSSA preprocess (huggingface#2053)
Fix bug in parsing command line arguments in the PiSSA preprocess.py script from the PiSSA example.
Configuration menu - View commit details
-
Copy full SHA for 7e5c61d - Browse repository at this point
Copy the full SHA 7e5c61dView commit details -
MNT Update deprecated evaluation_strategy (huggingface#1664)
In docs and examples, use eval_strategy instead of evaluation_strategy, which is deprecated.
Configuration menu - View commit details
-
Copy full SHA for 183bf52 - Browse repository at this point
Copy the full SHA 183bf52View commit details -
ENH Multi adapters in same batch: modules_to_save (huggingface#1990)
Extend the functionality of having different adapters in the same batch to also work with `modules_to_save`.
Configuration menu - View commit details
-
Copy full SHA for b970607 - Browse repository at this point
Copy the full SHA b970607View commit details -
FIX Bug that prevents BOFT from loading 2 adapters (huggingface#2068)
There was a bug in BOFT that made it impossible in some circumstances to load more than one adapter (creating more than 1 adapter was possible though). This was because a code path that adjusts boft_n_butterfly_factor was only visited when creating a fresh adapter, but not when updating with the 2nd adapter. This was fixed by moving this code path from the BOFT layer's __init__ method to update_layer. A test for loading multiple adapters was added. Since this was a gap in our test suite, this test will be applied to all appropriate PEFT methods, not only BOFT, but the others methods are all passing without needing further changes. For good measure, I also added BOFT to the test suite that checks multiple active adapters. These tests would have also passed without the fix in this PR, since these tests do not load multiple adapters but instead create them, which always worked. Still it's better to have these tests as well.
Configuration menu - View commit details
-
Copy full SHA for 732e8e7 - Browse repository at this point
Copy the full SHA 732e8e7View commit details -
TST Skip some quantization tests on XPU (huggingface#2074)
Eetq/hqq/aqlm don't support XPU yet.
Configuration menu - View commit details
-
Copy full SHA for 79e2b38 - Browse repository at this point
Copy the full SHA 79e2b38View commit details -
Configuration menu - View commit details
-
Copy full SHA for 61e6934 - Browse repository at this point
Copy the full SHA 61e6934View commit details
Commits on Oct 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for ced2f15 - Browse repository at this point
Copy the full SHA ced2f15View commit details
Commits on Oct 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4c31bbc - Browse repository at this point
Copy the full SHA 4c31bbcView commit details
Commits on Oct 22, 2024
-
Params need to be re-registered to appear in state dict.
Configuration menu - View commit details
-
Copy full SHA for 1dbb9a5 - Browse repository at this point
Copy the full SHA 1dbb9a5View commit details