-
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
Deprecate LightningModule.model_size #8495
Deprecate LightningModule.model_size #8495
Conversation
Hello @roshikouhai! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-07-30 13:19:42 UTC |
Codecov Report
@@ Coverage Diff @@
## master #8495 +/- ##
======================================
Coverage 88% 88%
======================================
Files 168 168
Lines 13968 13975 +7
======================================
+ Hits 12337 12344 +7
Misses 1631 1631 |
56347e2
to
f973644
Compare
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 working on this @roshikouhai !
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 !
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 so, pls replace all usage in the codebase...
24c5437
to
f7c5025
Compare
Rebased on top of #8500. I tried updating test_quantization.py to use the new get_model_size() helper function but as @calebrob6 states, it currently doesn't work for models with sparse tensors which the tests have. Not sure if I should leave it be or find a way to implement the sparse tensors in this PR. |
@roshikouhai, an alternate way to do
I preferred to not do it this way as this will use quite a bit of RAM. Would you like me to look into how to implement getting the size of the sparse tensors as well? |
@roshikouhai @calebrob6 - as the primary motivation for the PR is to remove this function off the core LightningModule API, what do you think about this sequencing?
|
Given the goal of this PR is to deprecate model_size from LightningModule, I vote towards this option and allow @calebrob6 the time he needs to implement the model_size for sparse tensors. |
c40a88a
to
36b82f6
Compare
f664973
to
ec3240b
Compare
24df7b6
to
2f20b65
Compare
2f20b65
to
0fde7c6
Compare
@Borda do you see any remaining issues? is this good to go? |
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.
fixed the remaining
… utilities/memory.py
for more information, see https://pre-commit.ci
c068089
to
390c2c1
Compare
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.
Pushed a commit to call the new function from the old one
What does this PR do?
This PR deprecates the model_size property in LightningModule as discussed and agreed in #8343
Does your PR introduce any breaking changes ? If yes, please list them.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
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 🙃