昇腾社区首页
中文
注册

在模型运行时遇到报错“terminate called after throwing an instance of 'std::runtime_error'”

报错信息

  • 报错截图

  • 报错文本
    ……
    terminate called after throwing an instance of 'std::runtime_error'
      what():  ReadQueue:/home/***/git-code/pytorch-526/torch_npu/csrc/core/npu/NPUQueue.cpp:261
    ……

问题分析

默认算子下发和执行异步进行,此时打印的堆栈实际是和报错不想关的,无法支撑问题定位。

处理方法

把ASCEND_LAUNCH_BLOCKING设为1,再运行复现这个报错,报错里面的堆栈信息即可定位到错误代码行。