Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance.
Hi, I started noticing the following warning message after setting up a new conda environment with Pytorch 1.8.1, which is an update from my previous environment that uses Pytorch 1.7.0.

Epoch 0:   0%|
[W reducer.cpp:1050] Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance. If your model indeed never has any unused parameters, consider turning this flag off. Note that this warning may be a false positive your model has flow control causing later iterations to have unused parameters. (function operator())

Any idea if this is a real concern? How can we disable find_unused_parameters?
trainer = pl.Trainer(
    val_check_interval=0.1,
    gpus=-1,
    accelerator="ddp",
    callbacks=[checkpoint_callback, early_stop_callback],
    precision=16,
)
Packages:

pytorch 1.8.1
pytorch-lightning 1.2.6
cudatoolkit 11.1.1
cudnn 8.0.5
python 3.8
Hi @athenawisdoms the docs here cover how you can disable find_unused_parameters and speed up your DDP training
https://pytorch-lightning.readthedocs.io/en/latest/benchmarking/performance.html#when-using-ddp-set-find-unused-parameters-false