Skip to content
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

Add ipython kernel detection and give warning when accelerator = "ddp" #5966

Closed
ifsheldon opened this issue Feb 14, 2021 · 1 comment · Fixed by #5970
Closed

Add ipython kernel detection and give warning when accelerator = "ddp" #5966

ifsheldon opened this issue Feb 14, 2021 · 1 comment · Fixed by #5970
Labels
feature Is an improvement or enhancement help wanted Open to be worked on

Comments

@ifsheldon
Copy link
Contributor

🚀 Feature

Add ipython kernel detection and give warning when accelerator = "ddp"

Motivation

When users try to use ddp as accelerator in Jupyter Notebook or Jupyter Lab, the trainer will be stuck forever and no hints about the cause. So, to better inform developers, it will be great to detect whether the code is run in a ipython kernel.

Pitch

When users initialize a trainer by Trainer(accelerator = 'ddp') in a ipython kernel, give a warning or exception. Something like "ddp will not work in ipython kernel" should suffice.

Additional context

Please see this to implement it. I can do a PR, but I am not sure if it is appropriate to place code for detection in Trainer.__init__()

@ifsheldon ifsheldon added feature Is an improvement or enhancement help wanted Open to be worked on labels Feb 14, 2021
@awaelchli
Copy link
Contributor

awaelchli commented Feb 14, 2021

The best place would be the accelerator connector where the ddp plugin gets selected. Happy to review the PR :)

https://github.com/PyTorchLightning/pytorch-lightning/blob/a3d4e7c86a9cfbdd5ac659c5f584927271cb57f6/pytorch_lightning/accelerators/accelerator_connector.py#L449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants