-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Raise a warning when nn.Module
instance is saved with save_hyperparameters()
#12068
Conversation
nn.Module
with save_hyperparameters()
It's probably ok to do this, but we should stop here. There are many other parameter type that may or may not be desired to serialize, however we can't do the guess work for everything. Note: If we go with this PR, there is no way for the user to force what is being ignored here. I hesitate to accept here, because normally we shouldn't make such assumptions for the user (the framework should not be limiting them). |
I agree, my idea here was to avoid only I was running t5-small, and it got stuck due to this, with no errors at all, so it was hard to figure out what went wrong here until I did some debugging with @krshrimali . We can mention this inside docstrings if required. |
I'm also hesitant about this.
What if we focus instead on notifying the user about the associated problems? We can suggest excluding the keys with |
well, that's a good suggestion. works for me since it will happen during init. If everyone agrees on this, I'll update the PR :) |
nn.Module
with save_hyperparameters()
nn.Module
instance is saved with save_hyperparameters()
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.
LGTM, thanks Rohit!
What does this PR do?
Addresses: #11834 (comment)
nn.Module
s are not hparams and when someone uses LM as systems, they might forget to ignore the arguments and they will be saved inside hparams thus will increase the size of the checkpoint.Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃
cc @Borda