Backward problem with using DDP

Author: UESTC-LXDCreated Jan 9, 2024Updated Jul 26, 2024

Encountered when using DDP. How should I locate the warning at this location?

Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass /home/ps/anaconda3/envs/py38/lib/python3.8/site-packages/torch/autograd/init.py:197: UserWarning: Grad strides do not match bucket view strides. This may indicate grad was not created according to the gradient layout contract, or that the param's strides changed since DDP was constructed. This is not an error, but may impair performance. grad.sizes() = [32, 64, 1, 1, 1], strides() = [64, 1, 64, 64, 64] bucket_view.sizes() = [32, 64, 1, 1, 1], strides() = [64, 1, 1, 1, 1] (Triggered internally at ../torch/csrc/distributed/c10d/reducer.cpp:325.)

Source: lucidrains/imagen-pytorch