Grad strides do not match bucket view strides.This may indicate grad was not created according to th

家人们来看看是不是报这个 warning:

[W reducer.cpp:283] 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.

这里说了这不是个 ERROR, 但可能影响性能,如果诸位时间不是很着急,那就不用管,但是我这里越训练剩余时间越长hhh
(然而之后改进代码,这个warning没了,但是越train剩余时间越长这个问题依旧没有解决)

在这里插入图片描述

参考链接:
https://github.com/pytorch/pytorch/issues/47163

我和这个老哥问题一样:
在这里插入图片描述

下边这个自动化所的老哥,给了一种解决方式:
在这里插入图片描述
他认为是 transpose 和 permute 操作导致了步长不一致,于是用 contiguous 来让数据在内存中连续

我这样操作了:

在这里插入图片描述
在所有的 transpose 和 permute 操作后加上 contiguous 操作,OK,warning消失了,但是时间依旧是越来越长
在这里插入图片描述
目前暂未知如何解决

猜你喜欢

转载自blog.csdn.net/HaoZiHuang/article/details/131278848