From 3e1d72fdae87dd9a526acf945098f33ba0bddeed Mon Sep 17 00:00:00 2001 From: sunxinlei Date: Sun, 29 Sep 2024 15:18:19 +0800 Subject: [PATCH] fix double free core --- torch_npu/csrc/core/npu/NPUException.h | 4 ++-- torch_npu/csrc/core/npu/NPUQueue.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/torch_npu/csrc/core/npu/NPUException.h b/torch_npu/csrc/core/npu/NPUException.h index 0f03ee1865..aab033c0c4 100644 --- a/torch_npu/csrc/core/npu/NPUException.h +++ b/torch_npu/csrc/core/npu/NPUException.h @@ -89,8 +89,8 @@ std::string formatErrorCode(SubModule submodule, ErrCode errorCode); #define GRAPH_ERROR(error) formatErrorCode(SubModule::GRAPH, error) #define PROF_ERROR(error) formatErrorCode(SubModule::PROF, error) -#define DEVICE_TASK_ABORT "107022" -#define DEVICE_MEM_ERROR "507053" +#define DEVICE_TASK_ABORT "reason=[device task abort]" +#define DEVICE_MEM_ERROR "reason=[device mem error]" inline const char* getErrorFunction(const char* msg) { diff --git a/torch_npu/csrc/core/npu/NPUQueue.cpp b/torch_npu/csrc/core/npu/NPUQueue.cpp index edbd5a8655..43c1499d53 100644 --- a/torch_npu/csrc/core/npu/NPUQueue.cpp +++ b/torch_npu/csrc/core/npu/NPUQueue.cpp @@ -475,7 +475,7 @@ void Repository::Dequeue() { uint64_t u = 1; SetReadWorking(true); - while (ret == false && GetStatus() != RepoStatus::CAN_EXIT) { + while (ret == false && GetStatus() != RepoStatus::CAN_EXIT && GetStatus() != RepoStatus::STOP_EXIT) { ret = ReadQueue(); if (ret == false) { if (GetStatus() == RepoStatus::NEED_EXIT) { @@ -483,9 +483,9 @@ void Repository::Dequeue() { break; } - if (GetStatus() == RepoStatus::ERROR_EXIT) { - break; - } + if (GetStatus() == RepoStatus::ERROR_EXIT) { + break; + } SetReadWorking(false); __sync_synchronize(); -- Gitee