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

Add special Parameters modules support #519

Merged
merged 7 commits into from
Jul 13, 2022

Conversation

younesbelkada
Copy link
Contributor

This PR supports adding special Parameter modules when calling the context manager init_empty_weights that force assign the weights of each module into nn.Parameter module. For some specific usecases we might want to replce it with other modules such as bnb.Int8Params from bitsandbytes

Related PR: huggingface/transformers#17901
Related discussion: huggingface/transformers#17901 (comment)

cc @sgugger @TimDettmers

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 13, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me as it doesn't change anything for regular parameters! Thanks!

src/accelerate/big_modeling.py Outdated Show resolved Hide resolved
@sgugger sgugger merged commit 7e65937 into huggingface:main Jul 13, 2022
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.

4 participants