Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Fix interface of CGO's accelerator to support pytorch-lightning 1.4.2 #4075

Merged
merged 3 commits into from
Aug 21, 2021

Conversation

hzhua
Copy link
Contributor

@hzhua hzhua commented Aug 16, 2021

Pytorch-lightning updates its interface of TrainingTypePlugin and AcceleratorConnector.
This PR includes:

  • implement the teardown interface in BypassPlugin
  • use the trainer's kwargs to get the precision_plugin

@hzhua hzhua requested review from ultmaster and QuanluZhang August 16, 2021 10:44
plugins: Optional[Union[List[Union[Plugin, ClusterEnvironment, str]], Plugin, ClusterEnvironment, str]] = None):
plugins: Optional[Union[List[Union[Plugin, ClusterEnvironment, str]], Plugin, ClusterEnvironment, str]] = None,
**other_trainier_kwargs) -> AcceleratorConnector:
gpu_ids = Trainer()._parse_devices(gpus, auto_select_gpus, tpu_cores)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_parse_devices is a staticmethod, so Trainer._parse_devices is enough.

Copy link
Contributor Author

@hzhua hzhua Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice _parse_devices of pytorch-lightning 1.4.2 is not staticmethod yet (https://github.com/PyTorchLightning/pytorch-lightning/blob/1.4.2/pytorch_lightning/trainer/trainer.py). Their minor fix of adding staticmethod has not been merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QuanluZhang QuanluZhang merged commit 5c9797a into microsoft:master Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants