Skip to content
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

Option for initializing adapters with identical weights #786

Open
wants to merge 60 commits into
base: main
Choose a base branch
from

Conversation

TimoImhof
Copy link
Contributor

@TimoImhof TimoImhof commented Jan 25, 2025

Adresses #653 and introduces an additional parameter in the adapter config that allows to fix a seed during adapter weights initialization for every layer.

This means that the seed is reset for every layer to the specified value, which leads to all adapter modules having the same weights upon initialization.

The PR adds this option as an additonal argument init_weights_seed in the adapter config and also provides an additional test that checks for identical weight initialization between multiple adapters and multiple models.

Closes #653

TimoImhof and others added 30 commits September 16, 2024 10:10
- reorder directory structure to separate testing models and adapter methods (needs further refactoring for separating tests that are extecuted for each model vs tests that are just run once)
- remove all model tests except albert for now (will be readded once final design is agreed on)
- refactor albert adapter test class to group test mixins in categories which are then displayed accordingly by test viewer
- adjust imports to reflect new directory structure
- refactor generate_test into base test class and adapt parallel generate test accordingly
- refactor lm head selection into own method
- create utils file for utility methods and adapt imports accordingly
- remove is_speech_model flags
- replace redundant attributes and methods
- enforce proper method naming conventions
- Re-add bart adapter method tests
- Remove duplicate added tests
- In conversion test refactor model specific if else statements into model test class
- deberta
- debertav2
- distilbert
- electra
- encoder-decoder
- llama
- mbart
- mistral
- mt5
- plbart
- roberta
- introduce parameter to cut down on makefile commands
- draw out tests that are not executed on every model into a seperate directory
- move the adapter method test implemenations into the method tests directory
- rename files for more clarity
@TimoImhof TimoImhof marked this pull request as ready for review January 27, 2025 21:03
@TimoImhof TimoImhof requested a review from calpt January 27, 2025 22:14
@TimoImhof TimoImhof changed the title Option for initializing adapters with the exact same weights Option for initializing adapters with identical weights Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seed for Adapter Initialization?
1 participant