-
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
Fix find_tied_params
for models with shared layers
#2986
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. |
Added a test case that fails
|
CI error looks unrelated:
@SunMarc, its ready for review |
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.
Thanks for fixing the issue @qubvel ! LGTM ! Just a nit !
Can you have a second look @muellerzr ? |
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.
Thanks! I like this simplicity and thanks for adding the test. A few suggestions for clarity
@@ -616,7 +616,73 @@ def check_tied_parameters_on_same_device(tied_params, device_map): | |||
) | |||
|
|||
|
|||
def find_tied_parameters(model: nn.Module, **kwargs): | |||
def _get_named_modules( |
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.
If we're documenting it in this way, we should make this public :)
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.
not sure you need it public :) its just copied form PyTorch code
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.
I removed Example
for this docstring, not sure it is needed for a private method, and also doc-builder was raising an error (commit #952324c)
Co-authored-by: Zach Mueller <[email protected]>
@SunMarc I suppose it can be merged! |
Yes indeed, thanks @qubvel ! |
What does this PR do?
Fixes #2984
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@SunMarc