diff --git a/torch_npu/csrc/core/npu/NPUQueue.cpp b/torch_npu/csrc/core/npu/NPUQueue.cpp index ec26c9a952677c7daf525ca8e4b2afc63b0438b6..87c5b7275630a4c6aba15be2f3f6a4fd024050d6 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) {