Skip to content

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

@ifsheldon

Description

@ifsheldon

🚀 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__()

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs an improvement or enhancementhelp wantedOpen to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions