From 5d012c05b7b74ecf809e9ce516be36333b48fde4 Mon Sep 17 00:00:00 2001 From: wqtshg Date: Sat, 29 May 2021 18:57:24 +0800 Subject: [PATCH] Zero copy nodes are not allocated memory in the known subgraph --- ge/graph/load/model_manager/davinci_model.cc | 2 +- ge/graph/load/model_manager/davinci_model.h | 2 +- ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 35808a1f..05c50a58 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -4515,7 +4515,7 @@ void DavinciModel::UpdateOpIOAddrs(uint32_t task_id, uint32_t stream_id, const s /// @return Status /// Status DavinciModel::GetTotalMemSizeExcludeZeroCopy(int64_t &total_useful_size) { - if (runtime_param_.mem_size < runtime_param_.zero_copy_size) { + if (runtime_param_.mem_size < static_cast(runtime_param_.zero_copy_size)) { REPORT_CALL_ERROR("E19999", "total mem size[%lu] is less than zero copy size[%ld] ", runtime_param_.mem_size, runtime_param_.zero_copy_size); GELOGE(FAILED, "[Check][TotalMemSizeExcludeZeroCopy] failed, total mem size[%lu] is less than zero copy size[%ld]", diff --git a/ge/graph/load/model_manager/davinci_model.h b/ge/graph/load/model_manager/davinci_model.h index 6a03fca4..8a8fb35e 100755 --- a/ge/graph/load/model_manager/davinci_model.h +++ b/ge/graph/load/model_manager/davinci_model.h @@ -254,7 +254,7 @@ class DavinciModel { /// @param [in] total_useful_size: total mem size - zero copy size. /// @return Status /// - status GetTotalMemSizeExcludeZeroCopy(int64_t &total_useful_size); + Status GetTotalMemSizeExcludeZeroCopy(int64_t &total_useful_size); // model name string Name() const { return name_; } diff --git a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc index 8ee5718e..679ad298 100755 --- a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc +++ b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc @@ -102,7 +102,7 @@ Status KnownNodeTask::Init(TaskContext &context) { // allocate mem base void *buffer = nullptr; int64_t total_useful_size = 0; - GE_CHK_STATUS_RET(davinci_model_.GetTotalMemSizeExcludeZeroCopy(total_useful_size), + GE_CHK_STATUS_RET(davinci_model_->GetTotalMemSizeExcludeZeroCopy(total_useful_size), "[Get][TotalMemSizeExcludeZeroCopy] failed."); if (total_useful_size != 0) { RECORD_EXECUTION_EVENT(context.GetExecutionContext(), context.GetNodeName(),