跑一些大模型 、 别人的项目、github上的代码
编译正常通过,运行的时候随机报错(某个epoch就因为报错停止了)
然而使用CPU跑却可以
报错 RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call,
so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
查找了很多博客都没有给出解决方案
最后在外网的评论说可能是GPU硬件问题导致的错误,顺着这个思路
在模型训练代码里面添加延时函数 Thread.sleep(毫秒数); 延缓GPU压力
可以一直跑下去了!