-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Deprecate variadic inputs of checkpoint_sequential #21006
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
Conversation
|
To test I fixed this problem by modifying |
torch/utils/checkpoint.py
Outdated
| # This interface will be changed at PyTorch 1.2.0. | ||
| # See also: https://github.com/pytorch/pytorch/issues/19260 | ||
| if not inputs: | ||
| warnings.warn('no input to checkpoint_sequential has been deprecated, ' |
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.
"no input" -> "giving no inputs"
"will be raised since PyTorch 1.2.0" -> "will be raised since PyTorch 1.3.0" (we need atleast 1 stable version to deprecate things, right now it is 1.1.0)
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.
Great feedback and fix. I also capitalized the warning message for multiple inputs just like "Giving no inputs". Thank you so much!
facebook-github-bot
left a comment
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.
@soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: To support variadic inputs of `checkpoint_sequential` was deprecated at #21006. This case should be warned with `DeprecationWarning` for PyTorch 1.2, but it should be simply failed with `TypeError` since PyTorch 1.3. This patch removes the `DeprecationWarning` for PyTorch 1.2. Pull Request resolved: #25985 Differential Revision: D18809875 Pulled By: albanD fbshipit-source-id: e84dd8629c04979c4b2dc63e8ada94292e8cedd0
Summary: To support variadic inputs of `checkpoint_sequential` was deprecated at pytorch#21006. This case should be warned with `DeprecationWarning` for PyTorch 1.2, but it should be simply failed with `TypeError` since PyTorch 1.3. This patch removes the `DeprecationWarning` for PyTorch 1.2. Pull Request resolved: pytorch#25985 Differential Revision: D18809875 Pulled By: albanD fbshipit-source-id: e84dd8629c04979c4b2dc63e8ada94292e8cedd0
I've reported inconsistency between
checkpoint_sequentialandnn.Sequentialat #19260. Both should provide the same input signature but they don't. I think the consistency is important and I agree with @apaszke thatnn.Sequential's semantics should be kept instead ofcheckpoint_sequential.I hope
checkpoint_sequentialraisesTypeErroron variadic arguments since PyTorch 1.2.0. But for now, it's okay just to warn asDeprecationWarning. I've talked about this approach with @soumith.Please review this pull request. Any comment will be my pleasure.