diff --git a/torch_npu/csrc/core/npu/NPUQueue.cpp b/torch_npu/csrc/core/npu/NPUQueue.cpp index b91a5fc507a28acf184231c5ebc93b5e7ad4a0e6..7244d448d6e27c0687dbc051b826d7c663c1698d 100644 --- a/torch_npu/csrc/core/npu/NPUQueue.cpp +++ b/torch_npu/csrc/core/npu/NPUQueue.cpp @@ -216,11 +216,11 @@ NPUStatus Repository::MakeSureQueueEmpty() { if (GetStatus() == RepoStatus::ERROR_EXIT) { // Avoid repeatedly throwing exceptions - SetStatus(CAN_EXIT); throw std::runtime_error("The Inner error is reported as above.\n "\ "Since the operator is called asynchronously, the stacktrace may be inaccurate. "\ "If you want to get the accurate stacktrace, "\ "pleace set the environment variable ASCEND_LAUNCH_BLOCKING=1."); + SetStatus(CAN_EXIT); } #ifndef BUILD_LIBTORCH @@ -292,11 +292,11 @@ void Repository::Enqueue(void* cur_paras) { if (GetStatus() == RepoStatus::ERROR_EXIT) { // Avoid repeatedly throwing exceptions - SetStatus(CAN_EXIT); throw std::runtime_error("The Inner error is reported as above.\n "\ "Since the operator is called asynchronously, the stacktrace may be inaccurate. "\ "If you want to get the accurate stacktrace, "\ "pleace set the environment variable ASCEND_LAUNCH_BLOCKING=1."); + SetStatus(CAN_EXIT); } if (GetStatus() != RUN && GetStatus() != INIT) {