Skip to content

[RFC] DDP Plugin's find_unused_parameters should be False by default #7330

@ananthsub

Description

@ananthsub

🚀 Feature

Currently Lightning defaults to setting find_unused_parameters=True when using PyTorch's DistributedDataParallel. https://github.com/PyTorchLightning/pytorch-lightning/blob/39274273a4c0a8d0b6bf3ee862a02ec4f5bf705a/pytorch_lightning/plugins/training_type/ddp.py#L221-L225

I propose that we change it back to False

Motivation

Changing the default to False offers these benefits:

Cons:

  • For some models this crashes

Mitigations:

  • In these instances, we can have clear documentation for the error message, and that they need to instantiate a DDP plugin with find_unused_parameters=True, and pass this to the trainer like so
ddp = DDPPlugin(find_unused_parameters=True)
trainer = Trainer(..., plugins=[ddp])

Or by using the new registry

cc @Borda @justusschock @kaushikb11 @awaelchli @akihironitta @rohitgr7 @Queuecumber

Pitch

Remove this default here: https://github.com/PyTorchLightning/pytorch-lightning/blob/39274273a4c0a8d0b6bf3ee862a02ec4f5bf705a/pytorch_lightning/plugins/training_type/ddp.py#L221-L225

Alternatives

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions