-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Remove AcceleratorConnector.device_type
#12077
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
Comments
In the linked PR, I see the property was not deprecated previously but just removed. Was this discussed somewhere? Is the assumption that we don't deprecate connector properties? Or some other reasoning? |
@carmocca this is one of the follow ups in #11449, all these properties below L768 are not used anymore and can be removed. I think you already removed the trainer.device_type? |
I did, but that was prefixed by Personally, I'm okay with removing this. Properties and attributes inside the connectors were never meant to be public. I just wanted to raise awareness about this. |
Just did a quick google search, to see if anywhere in a blog/docs, anyone has used |
@krshrimali Thanks for the suggestion! I feel getting the device_type string are not recommended now. (The _AcceleratorType is an internal enum instead). The best alternative is to check Any other alternatives we should consider? |
Thanks for the response, I guess this is okay then. I didn't see any usage of Also, thanks for updating the description. Looks great now! |
AcceleratorConnector.device_type
AcceleratorConnector.device_type
Thanks for the hands up, we have a bunch of properties in accl_conn can be removed like this. The trainer._accelerator_connector is already private, I think it's safe to remove properties in it directly? |
Uh oh!
There was an error while loading. Please reload this page.
Proposed refactor
Remove the property
AcceleratorConnector.device_type
and migrate its usagehttps://github.com/PyTorchLightning/pytorch-lightning/blob/550d3a640d1bfeb731a16b2996d3160f0f7eb071/pytorch_lightning/trainer/connectors/accelerator_connector.py#L766-L775
Alternative
Check
isinstance(Trainer.accelerator, [CPU/GPU/TPU/IPU]Accelerator)
to get the device type.Motivation
Remove deprecated accelerator_connector properties and deprecate Trainer properties accordingly.
AcceleratorConnector.device_type
was not used within PytorchLightning anymore and those connector properties were never meant to be public.Remove the property
AcceleratorConnector.device_type
, which is not used.Additional context
No other usage, should be a safe remove
cc @justusschock @awaelchli @rohitgr7 @four4fish
The text was updated successfully, but these errors were encountered: