From 82f83443942fb851bc9bcf7b78936d05a5d6d1ba Mon Sep 17 00:00:00 2001 From: zhou_chao1993 Date: Thu, 22 Apr 2021 09:31:47 +0800 Subject: [PATCH] overflow bug --- .../model_manager/task_info/kernel_ex_task_info.cc | 11 ++++++----- .../model_manager/task_info/kernel_task_info.cc | 13 ++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc b/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc index e2f600b3..5b65f57e 100644 --- a/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc +++ b/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc @@ -239,10 +239,6 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin return RT_ERROR_TO_GE_STATUS(rt_ret);) InitDumpTask(input_output_addr_, op_desc); - if (davinci_model_->GetOpDugReg()) { - GELOGI("Op debug is open in kernel ex task info"); - dump_args_ = input_output_addr_; - } } uint64_t input_output_addr = static_cast(reinterpret_cast(input_output_addr_)); @@ -275,10 +271,15 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin } void KernelExTaskInfo::InitDumpTask(void *addr, const OpDescPtr &op_desc) { - if (davinci_model_->OpNeedDump(op_desc->GetName())) { + if (davinci_model_->OpNeedDump(op_desc->GetName()) || davinci_model_->GetOpDugReg()) { + GELOGD("Op %s need dump in kernel ex task info", op_desc->GetName().c_str()); dump_flag_ = RT_KERNEL_DUMPFLAG; dump_args_ = addr; } + if (davinci_model_->GetOpDugReg()) { + GELOGD("Op debug is open in kernel ex task info"); + dump_args_ = addr; + } } Status KernelExTaskInfo::CalculateArgs(const domi::TaskDef &task_def, DavinciModel *davinci_model) { diff --git a/ge/graph/load/model_manager/task_info/kernel_task_info.cc b/ge/graph/load/model_manager/task_info/kernel_task_info.cc index 82c3e286..9ac77531 100755 --- a/ge/graph/load/model_manager/task_info/kernel_task_info.cc +++ b/ge/graph/load/model_manager/task_info/kernel_task_info.cc @@ -731,9 +731,6 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne skt_dump_args_ = static_cast(args_) + offset; InitDumpTask(offset); - GE_CHK_BOOL_TRUE_EXEC_INFO(davinci_model_->GetOpDugReg(), dump_args_ = static_cast(args_) + offset, - "Op debug is open in TVM task info"); - vector virtual_io_addrs; // use virtual address for zero copy key. virtual_io_addrs.insert(virtual_io_addrs.end(), input_data_addrs.begin(), input_data_addrs.end()); virtual_io_addrs.insert(virtual_io_addrs.end(), output_data_addrs.begin(), output_data_addrs.end()); @@ -1070,10 +1067,7 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k return RT_ERROR_TO_GE_STATUS(rt_ret); } InitDumpTask(sizeof(aicpu::AicpuParamHead)); - if (davinci_model_->GetOpDugReg()) { - GELOGI("Op debug is open in aicpu task info"); - dump_args_ = static_cast(args_) + sizeof(aicpu::AicpuParamHead); - } + if (kernel_type_ == ccKernelType::CUST_AI_CPU) { dump_flag_ |= RT_KERNEL_CUSTOM_AICPU; } @@ -1085,6 +1079,7 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k void KernelTaskInfo::InitDumpTask(uint32_t offset) { if (davinci_model_->OpNeedDump(op_desc_->GetName())) { + GELOGD("Op %s need dump in task info", op_desc_->GetName().c_str()); if (IsL1FusionOp(op_desc_)) { dump_flag_ = RT_FUSION_KERNEL_DUMPFLAG; } else { @@ -1092,6 +1087,10 @@ void KernelTaskInfo::InitDumpTask(uint32_t offset) { } dump_args_ = static_cast(args_) + offset; } + if (davinci_model_->GetOpDugReg()) { + GELOGD("Op debug is open in kernel task info"); + dump_args_ = static_cast(args_) + offset; + } } Status KernelTaskInfo::InitAicpuTaskExtInfo(const std::string &ext_info) {