CHORE: Clean up config kwargs in custom model tests #2736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #2695
For some PEFT methods, there was a bit of a mess when it comes to how the
init_weightsargument was set intest_custom_models.py. The defaultkwargsfor the tests should be that the PEFT method is initialized as an identity transform, and for specific tests we want to disable that. Note that most PEFT methods are initialized by default to be identity transforms, which is why the argument does not need to be set explicitly, but it's not true for all PEFT methods.With this PR, SHiRA, C3A, and FourierFT are now initialized to be consistent with this. This made it possible to remove some extra handling of those methods which was intermingled with certain tests.
Moreover, in the appropriate places, I did the following:
set_init_weights_falsehelper functioninit_weightsarguments of these PEFT methodstest_unload_adapter, simplified a config type check and rewrote it to load the base model only once