diff --git a/torch_npu/csrc/core/npu/NPUQueue.cpp b/torch_npu/csrc/core/npu/NPUQueue.cpp index 02946c467f8dd1fb4c586590b7a7ae98fb62d565..c39f88653f534a61ef14abce95b8bc07160660b2 100644 --- a/torch_npu/csrc/core/npu/NPUQueue.cpp +++ b/torch_npu/csrc/core/npu/NPUQueue.cpp @@ -209,11 +209,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); } // Get the GIL @@ -280,11 +280,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) {