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消失了,但是时间依旧是越来越长
在这里插入图片描述
目前暂未知如何解决


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部