|
|
|
@@ -123,10 +123,9 @@ Status KnownNodeTask::Init(TaskContext &context) { |
|
|
|
davinci_model_->SetKnownShapeGlobalStep(global_step); |
|
|
|
} |
|
|
|
load_flag_ = true; |
|
|
|
} else { |
|
|
|
GE_CHK_STATUS_RET(ModelManager::GetInstance()->DestroyAicpuKernel(davinci_model_->GetSessionId(), |
|
|
|
davinci_model_->Id(), davinci_model_->SubModelId()), "KnownNodeTask::Init destroy aicpu kernel failed."); |
|
|
|
} |
|
|
|
GE_CHK_STATUS_RET(ModelManager::GetInstance()->DestroyAicpuKernel(davinci_model_->GetSessionId(), |
|
|
|
davinci_model_->Id(), davinci_model_->SubModelId()), "KnownNodeTask::Init destroy aicpu kernel failed."); |
|
|
|
GELOGI("[%s] KnownNodeExecutor::Init success.", context.GetNodeName()); |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
@@ -134,15 +133,6 @@ Status KnownNodeTask::Init(TaskContext &context) { |
|
|
|
Status KnownNodeTask::InitDavinciModel() { |
|
|
|
davinci_model_->InitRuntimeParams(); |
|
|
|
GE_CHK_STATUS_RET(davinci_model_->InitVariableMem(), "init variable mem failed"); |
|
|
|
auto mem_size = davinci_model_->TotalMemSize(); |
|
|
|
if (mem_size > 0) { |
|
|
|
auto buffer = TensorBuffer::Create(NpuMemoryAllocator::GetAllocator(), mem_size); |
|
|
|
GE_CHECK_NOTNULL(buffer); |
|
|
|
davinci_model_->UpdateMemBase(static_cast<uint8_t *>(buffer->GetData())); |
|
|
|
GELOGI("KnownNodeTask::Init mem base is %p, size %lu.", |
|
|
|
davinci_model_->GetRuntimeParam().mem_base, davinci_model_->GetRuntimeParam().mem_size); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t device_id = 0; |
|
|
|
GE_CHK_RT_RET(rtGetDevice(&device_id)); |
|
|
|
davinci_model_->SetDeviceId(static_cast<uint32_t>(device_id)); |
|
|
|
|