-
Notifications
You must be signed in to change notification settings - Fork 1k
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
handle weight sharing with init_on_device #2737
base: main
Are you sure you want to change the base?
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aws-rhsoln, thanks for the PR ! Could you add a few tests ? Also, could you explain in which context you needed that ?
Hi @aws-rhsoln, are you still planning to finish the PR ? Thanks ! |
I'll add some tests soon. Context for the change: For our pipeline parallel implementation here, we first create the model and then trace it, use the traced model to partition for PP. Now we create the model using meta-device and then copy the weights into device after PP init. When copying weights, if we have shared weights such that |
Awesome ! Thanks for the update ! |
What does this PR do?
This PR handles the case when we are using meta_device and have tied weights. During model init, when we have a case, where
weight2 = weight1
, this would result in register_param getting called again. This call will re-init the param instead of using weight1. This will result in relationship between the weights getting lost.Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.