From d052b4f09a7b81f870ed69f2802565fe12ee6748 Mon Sep 17 00:00:00 2001 From: dongwenbo6 Date: Sat, 17 Feb 2024 16:10:08 +0800 Subject: [PATCH 1/2] optimize plog ERROR --- torch_npu/csrc/core/npu/NPUQueue.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/torch_npu/csrc/core/npu/NPUQueue.cpp b/torch_npu/csrc/core/npu/NPUQueue.cpp index 4c5ab672a29..496e511c2ba 100644 --- a/torch_npu/csrc/core/npu/NPUQueue.cpp +++ b/torch_npu/csrc/core/npu/NPUQueue.cpp @@ -3,6 +3,7 @@ #include "torch_npu/csrc/core/npu/npu_log.h" #include "torch_npu/csrc/framework/utils/NpuUtils.h" #include "torch_npu/csrc/core/npu/NPUFunctions.h" +#include "torch_npu/csrc/framework/OpParamMaker.h" #include #include @@ -288,7 +289,19 @@ void Repository::Enqueue(void* cur_paras) { } if (GetStatus() != RUN && GetStatus() != INIT) { - ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). !!"); + auto queueParam = static_cast(cur_paras); + auto type = queueParam->paramType; + if (type ==c10_npu::queue::COMPILE_AND_EXECUTE) { + auto cur_paras = static_cast(queueParam->paramVal); + auto op_param = cur_paras->opType; + ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). op name is=%s", *op_name); + } else if (type ==c10_npu::queue::ASYNC_MEMCPY) { + auto cur_paras = static_cast(queueParam->paramVal); + ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). src=%p, dst=%p", cur_paras->src, cur_paras->dst); + } else { + auto cur_paras = static_cast(queueParam->paramVal); + ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). event is=%p", cur_paras->event); + } return; } bool ret = false; -- Gitee From d58d90eec70d88ba5916b4a80c6fb32d29ccfab3 Mon Sep 17 00:00:00 2001 From: dongwenbo6 Date: Sat, 17 Feb 2024 17:01:30 +0800 Subject: [PATCH 2/2] reorganize files --- torch_npu/csrc/core/npu/NPUQueue.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/torch_npu/csrc/core/npu/NPUQueue.cpp b/torch_npu/csrc/core/npu/NPUQueue.cpp index 496e511c2ba..e774c281b58 100644 --- a/torch_npu/csrc/core/npu/NPUQueue.cpp +++ b/torch_npu/csrc/core/npu/NPUQueue.cpp @@ -289,20 +289,20 @@ void Repository::Enqueue(void* cur_paras) { } if (GetStatus() != RUN && GetStatus() != INIT) { - auto queueParam = static_cast(cur_paras); - auto type = queueParam->paramType; - if (type ==c10_npu::queue::COMPILE_AND_EXECUTE) { - auto cur_paras = static_cast(queueParam->paramVal); - auto op_param = cur_paras->opType; - ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). op name is=%s", *op_name); - } else if (type ==c10_npu::queue::ASYNC_MEMCPY) { - auto cur_paras = static_cast(queueParam->paramVal); - ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). src=%p, dst=%p", cur_paras->src, cur_paras->dst); - } else { - auto cur_paras = static_cast(queueParam->paramVal); - ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). event is=%p", cur_paras->event); - } - return; + auto queueParam = static_cast(cur_paras); + auto type = queueParam->paramType; + if (type ==c10_npu::queue::COMPILE_AND_EXECUTE) { + auto cur_paras = static_cast(queueParam->paramVal); + auto op_param = cur_paras->opType; + ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). op name is=%s", *op_name); + } else if (type ==c10_npu::queue::ASYNC_MEMCPY) { + auto cur_paras = static_cast(queueParam->paramVal); + ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). src=%p, dst=%p", cur_paras->src, cur_paras->dst); + } else { + auto cur_paras = static_cast(queueParam->paramVal); + ASCEND_LOGE("Task queue thread is exit, cann't call Enqueue(). event is=%p", cur_paras->event); + } + return; } bool ret = false; ssize_t s; -- Gitee