diff --git a/ge/single_op/task/aicpu_kernel_task_builder.cc b/ge/single_op/task/aicpu_kernel_task_builder.cc index 8e140a6f..26f6a166 100755 --- a/ge/single_op/task/aicpu_kernel_task_builder.cc +++ b/ge/single_op/task/aicpu_kernel_task_builder.cc @@ -46,7 +46,7 @@ Status AiCpuCCTaskBuilder::SetKernelArgs(AiCpuCCTask &task) { return SUCCESS; } -Status AiCpuCCTaskBuilder::BuildTask(AiCpuCCTask &task) { +Status AiCpuCCTaskBuilder::BuildTask(AiCpuCCTask &task, uint64_t kernel_id) { auto ret = SetKernelArgs(task); if (ret != SUCCESS) { return ret; @@ -76,7 +76,7 @@ Status AiCpuCCTaskBuilder::BuildTask(AiCpuCCTask &task) { "task def kernel_ext_info.size=%zu, but kernel_ext_info_size=%u.", kernel_ext_info.size(), kernel_ext_info_size); - ret = task.SetExtInfoAndType(kernel_ext_info); + ret = task.SetExtInfoAndType(kernel_ext_info, kernel_id); if (ret != SUCCESS) { GELOGE(ret, "Init ext info failed."); return ret; diff --git a/ge/single_op/task/aicpu_kernel_task_builder.h b/ge/single_op/task/aicpu_kernel_task_builder.h index f9ca0530..e77e3c10 100755 --- a/ge/single_op/task/aicpu_kernel_task_builder.h +++ b/ge/single_op/task/aicpu_kernel_task_builder.h @@ -30,7 +30,7 @@ class AiCpuCCTaskBuilder { explicit AiCpuCCTaskBuilder(const OpDescPtr &op_desc, const domi::KernelDef &kernel_def); ~AiCpuCCTaskBuilder() = default; - Status BuildTask(AiCpuCCTask &task); + Status BuildTask(AiCpuCCTask &task, uint64_t kernel_id); private: Status SetKernelArgs(AiCpuCCTask &task); diff --git a/ge/single_op/task/aicpu_task_builder.cc b/ge/single_op/task/aicpu_task_builder.cc index 468fee86..d91bba17 100755 --- a/ge/single_op/task/aicpu_task_builder.cc +++ b/ge/single_op/task/aicpu_task_builder.cc @@ -111,7 +111,7 @@ namespace ge { } Status AiCpuTaskBuilder::BuildTask(ge::AiCpuTask &task, const SingleOpModelParam ¶m, - bool dynamic_flag, uint64_t session_id) { + bool dynamic_flag, uint64_t kernel_id) { GE_CHK_STATUS_RET_NOLOG(InitWorkspaceAndIO(&task.io_addr_, &task.workspace_addr_, param, dynamic_flag)); STR_FWK_OP_KERNEL fwk_op_kernel = {0}; @@ -130,7 +130,7 @@ namespace ge { GE_CHK_BOOL_RET_STATUS(kernel_ext_info.size() == kernel_ext_info_size, FAILED, "task def kernel_ext_info.size=%zu, but kernel_ext_info_size=%u.", kernel_ext_info.size(), kernel_ext_info_size); - GE_CHK_STATUS_RET(task.SetExtInfoAndType(kernel_ext_info), "Init ext info failed."); + GE_CHK_STATUS_RET(task.SetExtInfoAndType(kernel_ext_info, kernel_id), "Init ext info failed."); if (task.ext_info_addr_dev_ != nullptr) { fwk_op_kernel.fwkKernelBase.fwk_kernel.extInfoAddr = reinterpret_cast(task.ext_info_addr_dev_); @@ -138,13 +138,9 @@ namespace ge { } GE_CHK_STATUS_RET(task.InitForSummaryAndCopy(), "AiCpuTask init for summary and copy task failed."); - // Create session - fwk_op_kernel.fwkKernelBase.fwk_kernel.sessionID = session_id; - GELOGI("Begin to CreateAicpuSession, session id: %lu", session_id); - GE_CHECK_NOTNULL(ModelManager::GetInstance()); - GE_IF_BOOL_EXEC(ModelManager::GetInstance()->CreateAicpuSession(session_id) != SUCCESS, - GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "CreateAicpuSession error. session id: %lu", session_id); - return ACL_ERROR_GE_INTERNAL_ERROR;) + fwk_op_kernel.fwkKernelBase.fwk_kernel.sessionID = ULLONG_MAX; + 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; ret = SetKernelArgs(&task.args_, fwk_op_kernel); if (ret != SUCCESS) { return ret; diff --git a/ge/single_op/task/aicpu_task_builder.h b/ge/single_op/task/aicpu_task_builder.h index 6dcd7a0f..4669e118 100755 --- a/ge/single_op/task/aicpu_task_builder.h +++ b/ge/single_op/task/aicpu_task_builder.h @@ -29,7 +29,7 @@ namespace ge { AiCpuTaskBuilder(const OpDescPtr &op_desc, const domi::KernelExDef &kernel_def); ~AiCpuTaskBuilder() = default; - Status BuildTask(AiCpuTask &task, const SingleOpModelParam ¶m, bool dynamic_flag, uint64_t session_id); + Status BuildTask(AiCpuTask &task, const SingleOpModelParam ¶m, bool dynamic_flag, uint64_t kernel_id); private: static Status SetKernelArgs(void **args, STR_FWK_OP_KERNEL &kernel); diff --git a/ge/single_op/task/op_task.cc b/ge/single_op/task/op_task.cc index 30d4d311..1b4b23ff 100755 --- a/ge/single_op/task/op_task.cc +++ b/ge/single_op/task/op_task.cc @@ -245,7 +245,7 @@ AiCpuBaseTask::~AiCpuBaseTask() { } } -Status AiCpuBaseTask::SetExtInfoAndType(const std::string &kernel_ext_info) { +Status AiCpuBaseTask::SetExtInfoAndType(const std::string &kernel_ext_info, uint64_t kernel_id) { if (kernel_ext_info.empty()) { GELOGI("Kernel_ext_info is empty, no need copy to device."); return SUCCESS; @@ -268,9 +268,13 @@ Status AiCpuBaseTask::SetExtInfoAndType(const std::string &kernel_ext_info) { return ret; } - GE_CHK_RT_RET(rtMalloc(&ext_info_addr_dev_, kernel_ext_info.size(), RT_MEMORY_HBM)); - GE_CHK_RT_RET(rtMemcpy(ext_info_addr_dev_, kernel_ext_info.size(), - kernel_ext_info.data(), kernel_ext_info.size(), RT_MEMCPY_HOST_TO_DEVICE)); + GE_CHK_STATUS_RET(aicpu_ext_handle_->UpdateSessionInfo(ULLONG_MAX, kernel_id, false), + "UpdateSessionInfo failed."); + + 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(), + aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), + RT_MEMCPY_HOST_TO_DEVICE)); return SUCCESS; } diff --git a/ge/single_op/task/op_task.h b/ge/single_op/task/op_task.h index 1b4d9c02..bf8316f6 100644 --- a/ge/single_op/task/op_task.h +++ b/ge/single_op/task/op_task.h @@ -132,7 +132,7 @@ class AiCpuBaseTask : public OpTask { const UnknowShapeOpType GetUnknownType() const { return unknown_type_; } protected: - Status SetExtInfoAndType(const std::string &kernel_ext_info); + Status SetExtInfoAndType(const std::string &kernel_ext_info, uint64_t kernel_id); Status UpdateExtInfo(const std::vector &input_desc, std::vector &output_desc, diff --git a/metadef b/metadef index a464149d..fb871b4e 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit a464149d95257e7514859b198444fb341dc40786 +Subproject commit fb871b4e00e64154130b3e5f612c4bdc2ad12d40 diff --git a/parser b/parser index c4f6e1e0..3d49906d 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit c4f6e1e03ac58a5c24e9bd3a04634f7e7b3213c3 +Subproject commit 3d49906d119b1cc01f4256d7992759ce9f3dcfcd