From 8ba6f74e98bdb34bf6d953fc8609d573a81caece Mon Sep 17 00:00:00 2001 From: wqtshg Date: Mon, 17 May 2021 20:09:49 +0800 Subject: [PATCH] Zero copy nodes are not allocated memory in the known subgraph --- ge/graph/load/model_manager/davinci_model.cc | 2 +- ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index c8dc483c..4fac7b28 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -489,7 +489,7 @@ void DavinciModel::InitRuntimeParams() { runtime_param_.memory_infos[kSessionScopeMemory | RT_MEMORY_HBM] = std::move(session_scope_mem_info); ret = ge::AttrUtils::GetInt(ge_model_, ATTR_MODEL_ZERO_COPY_MEMORY_SIZE, value); - runtime_param_.zero_copy_size = ret ? (uint64_t)value : 0; + runtime_param_.zero_copy_size = ret ? static_castvalue : 0; GELOGI("InitRuntimeParams(), %s.", runtime_param_.ToString().c_str()); } diff --git a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc index 3c111f55..1c666230 100755 --- a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc +++ b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc @@ -103,6 +103,8 @@ Status KnownNodeTask::Init(TaskContext &context) { void *buffer = nullptr; size_t total_mem_size = davinci_model_->TotalMemSize(); size_t total_zero_copy_size = davinci_model_->TotalZeroCopySize(); + GELOGI("####KnownNodeTask::Init total mem size is %lu, total zero size is %lu.", + total_mem_size, total_zero_copy_size); if (total_mem_size != 0 && total_mem_size > total_zero_copy_size) { RECORD_EXECUTION_EVENT(context.GetExecutionContext(), context.GetNodeName(), "[KnownNodeTask_AllocateWorkspace] Start");