Skip to content

Deprecate the model_size property on the LightningModule #8343

@ananthsub

Description

@ananthsub

🚀 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-L2084

The 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

Metadata

Metadata

Assignees

Labels

featureIs an improvement or enhancementhelp wantedOpen to be worked onrefactor

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions