pytorch利用DDP加速时,出现提示信息为:
[W reducer.cpp:362] Warning: 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.
例如:
# 原代码为:
input_tensor = ori_tensor.transpose(1, 3)
# 改为:
input_tensor = ori_tensor.transpose(1, 3).contiguous()