| @@ -969,7 +969,7 @@ Status KernelTaskInfo::InitAicpuTaskExtInfo(const std::string &ext_info) { | |||||
| auto ext_info_data = copy_ext_info.get(); | auto ext_info_data = copy_ext_info.get(); | ||||
| size_t offset = 0; | size_t offset = 0; | ||||
| while (offset + sizeof(aicpu::FWKAdapter::ExtInfo) <= ext_info_len_) { | |||||
| while (offset + sizeof(aicpu::FWKAdapter::ExtInfo) <= ext_info.size()) { | |||||
| auto aicpu_ext_info = reinterpret_cast<aicpu::FWKAdapter::ExtInfo *>(ext_info_data + offset); | auto aicpu_ext_info = reinterpret_cast<aicpu::FWKAdapter::ExtInfo *>(ext_info_data + offset); | ||||
| GELOGD("Ext infoType=%d, infoLen=%u.", aicpu_ext_info->infoType, aicpu_ext_info->infoLen); | GELOGD("Ext infoType=%d, infoLen=%u.", aicpu_ext_info->infoType, aicpu_ext_info->infoLen); | ||||
| if (aicpu_ext_info->infoType == aicpu::FWKAdapter::FWK_ADPT_EXT_SESSION_INFO) { | if (aicpu_ext_info->infoType == aicpu::FWKAdapter::FWK_ADPT_EXT_SESSION_INFO) { | ||||
| @@ -977,11 +977,11 @@ Status KernelTaskInfo::InitAicpuTaskExtInfo(const std::string &ext_info) { | |||||
| "Parse ext session info failed as infoLen must be %zu but %u.", | "Parse ext session info failed as infoLen must be %zu but %u.", | ||||
| sizeof(SessionInfo), aicpu_ext_info->infoLen); | sizeof(SessionInfo), aicpu_ext_info->infoLen); | ||||
| SessionInfo *session_info = reinterpret_cast<SessionInfo *>(aicpu_ext_info->infoMsg); | SessionInfo *session_info = reinterpret_cast<SessionInfo *>(aicpu_ext_info->infoMsg); | ||||
| session_info_->sessionId = davinci_model_->GetSessionId(); | |||||
| session_info_->sessFlag = true; | |||||
| session_info->sessionId = davinci_model_->GetSessionId(); | |||||
| session_info->sessFlag = true; | |||||
| GELOGD("Update aicpu_task ext_info session_info session_id is %lu", session_info->sessionId); | GELOGD("Update aicpu_task ext_info session_info session_id is %lu", session_info->sessionId); | ||||
| } | } | ||||
| offset += sizeof(AicpuExtInfo); | |||||
| offset += sizeof(aicpu::FWKAdapter::ExtInfo); | |||||
| offset += aicpu_ext_info->infoLen; | offset += aicpu_ext_info->infoLen; | ||||
| } | } | ||||
| @@ -141,7 +141,7 @@ Status AicpuExtInfoHandler::UpdateSessionInfo(uint64_t session_id, uint64_t kern | |||||
| GELOGD("There is no session info in ext_info, no need update."); | GELOGD("There is no session info in ext_info, no need update."); | ||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| session_info_->sessionId = session_id; | session_info_->sessionId = session_id; | ||||
| session_info_->kernelId = kernel_id; | session_info_->kernelId = kernel_id; | ||||
| session_info_->sessFlag = sess_flag; | session_info_->sessFlag = sess_flag; | ||||
| @@ -153,7 +153,7 @@ Status AicpuExtInfoHandler::UpdateSessionInfoSessionId(uint64_t session_id) { | |||||
| GELOGD("There is no session info in ext_info, no need update."); | GELOGD("There is no session info in ext_info, no need update."); | ||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| session_info_->sessionId = session_id; | session_info_->sessionId = session_id; | ||||
| session_info_->sessFlag = true; | session_info_->sessFlag = true; | ||||
| return SUCCESS; | return SUCCESS; | ||||
| @@ -57,9 +57,9 @@ Status AicpuNodeTaskBase::InitExtInfo(const std::string &kernel_ext_info, int64_ | |||||
| GE_CHK_STATUS_RET(aicpu_ext_handle_.Parse(kernel_ext_info), | GE_CHK_STATUS_RET(aicpu_ext_handle_.Parse(kernel_ext_info), | ||||
| "Node[%s] parse kernel ext info failed, kernel_ext_info_size=%zu.", | "Node[%s] parse kernel ext info failed, kernel_ext_info_size=%zu.", | ||||
| node_name_.c_str(), kernel_ext_info.size()); | node_name_.c_str(), kernel_ext_info.size()); | ||||
| } | |||||
| GELOGD("To update aicpu_task ext_info session_info session_id to %lu", session_id); | GELOGD("To update aicpu_task ext_info session_info session_id to %lu", session_id); | ||||
| GE_CHK_STATUS_RET(aicpu_ext_handle_.UpdateSessionInfoSessionId(session_id)); | |||||
| GE_CHK_STATUS_RET(aicpu_ext_handle_.UpdateSessionInfoSessionId(session_id), | |||||
| "UpdateSessionInfoSessionId failed."); | |||||
| // copy task args buf | // copy task args buf | ||||
| GE_CHK_STATUS_RET(AllocTensorBuffer(aicpu_ext_handle_.GetExtInfoLen(), ext_info_addr_dev_), | GE_CHK_STATUS_RET(AllocTensorBuffer(aicpu_ext_handle_.GetExtInfoLen(), ext_info_addr_dev_), | ||||
| @@ -252,8 +252,8 @@ Status SingleOpModel::BuildTaskList(SingleOp &single_op) { | |||||
| } else if (kernel_type == cce::ccKernelType::AI_CPU || kernel_type == cce::ccKernelType::CUST_AI_CPU) { | } else if (kernel_type == cce::ccKernelType::AI_CPU || kernel_type == cce::ccKernelType::CUST_AI_CPU) { | ||||
| GELOGD("Building AICPU_CC task"); | GELOGD("Building AICPU_CC task"); | ||||
| OpTask *task = nullptr; | OpTask *task = nullptr; | ||||
| uint64_t singleop_kernel_id = aicpu_kernel_id++ | |||||
| GELOGI("Build singleOp CCTask, kernel_id = %lu", singleop_kernel_id);; | |||||
| uint64_t singleop_kernel_id = aicpu_kernel_id++; | |||||
| GELOGI("Build singleOp CCTask, kernel_id = %lu", singleop_kernel_id); | |||||
| auto ret = BuildCpuKernelTask(task_def.kernel(), &task, singleop_kernel_id); | auto ret = BuildCpuKernelTask(task_def.kernel(), &task, singleop_kernel_id); | ||||
| if (ret != SUCCESS) { | if (ret != SUCCESS) { | ||||
| return ret; | return ret; | ||||
| @@ -368,7 +368,7 @@ Status SingleOpModel::BuildCpuKernelTask(const domi::KernelDef &kernel_def, OpTa | |||||
| } | } | ||||
| auto builder = AiCpuCCTaskBuilder(iter->second->GetOpDesc(), kernel_def); | auto builder = AiCpuCCTaskBuilder(iter->second->GetOpDesc(), kernel_def); | ||||
| auto ret = builder.BuildTask(*aicpucc_task, uint64_t kernel_id); | |||||
| auto ret = builder.BuildTask(*aicpucc_task, kernel_id); | |||||
| if (ret != SUCCESS) { | if (ret != SUCCESS) { | ||||
| GELOGE(ret, "build aicpu_CC op task failed"); | GELOGE(ret, "build aicpu_CC op task failed"); | ||||
| return ret; | return ret; | ||||
| @@ -141,6 +141,11 @@ namespace ge { | |||||
| fwk_op_kernel.fwkKernelBase.fwk_kernel.sessionID = ULLONG_MAX; | fwk_op_kernel.fwkKernelBase.fwk_kernel.sessionID = ULLONG_MAX; | ||||
| fwk_op_kernel.fwkKernelBase.fwk_kernel.kernelID = kernel_id; | fwk_op_kernel.fwkKernelBase.fwk_kernel.kernelID = kernel_id; | ||||
| fwk_op_kernel.fwkKernelBase.fwk_kernel.opType = aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_KERNEL_RUN_NO_SESS; | fwk_op_kernel.fwkKernelBase.fwk_kernel.opType = aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_KERNEL_RUN_NO_SESS; | ||||
| ret = SetKernelArgs(&task.args_, fwk_op_kernel); | |||||
| if (ret != SUCCESS) { | |||||
| return ret; | |||||
| } | |||||
| task.arg_size_ = sizeof(STR_FWK_OP_KERNEL); | task.arg_size_ = sizeof(STR_FWK_OP_KERNEL); | ||||
| task.op_type_ = op_desc_->GetName(); | task.op_type_ = op_desc_->GetName(); | ||||
| task.task_info_ = kernel_def_.task_info(); | task.task_info_ = kernel_def_.task_info(); | ||||
| @@ -269,12 +269,12 @@ Status AiCpuBaseTask::SetExtInfoAndType(const std::string &kernel_ext_info, uint | |||||
| } | } | ||||
| GE_CHK_STATUS_RET(aicpu_ext_handle_->UpdateSessionInfo(ULLONG_MAX, kernel_id, false), | GE_CHK_STATUS_RET(aicpu_ext_handle_->UpdateSessionInfo(ULLONG_MAX, kernel_id, false), | ||||
| "UpdateOutputShapeAndType failed."); | |||||
| "UpdateSessionInfo failed."); | |||||
| GE_CHK_RT_RET(rtMalloc(&ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), RT_MEMORY_HBM)); | GE_CHK_RT_RET(rtMalloc(&ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), RT_MEMORY_HBM)); | ||||
| GE_CHK_RT_RET(rtMemcpy(ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), | GE_CHK_RT_RET(rtMemcpy(ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), | ||||
| aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), | aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), | ||||
| RT_MEMCPY_HOST_TO_DEVICE)) | |||||
| RT_MEMCPY_HOST_TO_DEVICE)); | |||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||