RuntimeError: CUDA error: device-side assert triggered

Love The Way You Lie 2023-06-27 03:25 73阅读 0赞

在调用用scatter_后使用.cpu()报错

/pytorch/aten/src/THC/THCTensorScatterGather.cu:188: void THCudaTensor_scatterFillKernel(TensorInfo, TensorInfo, Real, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = -1]: block: [33,0,0], thread: [90,0,0] Assertion `indexValue >= 0 && indexValue < tensor.sizes[dim]` failed.

按照上面提到的应该是出现了数值问题,看了一篇文章,里面有详细的介绍,但是还是未能解决我的问题,直到我看到一篇老外的文章,是github上面的,我只加了一个CUDA_LAUNCH_BLOCKING=1就正常。

应该这个锅是异步造成的,造成了数值大小比较出了问题。

发表评论

表情:
评论列表 (有 0 条评论,73人围观)

还没有评论,来说两句吧...

相关阅读