RuntimeError: Run:/usr1/workspace/PyTorch_Apex_Daily_c20tr5/CODE/aten/src/ATen/native/npu/utils/OpParamMaker.h:280 NPU error,NPU error code is:500002 [ERROR] RUNTIME(160809)kernel task happen error, retCode=0x28, [aicpu timeout]. [ERROR] RUNTIME(160809)aicpu kernel execute failed, device_id=0, stream_id=512, task_id=24, fault so_name=, fault kernel_name=, extend_info=. Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/local/python3.7.5/lib/python3.7/site-packages/torch/__init__.py", line 429, in _npu_shutdown torch._C._npu_shutdown() RuntimeError: npuSynchronizeDevice:/usr1/workspace/PyTorch_Apex_Daily_c20tr5/CODE/c10/npu/NPUStream.cpp:806 NPU error, error code is 0
[ERROR] RUNTIME(12731,python3.7):2021-02-02-22:23:56.475.679 [../../../../../../runtime/feature/src/npu_driver.cc:1408]12828 MemCopySync:drvMemcpy failed: dst=0x108040288000, destMax=1240, src=0x7fe7649556d0, size=1240, kind=1, drvRetCode=17! [ERROR] RUNTIME(12731,python3.7):2021-02-02-22:23:56.475.698 [../../../../../../runtime/feature/src/logger.cc:113]12828 KernelLaunch:launch kernel failed, kernel=140631803535760/ArgMinWithValue_tvmbin, dim=32, stream=0x55b22b3def50 [ERROR] RUNTIME(12731,python3.7):2021-02-02-22:23:56.475.717 [../../../../../../runtime/feature/src/api_c.cc:224]12828 rtKernelLaunch:ErrCode=207001, desc=[module new memory error], InnerCode=0x70a0002
import torch import torch_npu def test_sum(): xs_shape = [22400, 8] ys_shape = [22400, 8] gt_bboxes_shape = [22400, 8,4] xs = torch.rand(xs_shape).npu() ys = torch.rand(ys_shape).npu() gt_bboxes = torch.rand(gt_bboxes_shape).npu().half() left = xs - gt_bboxes[..., 0] right = gt_bboxes[..., 2] - xs top = ys - gt_bboxes[..., 1] bottom = gt_bboxes[..., 3] - ys # stream = torch_npu.npu.current_stream() # stream.synchronize() # left, top 结果是fp32, right, bottom 结果是fp16, # print(left.dtype, top.dtype, right.dtype, bottom.dtype) bbox_targets = torch.stack((left, top, right, bottom), -1) #报错位置在这里 # stream.synchronize() bbox_targets = torch.sum(bbox_targets)
根据shell和日志报错信息,两者报错信息不匹配。shell报错是在同步操作中和AI CPU错误,而日志报错信息却是在min算子(内部调用ArgMinWithValue_tvmbin),二者报错信息不对应。一般这类问题出现的原因是由于日志生成的报错信息滞后。报错信息滞后可能是由于AI CPU算子的异步执行,导致报错信息滞后。
对于该报错需要根据实际的错误来定位,可参考如下步骤进行处理: