已合并
fix: 修复用gcc 15编译代码时的报错 #4356
likun104创建于 26 天前
fix: 修复用gcc 15编译代码时的报错 #4356
已合并
共 32 个文件变更+126-18
| @@ -106,6 +106,11 @@ Status DataSliceElementwiseImpl::InferAxisSlice(Operator &op, const AxisTypeInfo | |||
| 106 | if (!CheckOutDataSlice(op_desc, output_cutinfo, out_data_slice)) { | 106 | if (!CheckOutDataSlice(op_desc, output_cutinfo, out_data_slice)) { |
| 107 | return FAILED; | 107 | return FAILED; |
| 108 | } | 108 | } |
| 109 | + if (out_data_slice.empty() || out_data_slice[0].empty() || output_cutinfo[0].second.empty() || | ||
| 110 | + static_cast<size_t>(output_cutinfo[0].second[0]) >= out_data_slice[0].size()) { | ||
| 111 | + GELOGE(FAILED, "The op[%s] output data slice is empty or index out of range.", DataSliceGetName(op).c_str()); | ||
| 112 | + return FAILED; | ||
| 113 | + } | ||
| 109 | 114 | ||
| 110 | // 遍历得到in_data_slice | 115 | // 遍历得到in_data_slice |
| 111 | for (size_t i = 0; i < input_cutinfo.size(); ++i) { | 116 | for (size_t i = 0; i < input_cutinfo.size(); ++i) { |
| @@ -33,6 +33,7 @@ class AutoTuningHcomGraphOptimizer : public HcomGraphOptimizer { | |||
| 33 | ge::Status OptimizeFusedGraph(ge::ComputeGraph &graph) override; | 33 | ge::Status OptimizeFusedGraph(ge::ComputeGraph &graph) override; |
| 34 | 34 | ||
| 35 | protected: | 35 | protected: |
| 36 | + using HcomGraphOptimizer::CalcOpRunningParam; | ||
| 36 | HcclResult CheckSupportedOP(const std::string &sCollectiveType) const override; | 37 | HcclResult CheckSupportedOP(const std::string &sCollectiveType) const override; |
| 37 | HcclResult CalcOpRunningParam(ge::Node &node); | 38 | HcclResult CalcOpRunningParam(ge::Node &node); |
| 38 | HcclResult SetOpOutputMemSize(ge::Node &node, const std::string &sCollectiveType) override; | 39 | HcclResult SetOpOutputMemSize(ge::Node &node, const std::string &sCollectiveType) override; |
| @@ -132,7 +132,8 @@ struct NodeInfo { | |||
| 132 | anchor_index_of_curr_node(anchor_index_of_curr_node_param), | 132 | anchor_index_of_curr_node(anchor_index_of_curr_node_param), |
| 133 | last_node_info(last_node_info_param), | 133 | last_node_info(last_node_info_param), |
| 134 | is_sub_graph_data_or_nt_opt(is_sub_graph_data_or_nt_opt_param), | 134 | is_sub_graph_data_or_nt_opt(is_sub_graph_data_or_nt_opt_param), |
| 135 | - is_input_of_curr_node(is_input_of_curr_node_param) { | 135 | + is_input_of_curr_node(is_input_of_curr_node_param), |
| 136 | + tensor_map(2) { | ||
| 136 | propagation_info.group = propagation_info_param.group; | 137 | propagation_info.group = propagation_info_param.group; |
| 137 | propagation_info.reshape_type = propagation_info_param.reshape_type; | 138 | propagation_info.reshape_type = propagation_info_param.reshape_type; |
| 138 | propagation_info.heavy_format = heavy_format_param; | 139 | propagation_info.heavy_format = heavy_format_param; |
| @@ -210,7 +210,7 @@ void GenerateAggregateHeaders(GeneratorManager &manager) { | |||
| 210 | */ | 210 | */ |
| 211 | void ProcessOutputDirectory(std::string &output_dir) { | 211 | void ProcessOutputDirectory(std::string &output_dir) { |
| 212 | // 确保输出目录以路径分隔符结尾 | 212 | // 确保输出目录以路径分隔符结尾 |
| 213 | - if (output_dir.back() != '/' && output_dir.back() != '\\') { | 213 | + if (!output_dir.empty() && output_dir.back() != '/' && output_dir.back() != '\\') { |
| 214 | output_dir += "/"; | 214 | output_dir += "/"; |
| 215 | } | 215 | } |
| 216 | 216 | ||
| @@ -97,7 +97,7 @@ class SymbolicInferUtil { | |||
| 97 | size_t axes_size, const bool keep_dims, gert::SymbolShape *output_shape) { | 97 | size_t axes_size, const bool keep_dims, gert::SymbolShape *output_shape) { |
| 98 | auto exps = *axes_tensor->GetSymbolicValue(); | 98 | auto exps = *axes_tensor->GetSymbolicValue(); |
| 99 | std::vector<T> axes_dims_const; | 99 | std::vector<T> axes_dims_const; |
| 100 | - axes_dims_const.reserve(axes_size); | 100 | + axes_dims_const.resize(axes_size); |
| 101 | for (size_t i = 0; i < axes_size; ++i) { | 101 | for (size_t i = 0; i < axes_size; ++i) { |
| 102 | if (exps[i].GetConstValue<T>(axes_dims_const[i]) == false) { | 102 | if (exps[i].GetConstValue<T>(axes_dims_const[i]) == false) { |
| 103 | return UNSUPPORTED; | 103 | return UNSUPPORTED; |
| @@ -413,6 +413,10 @@ Status DoComputeAndUpdate(const NodePtr &node) { | |||
| 413 | .Inputs(GetVoidPtr<gert::SymbolTensor>(inputs_holder)) | 413 | .Inputs(GetVoidPtr<gert::SymbolTensor>(inputs_holder)) |
| 414 | .Outputs(GetVoidPtr<gert::SymbolTensor>(outputs_holder)) | 414 | .Outputs(GetVoidPtr<gert::SymbolTensor>(outputs_holder)) |
| 415 | .Build(op_desc); | 415 | .Build(op_desc); |
| 416 | + if (kernel_context_holder.context_ == nullptr) { | ||
| 417 | + GELOGW("Build kernel context failed, node %s[%s].", op_desc->GetName().c_str(), op_desc->GetType().c_str()); | ||
| 418 | + return UNSUPPORTED; | ||
| 419 | + } | ||
| 416 | auto infer_symbol_shape_ctx = reinterpret_cast<gert::InferSymbolComputeContext *>(kernel_context_holder.context_); | 420 | auto infer_symbol_shape_ctx = reinterpret_cast<gert::InferSymbolComputeContext *>(kernel_context_holder.context_); |
| 417 | auto ret = kernel_func(infer_symbol_shape_ctx); | 421 | auto ret = kernel_func(infer_symbol_shape_ctx); |
| 418 | GE_ASSERT_TRUE(ret == ge::GRAPH_SUCCESS || ret == ge::UNSUPPORTED, | 422 | GE_ASSERT_TRUE(ret == ge::GRAPH_SUCCESS || ret == ge::UNSUPPORTED, |
| @@ -471,6 +475,10 @@ Status DoInferAndUpdate(const NodePtr &node, const gert::OpImplKernelRegistry::O | |||
| 471 | .Inputs(GetVoidPtr<gert::SymbolTensor>(inputs_holder)) | 475 | .Inputs(GetVoidPtr<gert::SymbolTensor>(inputs_holder)) |
| 472 | .Outputs(GetVoidPtr<gert::SymbolShape>(outputs_holder)) | 476 | .Outputs(GetVoidPtr<gert::SymbolShape>(outputs_holder)) |
| 473 | .Build(op_desc); | 477 | .Build(op_desc); |
| 478 | + if (kernel_context_holder.context_ == nullptr) { | ||
| 479 | + GELOGW("Build kernel context failed, node %s[%s].", op_desc->GetName().c_str(), op_desc->GetType().c_str()); | ||
| 480 | + return UNSUPPORTED; | ||
| 481 | + } | ||
| 474 | auto infer_symbol_shape_ctx = reinterpret_cast<gert::InferSymbolShapeContext *>(kernel_context_holder.context_); | 482 | auto infer_symbol_shape_ctx = reinterpret_cast<gert::InferSymbolShapeContext *>(kernel_context_holder.context_); |
| 475 | auto infer_ret = func->infer_symbol_shape(infer_symbol_shape_ctx); | 483 | auto infer_ret = func->infer_symbol_shape(infer_symbol_shape_ctx); |
| 476 | GE_ASSERT_TRUE((infer_ret == SUCCESS) || (infer_ret == UNSUPPORTED), | 484 | GE_ASSERT_TRUE((infer_ret == SUCCESS) || (infer_ret == UNSUPPORTED), |
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | + | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | 17 | ||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | + | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | 17 | ||
| @@ -10,6 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | + | ||
| 14 | + | ||
| 13 | 15 | ||
| 14 | 16 | ||
| 15 | 17 | ||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | + | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | 17 | ||
| @@ -10,6 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | + | ||
| 14 | + | ||
| 13 | 15 | ||
| 14 | 16 | ||
| 15 | 17 | ||
| @@ -16,6 +16,7 @@ | |||
| 16 | namespace ge { | 16 | namespace ge { |
| 17 | class PARSER_FUNC_VISIBILITY CaffeCustomParserAdapter : public CaffeOpParser { | 17 | class PARSER_FUNC_VISIBILITY CaffeCustomParserAdapter : public CaffeOpParser { |
| 18 | public: | 18 | public: |
| 19 | + using CaffeOpParser::ParseParams; | ||
| 19 | /** | 20 | /** |
| 20 | * @ingroup domi_omg | 21 | * @ingroup domi_omg |
| 21 | * @brief parse params of the operation | 22 | * @brief parse params of the operation |
| @@ -2751,6 +2751,11 @@ void DavinciModel::InitModelInputsMergeCopyHostMem() { | |||
| 2751 | std::vector<std::pair<uint32_t, uint64_t>> input_index_and_logical_addr; | 2751 | std::vector<std::pair<uint32_t, uint64_t>> input_index_and_logical_addr; |
| 2752 | for (auto idx : zero_copy_input_indexes_) { | 2752 | for (auto idx : zero_copy_input_indexes_) { |
| 2753 | const auto id = input_index_to_allocation_ids_[idx]; | 2753 | const auto id = input_index_to_allocation_ids_[idx]; |
| 2754 | + if (static_cast<size_t>(id) >= logical_mem_allocations_.size()) { | ||
| 2755 | + GELOGW("[InputMergeCopy] allocation id %u out of range, logical_mem_allocations size %zu, skip.", id, | ||
| 2756 | + logical_mem_allocations_.size()); | ||
| 2757 | + continue; | ||
| 2758 | + } | ||
| 2754 | const auto input_size = logical_mem_allocations_[id].tensor_size; | 2759 | const auto input_size = logical_mem_allocations_[id].tensor_size; |
| 2755 | if (input_size > input_fusion_size) { | 2760 | if (input_size > input_fusion_size) { |
| 2756 | GELOGI("[InputMergeCopy]Input[%u] size %" PRIu64 " is bigger than input fusion size %" PRIu64 | 2761 | GELOGI("[InputMergeCopy]Input[%u] size %" PRIu64 " is bigger than input fusion size %" PRIu64 |
| @@ -6872,6 +6877,10 @@ Status DavinciModel::ConstructZeroCopyIoActiveBaseAddrs( | |||
| 6872 | : ValueToPtr(PtrToValue(tensors[io_idx].GetData().data())); | 6877 | : ValueToPtr(PtrToValue(tensors[io_idx].GetData().data())); |
| 6873 | 6878 | ||
| 6874 | GE_ASSERT_TRUE(id != UINT32_MAX); | 6879 | GE_ASSERT_TRUE(id != UINT32_MAX); |
| 6880 | + if (static_cast<size_t>(id) >= logical_mem_allocations_.size()) { | ||
| 6881 | + GELOGW("[ZCPY] allocation id %u is out of range [0, %zu), skip.", id, logical_mem_allocations_.size()); | ||
| 6882 | + continue; | ||
| 6883 | + } | ||
| 6875 | GE_ASSERT_TRUE(CheckUserAndModelSize(static_cast<int64_t>(buffer_length), | 6884 | GE_ASSERT_TRUE(CheckUserAndModelSize(static_cast<int64_t>(buffer_length), |
| 6876 | static_cast<int64_t>(logical_mem_allocations_[id].data_size), | 6885 | static_cast<int64_t>(logical_mem_allocations_[id].data_size), |
| 6877 | is_input ? K_INPUT : K_OUTPUT), | 6886 | is_input ? K_INPUT : K_OUTPUT), |
| @@ -6962,6 +6971,10 @@ Status DavinciModel::ConstructZeroCopyIoActiveBaseAddrs( | |||
| 6962 | : ValueToPtr(PtrToValue(tensors[io_idx].GetAddr())); | 6971 | : ValueToPtr(PtrToValue(tensors[io_idx].GetAddr())); |
| 6963 | 6972 | ||
| 6964 | GE_ASSERT_TRUE(id != UINT32_MAX); | 6973 | GE_ASSERT_TRUE(id != UINT32_MAX); |
| 6974 | + if (static_cast<size_t>(id) >= logical_mem_allocations_.size()) { | ||
| 6975 | + GELOGW("[ZCPY] allocation id %u is out of range [0, %zu), skip.", id, logical_mem_allocations_.size()); | ||
| 6976 | + continue; | ||
| 6977 | + } | ||
| 6965 | GE_ASSERT_TRUE(CheckUserAndModelSize(static_cast<int64_t>(buffer_length), | 6978 | GE_ASSERT_TRUE(CheckUserAndModelSize(static_cast<int64_t>(buffer_length), |
| 6966 | static_cast<int64_t>(logical_mem_allocations_[id].data_size), | 6979 | static_cast<int64_t>(logical_mem_allocations_[id].data_size), |
| 6967 | is_input ? K_INPUT : K_OUTPUT), | 6980 | is_input ? K_INPUT : K_OUTPUT), |
| @@ -679,6 +679,10 @@ Status ModelArgsManager::InitTaskInfoV2(domi::ModelTaskDef &model_task_def) { | |||
| 679 | 679 | ||
| 680 | void ModelArgsManager::InitForUpdate() { | 680 | void ModelArgsManager::InitForUpdate() { |
| 681 | const size_t size = davinci_model_->GetLogicalMemAllocation().size(); | 681 | const size_t size = davinci_model_->GetLogicalMemAllocation().size(); |
| 682 | + if (size == 0U) { | ||
| 683 | + GELOGW("logical_mem_allocations is empty, skip InitForUpdate."); | ||
| 684 | + return; | ||
| 685 | + } | ||
| 682 | last_bases_.resize(size, UINT64_MAX); | 686 | last_bases_.resize(size, UINT64_MAX); |
| 683 | id_to_plicy_.resize(size); | 687 | id_to_plicy_.resize(size); |
| 684 | 688 | ||
| @@ -776,7 +776,7 @@ void KernelTaskInfo::GetAtomicOutAddrs(const std::vector<uint64_t> &output_data_ | |||
| 776 | std::vector<uint64_t> &atomic_output_data_addrs) const { | 776 | std::vector<uint64_t> &atomic_output_data_addrs) const { |
| 777 | std::vector<uint64_t> output_addr_mem_types; | 777 | std::vector<uint64_t> output_addr_mem_types; |
| 778 | std::vector<uint64_t> atomic_output_addr_mem_types; | 778 | std::vector<uint64_t> atomic_output_addr_mem_types; |
| 779 | - output_addr_mem_types.reserve(output_data_addrs.size()); | 779 | + output_addr_mem_types.resize(output_data_addrs.size()); |
| 780 | GetAtomicOutAddrs(output_data_addrs, output_addr_mem_types, atomic_output_data_addrs, atomic_output_addr_mem_types); | 780 | GetAtomicOutAddrs(output_data_addrs, output_addr_mem_types, atomic_output_data_addrs, atomic_output_addr_mem_types); |
| 781 | } | 781 | } |
| 782 | 782 | ||
| @@ -798,7 +798,7 @@ void KernelTaskInfo::GetAtomicWorkspaceAddrs(const std::vector<uint64_t> &worksp | |||
| 798 | std::vector<uint64_t> &atomic_workspace_data_addrs) const { | 798 | std::vector<uint64_t> &atomic_workspace_data_addrs) const { |
| 799 | std::vector<uint64_t> workspace_addr_types; | 799 | std::vector<uint64_t> workspace_addr_types; |
| 800 | std::vector<uint64_t> atomic_workspace_addr_types; | 800 | std::vector<uint64_t> atomic_workspace_addr_types; |
| 801 | - workspace_addr_types.reserve(workspace_data_addrs.size()); | 801 | + workspace_addr_types.resize(workspace_data_addrs.size()); |
| 802 | GetAtomicWorkspaceAddrs(workspace_data_addrs, workspace_addr_types, atomic_workspace_data_addrs, | 802 | GetAtomicWorkspaceAddrs(workspace_data_addrs, workspace_addr_types, atomic_workspace_data_addrs, |
| 803 | atomic_workspace_addr_types); | 803 | atomic_workspace_addr_types); |
| 804 | } | 804 | } |
| @@ -2196,7 +2196,8 @@ Status KernelTaskInfo::InitAicpuKfcTask(const domi::KernelDef &kernel_def) { | |||
| 2196 | 2196 | ||
| 2197 | // copy args to new host memory | 2197 | // copy args to new host memory |
| 2198 | args_addr_.resize(static_cast<size_t>(args_size_)); | 2198 | args_addr_.resize(static_cast<size_t>(args_size_)); |
| 2199 | - args_addr_.assign(kernel_def.args().begin(), kernel_def.args().end()); | 2199 | + GE_ASSERT_EOK(memcpy_s(args_addr_.data(), static_cast<size_t>(args_size_), kernel_def.args().data(), |
| 2200 | + static_cast<size_t>(kernel_def.args().size()))); | ||
| 2200 | 2201 | ||
| 2201 | size_t cur_offset = 0UL; | 2202 | size_t cur_offset = 0UL; |
| 2202 | size_t args_size_max = static_cast<size_t>(args_size_); | 2203 | size_t args_size_max = static_cast<size_t>(args_size_); |
| @@ -1082,6 +1082,7 @@ Status PhysicalMemoryAllocator::Finalize(uint8_t *const va, size_t size) { | |||
| 1082 | } | 1082 | } |
| 1083 | if (physical_memory_size_ == 0U) { | 1083 | if (physical_memory_size_ == 0U) { |
| 1084 | physical_memorys_.clear(); | 1084 | physical_memorys_.clear(); |
| 1085 | + free_physical_memorys_.clear(); | ||
| 1085 | } | 1086 | } |
| 1086 | return SUCCESS; | 1087 | return SUCCESS; |
| 1087 | } | 1088 | } |
| @@ -1063,6 +1063,11 @@ Status AicpuNodeTask::SetMemCopyTask(const domi::TaskDef &task_def) { | |||
| 1063 | aicpu::AicpuParamHead *const memcpy_param_head = PtrToPtr<uint8_t, aicpu::AicpuParamHead>(memcpy_args_.get()); | 1063 | aicpu::AicpuParamHead *const memcpy_param_head = PtrToPtr<uint8_t, aicpu::AicpuParamHead>(memcpy_args_.get()); |
| 1064 | const uint32_t memcpy_io_num = memcpy_param_head->ioAddrNum; | 1064 | const uint32_t memcpy_io_num = memcpy_param_head->ioAddrNum; |
| 1065 | // if has input and output, need copy to ioaddr | 1065 | // if has input and output, need copy to ioaddr |
| 1066 | + if (copy_io_addr_.empty()) { | ||
| 1067 | + GELOGE(INTERNAL_ERROR, "[Check][Size]Node[%s(%s)] copy_io_addr_ is empty, cannot copy io addr.", node_name_.c_str(), | ||
| 1068 | + node_type_.c_str()); | ||
| 1069 | + return INTERNAL_ERROR; | ||
| 1070 | + } | ||
| 1066 | const errno_t cpy_ret = memcpy_s(&memcpy_args_[sizeof(aicpu::AicpuParamHead)], | 1071 | const errno_t cpy_ret = memcpy_s(&memcpy_args_[sizeof(aicpu::AicpuParamHead)], |
| 1067 | static_cast<size_t>(memcpy_args_size_) - sizeof(aicpu::AicpuParamHead), | 1072 | static_cast<size_t>(memcpy_args_size_) - sizeof(aicpu::AicpuParamHead), |
| 1068 | ©_io_addr_[0U], sizeof(uint64_t) * memcpy_io_num); | 1073 | ©_io_addr_[0U], sizeof(uint64_t) * memcpy_io_num); |
| @@ -1269,6 +1274,7 @@ Status AicpuNodeTask::UpdateHostMemInputArgs(const TaskContext &context) { | |||
| 1269 | } | 1274 | } |
| 1270 | 1275 | ||
| 1271 | Status AicpuNodeTask::UpdateIoAddr(TaskContext &context) { | 1276 | Status AicpuNodeTask::UpdateIoAddr(TaskContext &context) { |
| 1277 | + GE_CHECK_NOTNULL(args_); | ||
| 1272 | uint64_t *io_addrs = PtrToPtr<uint8_t, uint64_t>(&args_[sizeof(aicpu::AicpuParamHead)]); | 1278 | uint64_t *io_addrs = PtrToPtr<uint8_t, uint64_t>(&args_[sizeof(aicpu::AicpuParamHead)]); |
| 1273 | GE_CHECK_LE((((static_cast<size_t>(node_item_->num_inputs + node_item_->num_outputs)) * sizeof(uint64_t)) + | 1279 | GE_CHECK_LE((((static_cast<size_t>(node_item_->num_inputs + node_item_->num_outputs)) * sizeof(uint64_t)) + |
| 1274 | sizeof(aicpu::AicpuParamHead)), | 1280 | sizeof(aicpu::AicpuParamHead)), |
| @@ -1579,6 +1579,11 @@ Status AiCpuCCTask::SetMemCopyTask(const domi::KernelDef &kernel_def) { | |||
| 1579 | const auto memcpy_io_addr = | 1579 | const auto memcpy_io_addr = |
| 1580 | PtrToPtr<void, uint8_t>(ValueToPtr(PtrToValue(memcpy_args_.get()) + sizeof(aicpu::AicpuParamHead))); | 1580 | PtrToPtr<void, uint8_t>(ValueToPtr(PtrToValue(memcpy_args_.get()) + sizeof(aicpu::AicpuParamHead))); |
| 1581 | // if has input and output, need copy to ioaddr | 1581 | // if has input and output, need copy to ioaddr |
| 1582 | + if (copy_io_addr_.empty()) { | ||
| 1583 | + GELOGE(INTERNAL_ERROR, "[Check][Size]Node[MemCopy] copy_io_addr_ is empty, cannot copy io addr."); | ||
| 1584 | + REPORT_INNER_ERR_MSG("E19999", "Node[MemCopy] copy_io_addr_ is empty."); | ||
| 1585 | + return INTERNAL_ERROR; | ||
| 1586 | + } | ||
| 1582 | const int32_t cpy_ret = | 1587 | const int32_t cpy_ret = |
| 1583 | memcpy_s(memcpy_io_addr, static_cast<size_t>(memcpy_args_size_ - sizeof(aicpu::AicpuParamHead)), | 1588 | memcpy_s(memcpy_io_addr, static_cast<size_t>(memcpy_args_size_ - sizeof(aicpu::AicpuParamHead)), |
| 1584 | ©_io_addr_[0U], sizeof(uint64_t) * memcpy_io_num); | 1589 | ©_io_addr_[0U], sizeof(uint64_t) * memcpy_io_num); |
| @@ -514,6 +514,10 @@ Status MixL2TaskBuilder::BuildMixL2Task(MixL2OpTask &task, SingleOpModelParam &p | |||
| 514 | tiling_data_size_); | 514 | tiling_data_size_); |
| 515 | 515 | ||
| 516 | // Init IO/workspace addr | 516 | // Init IO/workspace addr |
| 517 | + if (task.host_args_.empty()) { | ||
| 518 | + GELOGD("host_args_ is empty, skip InitKernelArgs."); | ||
| 519 | + return SUCCESS; | ||
| 520 | + } | ||
| 517 | GE_CHK_STATUS_RET(InitKernelArgs(&task.host_args_[task.args_addr_base_idx_], addr_len, param)); | 521 | GE_CHK_STATUS_RET(InitKernelArgs(&task.host_args_[task.args_addr_base_idx_], addr_len, param)); |
| 518 | GE_CHK_STATUS_RET(InitTilingDataAddrToArgs(task), "Init tiling data addr to args failed."); | 522 | GE_CHK_STATUS_RET(InitTilingDataAddrToArgs(task), "Init tiling data addr to args failed."); |
| 519 | GE_CHK_STATUS_RET(task.SetArgIndex(), "Set argtable failed."); | 523 | GE_CHK_STATUS_RET(task.SetArgIndex(), "Set argtable failed."); |
| @@ -1360,7 +1360,7 @@ TEST_F(STEST_fusion_engine_fuzzy_generalize, unlimited_node_generalize) { | |||
| 1360 | InputNodeGeneralize input_node_generalize(fuzzy_ptr->external_input_nodes_, graph_type, fuzzy_ptr->node_info_map_, | 1360 | InputNodeGeneralize input_node_generalize(fuzzy_ptr->external_input_nodes_, graph_type, fuzzy_ptr->node_info_map_, |
| 1361 | tbe_op_store_adapter_, nullptr); | 1361 | tbe_op_store_adapter_, nullptr); |
| 1362 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); | 1362 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); |
| 1363 | - ; | 1363 | + node_info_bn->op_info = std::make_shared<te::TbeOpInfo>(bn_node->GetName(), "", bn_node->GetType(), ""); |
| 1364 | std::unordered_set<ge::NodePtr> root_set{data_node}; | 1364 | std::unordered_set<ge::NodePtr> root_set{data_node}; |
| 1365 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); | 1365 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); |
| 1366 | node_info_bn->is_found_in_opstore = true; | 1366 | node_info_bn->is_found_in_opstore = true; |
| @@ -1395,7 +1395,7 @@ TEST_F(STEST_fusion_engine_fuzzy_generalize, GeneralizeFirstNodeOfGraph) { | |||
| 1395 | fuzzy_ptr->node_info_map_.clear(); | 1395 | fuzzy_ptr->node_info_map_.clear(); |
| 1396 | 1396 | ||
| 1397 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); | 1397 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); |
| 1398 | - ; | 1398 | + node_info_bn->op_info = std::make_shared<te::TbeOpInfo>(bn_node->GetName(), "", bn_node->GetType(), ""); |
| 1399 | std::unordered_set<ge::NodePtr> root_set{data_node}; | 1399 | std::unordered_set<ge::NodePtr> root_set{data_node}; |
| 1400 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); | 1400 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); |
| 1401 | node_info_bn->is_found_in_opstore = false; | 1401 | node_info_bn->is_found_in_opstore = false; |
| @@ -1777,7 +1777,7 @@ TEST_F(STEST_fusion_engine_fuzzy_generalize, test_generalization_when_pass_regis | |||
| 1777 | fuzzy_ptr->is_range_limited_graph_ = false; | 1777 | fuzzy_ptr->is_range_limited_graph_ = false; |
| 1778 | fuzzy_ptr->node_info_map_.clear(); | 1778 | fuzzy_ptr->node_info_map_.clear(); |
| 1779 | NodeGeneralInfoPtr node_info_gen = std::make_shared<NodeGeneralInfo>(); | 1779 | NodeGeneralInfoPtr node_info_gen = std::make_shared<NodeGeneralInfo>(); |
| 1780 | - ; | 1780 | + node_info_gen->op_info = std::make_shared<te::TbeOpInfo>(gen_node->GetName(), "", gen_node->GetType(), ""); |
| 1781 | node_info_gen->is_found_in_opstore = true; | 1781 | node_info_gen->is_found_in_opstore = true; |
| 1782 | fuzzy_ptr->node_info_map_.insert(std::make_pair(gen_node, node_info_gen)); | 1782 | fuzzy_ptr->node_info_map_.insert(std::make_pair(gen_node, node_info_gen)); |
| 1783 | 1783 | ||
| @@ -30,6 +30,39 @@ using namespace ge; | |||
| 30 | using TransNodeReformatGeneratorPtr = shared_ptr<TransNodeReformatGenerator>; | 30 | using TransNodeReformatGeneratorPtr = shared_ptr<TransNodeReformatGenerator>; |
| 31 | using TransNodeInsertionPtr = shared_ptr<TransNodeInsertion>; | 31 | using TransNodeInsertionPtr = shared_ptr<TransNodeInsertion>; |
| 32 | using TransNodeTransDataGeneratorPtr = shared_ptr<TransNodeTransdataGenerator>; | 32 | using TransNodeTransDataGeneratorPtr = shared_ptr<TransNodeTransdataGenerator>; |
| 33 | + | ||
| 34 | +void FillTransInfoForTransData(const TransInfoPtr &trans_info_ptr) { | ||
| 35 | + uint32_t src_anchor_index = static_cast<uint32_t>(trans_info_ptr->src_anchor->GetIdx()); | ||
| 36 | + uint32_t dst_anchor_index = static_cast<uint32_t>(trans_info_ptr->dst_anchor->GetIdx()); | ||
| 37 | + trans_info_ptr->src_out_tensor_desc_ptr = trans_info_ptr->src_op_desc->GetOutputDescPtr(src_anchor_index); | ||
| 38 | + trans_info_ptr->dst_in_tensor_desc_ptr = trans_info_ptr->dst_op_desc->GetInputDescPtr(dst_anchor_index); | ||
| 39 | + if (trans_info_ptr->src_out_tensor_desc_ptr == nullptr || trans_info_ptr->dst_in_tensor_desc_ptr == nullptr) { | ||
| 40 | + return; | ||
| 41 | + } | ||
| 42 | + trans_info_ptr->src_out_shape = trans_info_ptr->src_out_tensor_desc_ptr->GetShape(); | ||
| 43 | + trans_info_ptr->dst_in_shape = trans_info_ptr->dst_in_tensor_desc_ptr->GetShape(); | ||
| 44 | + trans_info_ptr->src_out_primary_format = | ||
| 45 | + static_cast<ge::Format>(ge::GetPrimaryFormat(trans_info_ptr->src_out_tensor_desc_ptr->GetFormat())); | ||
| 46 | + trans_info_ptr->dst_in_primary_format = | ||
| 47 | + static_cast<ge::Format>(ge::GetPrimaryFormat(trans_info_ptr->dst_in_tensor_desc_ptr->GetFormat())); | ||
| 48 | + trans_info_ptr->src_out_sub_format = | ||
| 49 | + static_cast<int32_t>(ge::GetSubFormat(trans_info_ptr->src_out_tensor_desc_ptr->GetFormat())); | ||
| 50 | + trans_info_ptr->dst_in_sub_format = | ||
| 51 | + static_cast<int32_t>(ge::GetSubFormat(trans_info_ptr->dst_in_tensor_desc_ptr->GetFormat())); | ||
| 52 | + trans_info_ptr->src_out_c0_format = | ||
| 53 | + static_cast<int32_t>(ge::GetC0Value(trans_info_ptr->src_out_tensor_desc_ptr->GetFormat())); | ||
| 54 | + trans_info_ptr->dst_in_c0_format = | ||
| 55 | + static_cast<int32_t>(ge::GetC0Value(trans_info_ptr->dst_in_tensor_desc_ptr->GetFormat())); | ||
| 56 | + trans_info_ptr->src_out_data_type = trans_info_ptr->src_out_tensor_desc_ptr->GetDataType(); | ||
| 57 | + trans_info_ptr->dst_in_data_type = trans_info_ptr->dst_in_tensor_desc_ptr->GetDataType(); | ||
| 58 | + trans_info_ptr->src_out_original_shape = trans_info_ptr->src_out_tensor_desc_ptr->GetOriginShape(); | ||
| 59 | + trans_info_ptr->src_out_original_format = trans_info_ptr->src_out_tensor_desc_ptr->GetOriginFormat(); | ||
| 60 | + trans_info_ptr->dst_in_original_shape = trans_info_ptr->dst_in_tensor_desc_ptr->GetOriginShape(); | ||
| 61 | + trans_info_ptr->dst_in_original_format = trans_info_ptr->dst_in_tensor_desc_ptr->GetOriginFormat(); | ||
| 62 | + trans_info_ptr->src_op_desc_type = trans_info_ptr->src_op_desc->GetType(); | ||
| 63 | + trans_info_ptr->dst_op_desc_type = trans_info_ptr->dst_op_desc->GetType(); | ||
| 64 | +} | ||
| 65 | + | ||
| 33 | class TRANS_NODE_REFORMAT_GENERATOR_STEST : public testing::Test { | 66 | class TRANS_NODE_REFORMAT_GENERATOR_STEST : public testing::Test { |
| 34 | protected: | 67 | protected: |
| 35 | void SetUp() {} | 68 | void SetUp() {} |
| @@ -109,6 +142,7 @@ TEST_F(TRANS_NODE_REFORMAT_GENERATOR_STEST, AddTransNode_suc1) { | |||
| 109 | trans_info_ptr->dst_anchor = node_sqr->GetInDataAnchor(0); | 142 | trans_info_ptr->dst_anchor = node_sqr->GetInDataAnchor(0); |
| 110 | trans_info_ptr->src_node_ptr = node_ref0; | 143 | trans_info_ptr->src_node_ptr = node_ref0; |
| 111 | trans_info_ptr->dst_node_ptr = node_sqr; | 144 | trans_info_ptr->dst_node_ptr = node_sqr; |
| 145 | + FillTransInfoForTransData(trans_info_ptr); | ||
| 112 | Status ret = trans_node_transdata_generator->AddTransNode(*fused_graph, trans_info_ptr); | 146 | Status ret = trans_node_transdata_generator->AddTransNode(*fused_graph, trans_info_ptr); |
| 113 | EXPECT_EQ(ret, fe::SUCCESS); | 147 | EXPECT_EQ(ret, fe::SUCCESS); |
| 114 | } | 148 | } |
| @@ -154,6 +188,7 @@ TEST_F(TRANS_NODE_REFORMAT_GENERATOR_STEST, AddTransNode_suc2) { | |||
| 154 | trans_info_ptr->dst_anchor = node_reshape->GetInDataAnchor(0); | 188 | trans_info_ptr->dst_anchor = node_reshape->GetInDataAnchor(0); |
| 155 | trans_info_ptr->src_node_ptr = node_assign; | 189 | trans_info_ptr->src_node_ptr = node_assign; |
| 156 | trans_info_ptr->dst_node_ptr = node_reshape; | 190 | trans_info_ptr->dst_node_ptr = node_reshape; |
| 191 | + FillTransInfoForTransData(trans_info_ptr); | ||
| 157 | Status ret = trans_node_transdata_generator->AddTransNode(*fused_graph, trans_info_ptr); | 192 | Status ret = trans_node_transdata_generator->AddTransNode(*fused_graph, trans_info_ptr); |
| 158 | 193 | ||
| 159 | int count_node = 0; | 194 | int count_node = 0; |
| @@ -376,7 +376,9 @@ void CreateConvSt(ge::NodePtr &node, string op_type) { | |||
| 376 | output0_desc_ptr->SetFormat(ge::FORMAT_NCHW); | 376 | output0_desc_ptr->SetFormat(ge::FORMAT_NCHW); |
| 377 | output0_desc_ptr->SetOriginFormat(ge::FORMAT_NCHW); | 377 | output0_desc_ptr->SetOriginFormat(ge::FORMAT_NCHW); |
| 378 | op_desc_ptr_t->AddOutputDesc("z", output0_desc_ptr->Clone()); | 378 | op_desc_ptr_t->AddOutputDesc("z", output0_desc_ptr->Clone()); |
| 379 | + static std::vector<ge::ComputeGraphPtr> graph_holder; | ||
| 379 | ge::ComputeGraphPtr graph = std::make_shared<ge::ComputeGraph>("test"); | 380 | ge::ComputeGraphPtr graph = std::make_shared<ge::ComputeGraph>("test"); |
| 381 | + graph_holder.emplace_back(graph); | ||
| 380 | node = graph->AddNode(op_desc_ptr_t); | 382 | node = graph->AddNode(op_desc_ptr_t); |
| 381 | } | 383 | } |
| 382 | 384 | ||
| @@ -1363,7 +1363,7 @@ TEST_F(UTEST_fusion_engine_fuzzy_generalize, unlimited_node_generalize) { | |||
| 1363 | InputNodeGeneralize input_node_generalize(fuzzy_ptr->external_input_nodes_, graph_type, fuzzy_ptr->node_info_map_, | 1363 | InputNodeGeneralize input_node_generalize(fuzzy_ptr->external_input_nodes_, graph_type, fuzzy_ptr->node_info_map_, |
| 1364 | tbe_op_store_adapter_, nullptr); | 1364 | tbe_op_store_adapter_, nullptr); |
| 1365 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); | 1365 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); |
| 1366 | - ; | 1366 | + node_info_bn->op_info = std::make_shared<te::TbeOpInfo>(bn_node->GetName(), "", bn_node->GetType(), ""); |
| 1367 | std::unordered_set<ge::NodePtr> root_set{data_node}; | 1367 | std::unordered_set<ge::NodePtr> root_set{data_node}; |
| 1368 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); | 1368 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); |
| 1369 | node_info_bn->is_found_in_opstore = true; | 1369 | node_info_bn->is_found_in_opstore = true; |
| @@ -1398,7 +1398,7 @@ TEST_F(UTEST_fusion_engine_fuzzy_generalize, GeneralizeFirstNodeOfGraph) { | |||
| 1398 | fuzzy_ptr->node_info_map_.clear(); | 1398 | fuzzy_ptr->node_info_map_.clear(); |
| 1399 | 1399 | ||
| 1400 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); | 1400 | NodeGeneralInfoPtr node_info_bn = std::make_shared<NodeGeneralInfo>(); |
| 1401 | - ; | 1401 | + node_info_bn->op_info = std::make_shared<te::TbeOpInfo>(bn_node->GetName(), "", bn_node->GetType(), ""); |
| 1402 | std::unordered_set<ge::NodePtr> root_set{data_node}; | 1402 | std::unordered_set<ge::NodePtr> root_set{data_node}; |
| 1403 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); | 1403 | node_info_bn->inputs_root_map.insert(std::make_pair(bn_node->GetOpDesc()->MutableInputDesc(0), root_set)); |
| 1404 | node_info_bn->is_found_in_opstore = false; | 1404 | node_info_bn->is_found_in_opstore = false; |
| @@ -1780,7 +1780,7 @@ TEST_F(UTEST_fusion_engine_fuzzy_generalize, test_generalization_when_pass_regis | |||
| 1780 | fuzzy_ptr->is_range_limited_graph_ = false; | 1780 | fuzzy_ptr->is_range_limited_graph_ = false; |
| 1781 | fuzzy_ptr->node_info_map_.clear(); | 1781 | fuzzy_ptr->node_info_map_.clear(); |
| 1782 | NodeGeneralInfoPtr node_info_gen = std::make_shared<NodeGeneralInfo>(); | 1782 | NodeGeneralInfoPtr node_info_gen = std::make_shared<NodeGeneralInfo>(); |
| 1783 | - ; | 1783 | + node_info_gen->op_info = std::make_shared<te::TbeOpInfo>(gen_node->GetName(), "", gen_node->GetType(), ""); |
| 1784 | node_info_gen->is_found_in_opstore = true; | 1784 | node_info_gen->is_found_in_opstore = true; |
| 1785 | fuzzy_ptr->node_info_map_.insert(std::make_pair(gen_node, node_info_gen)); | 1785 | fuzzy_ptr->node_info_map_.insert(std::make_pair(gen_node, node_info_gen)); |
| 1786 | 1786 | ||
Mtests/engines/nn_engine/ut/testcase/fusion_engine/ops_kernel_store/ops_kernel_info_store_unittest.cc+2-0
| @@ -2085,7 +2085,9 @@ void CreateConv(ge::NodePtr &node, string op_type) { | |||
| 2085 | output0_desc_ptr->SetFormat(ge::FORMAT_NCHW); | 2085 | output0_desc_ptr->SetFormat(ge::FORMAT_NCHW); |
| 2086 | output0_desc_ptr->SetOriginFormat(ge::FORMAT_NCHW); | 2086 | output0_desc_ptr->SetOriginFormat(ge::FORMAT_NCHW); |
| 2087 | op_desc_ptr_t->AddOutputDesc("z", output0_desc_ptr->Clone()); | 2087 | op_desc_ptr_t->AddOutputDesc("z", output0_desc_ptr->Clone()); |
| 2088 | + static std::vector<ge::ComputeGraphPtr> graph_holder; | ||
| 2088 | ge::ComputeGraphPtr graph = std::make_shared<ge::ComputeGraph>("test"); | 2089 | ge::ComputeGraphPtr graph = std::make_shared<ge::ComputeGraph>("test"); |
| 2090 | + graph_holder.emplace_back(graph); | ||
| 2089 | node = graph->AddNode(op_desc_ptr_t); | 2091 | node = graph->AddNode(op_desc_ptr_t); |
| 2090 | } | 2092 | } |
| 2091 | 2093 | ||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | + | ||
| 15 | 16 | ||
| 16 | typedef ssize_t Py_ssize_t; | 17 | typedef ssize_t Py_ssize_t; |
| 17 | 18 | ||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | + | ||
| 16 | 17 | ||
| 17 | 18 | ||
| 18 | PyGILState_STATE PyGILState_Ensure(void); | 19 | PyGILState_STATE PyGILState_Ensure(void); |
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | + | ||
| 17 | 18 | ||
| 18 | typedef ssize_t Py_ssize_t; | 19 | typedef ssize_t Py_ssize_t; |
| 19 | 20 | ||
| @@ -101,9 +101,11 @@ TEST_F(DataSlice, data_slice_helper_1) { | |||
| 101 | 101 | ||
| 102 | TEST_F(DataSlice, data_slice_helper_2) { | 102 | TEST_F(DataSlice, data_slice_helper_2) { |
| 103 | OpDescPtr op_desc = std::make_shared<OpDesc>("Cast", "Cast"); | 103 | OpDescPtr op_desc = std::make_shared<OpDesc>("Cast", "Cast"); |
| 104 | - GeTensorDesc output_desc; | 104 | + GeTensorDesc output_desc(ge::GeShape({10})); |
| 105 | + std::vector<std::vector<int64_t>> slice_info = {{0, 10}}; | ||
| 106 | + (void)AttrUtils::SetListListInt(output_desc, ge::ATTR_NAME_DATA_SLICE, slice_info); | ||
| 105 | op_desc->AddOutputDesc("output", output_desc); | 107 | op_desc->AddOutputDesc("output", output_desc); |
| 106 | - GeTensorDesc input_desc; | 108 | + GeTensorDesc input_desc(ge::GeShape({10})); |
| 107 | op_desc->AddInputDesc("input", input_desc); | 109 | op_desc->AddInputDesc("input", input_desc); |
| 108 | AxisTypeInfo axis_type_info; | 110 | AxisTypeInfo axis_type_info; |
| 109 | axis_type_info.SetAxisType(AxisType::ELEMENTWISE); | 111 | axis_type_info.SetAxisType(AxisType::ELEMENTWISE); |
| @@ -101,9 +101,11 @@ TEST_F(DataSlice, data_slice_helper_1) { | |||
| 101 | 101 | ||
| 102 | TEST_F(DataSlice, data_slice_helper_2) { | 102 | TEST_F(DataSlice, data_slice_helper_2) { |
| 103 | OpDescPtr op_desc = std::make_shared<OpDesc>("Cast", "Cast"); | 103 | OpDescPtr op_desc = std::make_shared<OpDesc>("Cast", "Cast"); |
| 104 | - GeTensorDesc output_desc; | 104 | + GeTensorDesc output_desc(ge::GeShape({10})); |
| 105 | + std::vector<std::vector<int64_t>> slice_info = {{0, 10}}; | ||
| 106 | + (void)AttrUtils::SetListListInt(output_desc, ge::ATTR_NAME_DATA_SLICE, slice_info); | ||
| 105 | op_desc->AddOutputDesc("output", output_desc); | 107 | op_desc->AddOutputDesc("output", output_desc); |
| 106 | - GeTensorDesc input_desc; | 108 | + GeTensorDesc input_desc(ge::GeShape({10})); |
| 107 | op_desc->AddInputDesc("input", input_desc); | 109 | op_desc->AddInputDesc("input", input_desc); |
| 108 | AxisTypeInfo axis_type_info; | 110 | AxisTypeInfo axis_type_info; |
| 109 | axis_type_info.SetAxisType(AxisType::ELEMENTWISE); | 111 | axis_type_info.SetAxisType(AxisType::ELEMENTWISE); |
| @@ -1525,6 +1525,7 @@ TEST_F(UtestKernelTaskInfo, kernel_task_info_update_args_te) { | |||
| 1525 | EXPECT_EQ(kernel_task_info.UpdateHostArgs(active_base_addr, nullptr, 0), SUCCESS); | 1525 | EXPECT_EQ(kernel_task_info.UpdateHostArgs(active_base_addr, nullptr, 0), SUCCESS); |
| 1526 | kernel_task_info.kernel_type_ = ccKernelType::AI_CPU; | 1526 | kernel_task_info.kernel_type_ = ccKernelType::AI_CPU; |
| 1527 | kernel_task_info.args_size_ = 8; | 1527 | kernel_task_info.args_size_ = 8; |
| 1528 | + kernel_task_info.args_addr_.resize(kernel_task_info.args_size_); | ||
| 1528 | EXPECT_NE(kernel_task_info.UpdateHostArgs(active_base_addr, nullptr, 0), SUCCESS); | 1529 | EXPECT_NE(kernel_task_info.UpdateHostArgs(active_base_addr, nullptr, 0), SUCCESS); |
| 1529 | } | 1530 | } |
| 1530 | 1531 | ||
| @@ -4300,9 +4301,11 @@ TEST_F(UtestKernelTaskInfo, ifa_with_args_format_graph_load_and_success) { | |||
| 4300 | IowAddrs iow_addrs = {std::move(task_run_param.parsed_input_addrs), std::move(task_run_param.parsed_output_addrs), | 4301 | IowAddrs iow_addrs = {std::move(task_run_param.parsed_input_addrs), std::move(task_run_param.parsed_output_addrs), |
| 4301 | std::move(task_run_param.parsed_workspace_addrs)}; | 4302 | std::move(task_run_param.parsed_workspace_addrs)}; |
| 4302 | 4303 | ||
| 4304 | + ge::DumpStub::GetInstance().SetEnableFlag(false); | ||
| 4303 | EXPECT_EQ(kernel_task_info.Init(ifa_task, &model, args, persistant_workspace, iow_addrs), SUCCESS); | 4305 | EXPECT_EQ(kernel_task_info.Init(ifa_task, &model, args, persistant_workspace, iow_addrs), SUCCESS); |
| 4304 | 4306 | ||
| 4305 | EXPECT_EQ(kernel_task_info.Distribute(), SUCCESS); | 4307 | EXPECT_EQ(kernel_task_info.Distribute(), SUCCESS); |
| 4308 | + ge::DumpStub::GetInstance().SetEnableFlag(true); | ||
| 4306 | 4309 | ||
| 4307 | auto cust_to_relevant = kernel_task_info.cust_to_relevant_offset_; | 4310 | auto cust_to_relevant = kernel_task_info.cust_to_relevant_offset_; |
| 4308 | std::map<uint64_t, uint64_t> golden = {{0, 0}, {1, 19}, {2, 20}, {3, 26}, {4, 27}, {5, 3}, {6, 31}, {7, 37}, {8, 38}}; | 4311 | std::map<uint64_t, uint64_t> golden = {{0, 0}, {1, 19}, {2, 20}, {3, 26}, {4, 27}, {5, 3}, {6, 31}, {7, 37}, {8, 38}}; |
| @@ -5400,9 +5403,11 @@ TEST_F(UtestKernelTaskInfo, ifa_with_tiling_sink_graph_load_and_success_with_dfx | |||
| 5400 | IowAddrs iow_addrs = {std::move(task_run_param.parsed_input_addrs), std::move(task_run_param.parsed_output_addrs), | 5403 | IowAddrs iow_addrs = {std::move(task_run_param.parsed_input_addrs), std::move(task_run_param.parsed_output_addrs), |
| 5401 | std::move(task_run_param.parsed_workspace_addrs)}; | 5404 | std::move(task_run_param.parsed_workspace_addrs)}; |
| 5402 | 5405 | ||
| 5406 | + ge::DumpStub::GetInstance().SetEnableFlag(false); | ||
| 5403 | EXPECT_EQ(kernel_task_info.Init(ifa_task, &model, args, persistant_workspace, iow_addrs), SUCCESS); | 5407 | EXPECT_EQ(kernel_task_info.Init(ifa_task, &model, args, persistant_workspace, iow_addrs), SUCCESS); |
| 5404 | 5408 | ||
| 5405 | EXPECT_EQ(kernel_task_info.Distribute(), SUCCESS); | 5409 | EXPECT_EQ(kernel_task_info.Distribute(), SUCCESS); |
| 5410 | + ge::DumpStub::GetInstance().SetEnableFlag(true); | ||
| 5406 | 5411 | ||
| 5407 | auto cust_to_relevant = kernel_task_info.cust_to_relevant_offset_; | 5412 | auto cust_to_relevant = kernel_task_info.cust_to_relevant_offset_; |
| 5408 | std::map<uint64_t, uint64_t> golden = {{0, 0}, {1, 19}, {2, 20}, {3, 26}, {4, 27}, {5, 3}, {6, 33}, {7, 34}}; | 5413 | std::map<uint64_t, uint64_t> golden = {{0, 0}, {1, 19}, {2, 20}, {3, 26}, {4, 27}, {5, 3}, {6, 33}, {7, 34}}; |
| @@ -108,7 +108,7 @@ TEST_F(UtestAiCoreTaskBuilder, load_atomic_workspace) { | |||
| 108 | EXPECT_EQ(ge_root_model->Initialize(graph), SUCCESS); | 108 | EXPECT_EQ(ge_root_model->Initialize(graph), SUCCESS); |
| 109 | HybridModel hybrid_model(ge_root_model); | 109 | HybridModel hybrid_model(ge_root_model); |
| 110 | std::vector<domi::TaskDef> task_defs; | 110 | std::vector<domi::TaskDef> task_defs; |
| 111 | - std::unique_ptr<AiCoreNodeTask> aicore_task; | 111 | + std::unique_ptr<AiCoreNodeTask> aicore_task = std::make_unique<AiCoreNodeTask>(); |
| 112 | AiCoreTaskBuilder builder(node, task_defs, hybrid_model, *aicore_task); | 112 | AiCoreTaskBuilder builder(node, task_defs, hybrid_model, *aicore_task); |
| 113 | 113 | ||
| 114 | GeAttrValue::NAMED_ATTRS workspaces; | 114 | GeAttrValue::NAMED_ATTRS workspaces; |
| @@ -2746,7 +2746,7 @@ TEST_F(ExecutorDumperUT, InitOrderHoldersFromExeGraph_UT) { | |||
| 2746 | 2746 | ||
| 2747 | dumper->kernel_names_to_exe_nodes_.emplace("Test_1025", &node); | 2747 | dumper->kernel_names_to_exe_nodes_.emplace("Test_1025", &node); |
| 2748 | dumper->kernel_idxes_to_dump_units_.clear(); | 2748 | dumper->kernel_idxes_to_dump_units_.clear(); |
| 2749 | - dumper->kernel_idxes_to_dump_units_.resize(2); | 2749 | + dumper->kernel_idxes_to_dump_units_.resize(3); |
| 2750 | dumper->InitOrderHoldersFromExeGraph("Test_1025", &dump_unit); | 2750 | dumper->InitOrderHoldersFromExeGraph("Test_1025", &dump_unit); |
| 2751 | EXPECT_EQ(dumper->kernel_idxes_to_dump_units_[0].size(), 1); | 2751 | EXPECT_EQ(dumper->kernel_idxes_to_dump_units_[0].size(), 1); |
| 2752 | EXPECT_EQ(dumper->kernel_idxes_to_dump_units_[0][0], &dump_unit); | 2752 | EXPECT_EQ(dumper->kernel_idxes_to_dump_units_[0][0], &dump_unit); |