-
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 the model_size
property on the LightningModule
#8343
Comments
Hryt @ananthsub, I think it is a good remark and it won t scale well with larger model. Best, |
Hi @ananthsub |
I noticed the sub-optimal implementation of
I would be happy to do this in a utility function! |
Thanks @calebrob6 ! #8495 will deprecate this off the core LightningModule API. A separate function under https://github.com/PyTorchLightning/pytorch-lightning/tree/master/pytorch_lightning/utilities that accepts an nn.Module could be useful in parallel. If you have a chance, feel free to contribute this 😄 |
Not really, this was added by @Borda in b434c47#diff-21dfd052fd2cf070881d88cd38b207ebc1764be99c3d289208f36a6a630378a5R1769-R1776 as we already have a So the deprecation of the property in the |
Yes, as it is already supposed to compute |
model_size
property on the LightningModule
🚀 Feature
We are auditing the Lightning components and APIs to assess opportunities for improvements:
One item that came up on the LightningModule API was the ambiguity of the
model_size
property: https://github.com/PyTorchLightning/pytorch-lightning/blob/1ad1a89c09e6e8857f4fe680e23644a5013011d0/pytorch_lightning/core/lightning.py#L2073-L2084The value this property provides is ambiguous, and its implementation of dumping the module to a file to check the size is suboptimal. To reflect this, we'd like to deprecate the property off the core API. If this is still needed, this could be a utility function which accepts an nn.Module and returns the size.
@awaelchli @Borda
The text was updated successfully, but these errors were encountered: