| @@ -592,7 +592,7 @@ Status GeGenerator::SetModelNameForDump(const GeRootModelPtr &ge_root_model) { | |||
| ErrorManager::GetInstance().ATCReportErrMessage("E10000", {"parameter"}, {"output"}); | |||
| GELOGE(FAILED, "[Check][GetModelNameStep]Get model_name failed. Param --output is invalid, root graph name: %s", | |||
| ge_root_model->GetRootGraph()->GetName().c_str()); | |||
| REPORT_CALL_ERROR("E19999", "Get model_name failed. Param --output is invalid,", | |||
| REPORT_CALL_ERROR("E19999", "Get model_name failed. Param --output is invalid," | |||
| "root graph name: %s", ge_root_model->GetRootGraph()->GetName().c_str()); | |||
| return PARAM_INVALID; | |||
| } | |||
| @@ -70,7 +70,7 @@ Status AssignByLabelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr> & | |||
| auto iter = label_streams.find(stream_label); | |||
| if (iter == label_streams.end()) { | |||
| subgraph->stream_id = next_stream; | |||
| GELOGI("Assign new stream %ld for label %s.", next_stream, stream_label.c_str()); | |||
| GELOGI("[Assign][NewStreamId] %ld for label %s.", next_stream, stream_label.c_str()); | |||
| label_streams.emplace(stream_label, next_stream); | |||
| next_stream++; | |||
| @@ -102,7 +102,7 @@ Status IndependentStreamPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt | |||
| auto iter = label_streams.find(stream_label); | |||
| if (iter == label_streams.end()) { | |||
| subgraph->stream_id = next_stream; | |||
| GELOGI("Assign new independent stream %ld for engine %s (label: %s).", next_stream, engine.c_str(), | |||
| GELOGI("[Assign][NewStreamId:independent] %ld for engine %s (label: %s).", next_stream, engine.c_str(), | |||
| stream_label.c_str()); | |||
| label_streams.emplace(stream_label, next_stream); | |||
| @@ -137,8 +137,8 @@ Status AssignByDependencyPass::Run(ComputeGraphPtr graph, const vector<SubgraphP | |||
| } else { | |||
| int64_t stream_id = AssignNewStream(reusable_subgraph); | |||
| subgraph->stream_id = stream_id; | |||
| GELOGI("Reusable subgraph %s has not been assigned a stream, now assign new stream %ld.", | |||
| reusable_subgraph->name.c_str(), stream_id); | |||
| GELOGI("[Assign][NewStreamId] %ld for Reusable subgraph %s cause has not been assigned before.", | |||
| stream_id, reusable_subgraph->name.c_str()); | |||
| } | |||
| if (reusable_subgraph->reused_subgraph != nullptr) { | |||
| @@ -147,7 +147,8 @@ Status AssignByDependencyPass::Run(ComputeGraphPtr graph, const vector<SubgraphP | |||
| subgraph->reused_subgraph = reusable_subgraph; | |||
| reused_subgraphs_.emplace_back(subgraph, reusable_subgraph); | |||
| GELOGI("Subgraph %s of engine %s reuses stream of subgraph %s of engine %s.", subgraph->name.c_str(), | |||
| GELOGI("[Reuse][Stream]Subgraph %s of engine %s reuses stream of subgraph %s of engine %s.", | |||
| subgraph->name.c_str(), | |||
| subgraph->engine_conf.id.c_str(), reusable_subgraph->name.c_str(), | |||
| reusable_subgraph->engine_conf.id.c_str()); | |||
| } | |||
| @@ -259,7 +260,7 @@ int64_t AssignByDependencyPass::AssignNewStream(SubgraphPtr subgraph) { | |||
| engine_stream_num_[engine_name] = stream_id + 1; | |||
| } | |||
| GELOGI("Subgraph %s assigns new temp stream %ld (engine: %s).", subgraph->name.c_str(), stream_id, | |||
| GELOGI("[Assign][NewStreamId:temp]id:%ld for Subgraph %s (engine: %s).", stream_id, subgraph->name.c_str(), | |||
| engine_name.c_str()); | |||
| return stream_id; | |||
| @@ -292,7 +293,7 @@ void AssignByDependencyPass::UpdateAssignedSubgraphs(Context &context) { | |||
| GELOGI("Subgraph %s of engine %s reuses default stream %ld.", subgraph->name.c_str(), | |||
| subgraph->engine_conf.id.c_str(), context.default_stream); | |||
| } else { | |||
| GELOGI("Stream of subgraph %s has been updated to %ld.", subgraph->name.c_str(), subgraph->stream_id); | |||
| GELOGI("[Update][StreamId]id:%ld for subgraph %s.", subgraph->stream_id, subgraph->name.c_str()); | |||
| } | |||
| } | |||
| } | |||
| @@ -303,7 +304,7 @@ void AssignByDependencyPass::UpdateReusedSubgraphs() { | |||
| auto &cur_subgraph = item.first; | |||
| auto &reused_graph = item.second; | |||
| cur_subgraph->stream_id = reused_graph->stream_id; | |||
| GELOGI("Stream of subgraph %s has been updated to %ld.", cur_subgraph->name.c_str(), cur_subgraph->stream_id); | |||
| GELOGI("[Update][StreamId]id:%ld for subgraph %s.", cur_subgraph->stream_id, cur_subgraph->name.c_str()); | |||
| } | |||
| } | |||
| @@ -340,7 +341,7 @@ Status NodeStreamUpdatePass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr | |||
| engine_name.c_str()); | |||
| return INTERNAL_ERROR; | |||
| } else { | |||
| GELOGI("Subgraph %s is assigned stream %ld (engine: %s).", subgraph->name.c_str(), subgraph->stream_id, | |||
| GELOGI("[Assign][StreamId] %ld for Subgraph %s (engine: %s).", subgraph->stream_id, subgraph->name.c_str(), | |||
| engine_name.c_str()); | |||
| } | |||
| } | |||
| @@ -363,12 +364,12 @@ Status NodeStreamUpdatePass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr | |||
| GELOGD("Node %s of type %s in subgraph %s is assigned parent stream %ld (engine: %s).", node->GetName().c_str(), | |||
| node->GetType().c_str(), subgraph->name.c_str(), context.default_stream, engine_name.c_str()); | |||
| } else if (IsEngineSkip(*subgraph) && node->GetInNodes().empty()) { | |||
| GELOGD("Node %s of type %s in subgraph %s doesn't need to assign a stream (engine: %s).", | |||
| GELOGD("[Skip][StreamIdAssign]Node %s of type %s in subgraph %s doesn't need (engine: %s).", | |||
| node->GetName().c_str(), node->GetType().c_str(), subgraph->name.c_str(), engine_name.c_str()); | |||
| } else { | |||
| node->GetOpDesc()->SetStreamId(stream_id); | |||
| GELOGD("Node %s of type %s in subgraph %s is assigned stream %ld (engine: %s).", node->GetName().c_str(), | |||
| node->GetType().c_str(), subgraph->name.c_str(), stream_id, engine_name.c_str()); | |||
| GELOGD("[Assign][StreamId]id:%ld for Node %s of type %s in subgraph %s (engine: %s).", stream_id, | |||
| node->GetName().c_str(), node->GetType().c_str(), subgraph->name.c_str(), engine_name.c_str()); | |||
| } | |||
| } | |||
| } | |||
| @@ -397,8 +398,8 @@ int64_t UpdateForSkippedEnginePass::GetSingleInoutStream(const NodePtr &node) co | |||
| if (stream_ids.size() == 1) { | |||
| int64_t stream_id = *(stream_ids.begin()); | |||
| GELOGI("The stream of all input and output nodes of node %s (type: %s) is %ld.", node->GetName().c_str(), | |||
| node->GetType().c_str(), stream_id); | |||
| GELOGI("[Get][SingleStreamId]The stream of all input and output nodes of node %s (type: %s) is %ld.", | |||
| node->GetName().c_str(), node->GetType().c_str(), stream_id); | |||
| return stream_id; | |||
| } | |||
| @@ -437,8 +438,8 @@ Status UpdateForSkippedEnginePass::Run(ComputeGraphPtr graph, const vector<Subgr | |||
| int64_t inout_stream = GetSingleInoutStream(node); | |||
| if (inout_stream != kInvalidStream) { | |||
| op_desc->SetStreamId(inout_stream); | |||
| GELOGI("Node %s of type %s reassign to stream %ld from stream %ld.", node->GetName().c_str(), | |||
| node->GetType().c_str(), inout_stream, stream_id); | |||
| GELOGI("[Reassign][StreamId]%ld for Node %s of type %s from stream %ld.", | |||
| inout_stream, node->GetName().c_str(), node->GetType().c_str(), stream_id); | |||
| } | |||
| } | |||
| } | |||
| @@ -465,7 +466,7 @@ Status AllReduceParallelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt | |||
| return NOT_CHANGED; | |||
| } | |||
| GELOGI("AllReduceParallelPass is enabled."); | |||
| GELOGI("[Run][AllReduceParallelPass] start"); | |||
| GE_DUMP(graph, "BeforeAllReduceParallel"); | |||
| // All successors of HcomAllReduce. | |||
| @@ -575,7 +576,7 @@ Status LogicalStreamAllocator::Assign(const ComputeGraphPtr &root_graph, const G | |||
| RefreshContinuousStreams(root_graph); | |||
| stream_num = context_.next_stream; | |||
| GELOGI("Assigned logical stream num: %ld.", stream_num); | |||
| GELOGI("[Assign][LogicalStream] At last, stream num: %ld.", stream_num); | |||
| return SUCCESS; | |||
| } | |||
| @@ -607,7 +608,7 @@ Status LogicalStreamAllocator::DoAssign(const ComputeGraphPtr &graph, const Grap | |||
| return status; | |||
| } | |||
| GELOGD("Subgraphs of graph %s", graph->GetName().c_str()); | |||
| GELOGD("[Show][Subgraphs] in graph %s", graph->GetName().c_str()); | |||
| for (const auto &subgraph : subgraphs) { | |||
| if (subgraph != nullptr) { | |||
| GELOGD("subgraph: %s", subgraph->name.c_str()); | |||
| @@ -674,9 +675,9 @@ Status LogicalStreamAllocator::RunPasses(const ComputeGraphPtr &graph, const vec | |||
| Status status = pass->Run(graph, subgraphs, context_); | |||
| if (status == SUCCESS) { | |||
| GELOGD("Stream pass %s return SUCCESS.", pass->GetName().c_str()); | |||
| GELOGD("[Show][Status]Stream pass %s return SUCCESS.", pass->GetName().c_str()); | |||
| } else if (status == NOT_CHANGED) { | |||
| GELOGD("Stream pass %s return NOT_CHANGED.", pass->GetName().c_str()); | |||
| GELOGD("[Show][Status]Stream pass %s return NOT_CHANGED.", pass->GetName().c_str()); | |||
| } else { | |||
| GELOGE(status, "Stream pass %s failed.", pass->GetName().c_str()); | |||
| return status; | |||
| @@ -508,7 +508,7 @@ BlockMemAssigner::BlockMemAssigner(ComputeGraphPtr compute_graph, const map<stri | |||
| symbol_to_anchors_(symbol_to_anchors), anchor_to_symbol_(anchor_to_symbol), life_time_(0) {} | |||
| BlockMemAssigner::~BlockMemAssigner() { | |||
| GELOGD("blocks_store_ size : %lu", blocks_store_.size()); | |||
| GELOGD("[Destruct][BlockMemAssigner]blocks_store_ size : %lu", blocks_store_.size()); | |||
| for (MemoryBlock *memory_block : blocks_store_) { | |||
| GE_DELETE_NEW_SINGLE(memory_block); | |||
| } | |||
| @@ -597,11 +597,13 @@ void BlockMemAssigner::GetOutAndWorkSpaceMem(vector<int64_t> &all_memory_size) { | |||
| int64_t size = 0; | |||
| GE_IF_BOOL_EXEC(ge::TensorUtils::GetSize(output_desc, size) != SUCCESS, GELOGI("Get size failed")); | |||
| GE_IF_BOOL_EXEC(size < 0, | |||
| GELOGE(FAILED, "[Check][TensorSize]tensor_size:%ld is invalid, maybe it is unknown shape node, Node_name:%s", | |||
| size, node_op_desc->GetName().c_str()); | |||
| REPORT_INNER_ERROR("E19999", "tensor_size:%ld is invalid, maybe it is unknown shape node, Node_name:%s", | |||
| size, node_op_desc->GetName().c_str()); | |||
| return;); | |||
| GELOGE(FAILED, "[Check][TensorSize]tensor_size:%ld is invalid, " | |||
| "maybe it is unknown shape node, Node_name:%s", | |||
| size, node_op_desc->GetName().c_str()); | |||
| REPORT_INNER_ERROR("E19999", "tensor_size:%ld is invalid, " | |||
| "maybe it is unknown shape node, Node_name:%s", | |||
| size, node_op_desc->GetName().c_str()); | |||
| return;); | |||
| batch_all_memory_size[batch_label].emplace_back(size); | |||
| if (batch_total_size.find(batch_label) == batch_total_size.end()) { | |||
| batch_total_size[batch_label] = size; | |||
| @@ -1105,9 +1107,10 @@ MemoryBlock *BlockMemAssigner::ApplyMemory(size_t block_size, size_t real_size, | |||
| OpMemoryType mem_type, const NodePtr &n, uint32_t out_index, | |||
| const vector<bool> &workspace_reuse_flag, const bool is_op_reuse_mem, | |||
| const bool continuous, int64_t memory_type) { | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(n == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:node_ptr) is null, apply memory failed"); | |||
| return nullptr, "[Check][Param]Input parameter n(type:node_ptr) is null."); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| n == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:node_ptr) is null, apply memory failed"); | |||
| return nullptr, "[Check][Param]Input parameter n(type:node_ptr) is null."); | |||
| auto node_op_desc = n->GetOpDesc(); | |||
| GE_IF_BOOL_EXEC(node_op_desc == nullptr, return nullptr); | |||
| std::string batch_label; | |||
| @@ -1159,10 +1162,12 @@ MemoryBlock *BlockMemAssigner::ApplyMemory(size_t block_size, size_t real_size, | |||
| } | |||
| auto block = new (std::nothrow) MemoryBlock(block_size, node_op_desc->GetStreamId(), is_reuse_memory, memory_type); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(block == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "new a memoryblock object failed. node_name:%s out_index:%u", | |||
| n->GetName().c_str(), out_index); | |||
| return nullptr, "[New][Object]new MemoryBlock failed, node_name:%s out_index:%u", n->GetName().c_str(), out_index); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| block == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "new a memoryblock object failed. node_name:%s out_index:%u", | |||
| n->GetName().c_str(), out_index); | |||
| return nullptr, | |||
| "[New][Object]new MemoryBlock failed, node_name:%s out_index:%u", n->GetName().c_str(), out_index); | |||
| // Data and netoutput need zero copy block | |||
| block->is_zero_copy_ = IsZeroCopyBlock(n, continuous); | |||
| @@ -1221,13 +1226,15 @@ void BlockMemAssigner::ContinuousOutRefCheck(bool &isAllOutputRef, bool &isOutpu | |||
| Status BlockMemAssigner::ApplyContinuousMemory(const NodePtr &n, const vector<int64_t> &ranges, | |||
| const bool is_op_reuse_mem) { | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(n == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:node_ptr) is null"); | |||
| return INTERNAL_ERROR, "[check][param]Input parameter n(type:NodePtr) is null."); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| n == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:node_ptr) is null"); | |||
| return INTERNAL_ERROR, "[check][param]Input parameter n(type:NodePtr) is null."); | |||
| auto node_op_desc = n->GetOpDesc(); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(node_op_desc == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:OpDescPtr) is null"); | |||
| return INTERNAL_ERROR, "[Check][Param]Input parameter n(type:OpDescPtr) is null"); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| node_op_desc == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:OpDescPtr) is null"); | |||
| return INTERNAL_ERROR, "[Check][Param]Input parameter n(type:OpDescPtr) is null"); | |||
| // continuous output support ref only when all output ref input | |||
| bool isAllOutputRef = true; | |||
| @@ -1319,26 +1326,33 @@ Status BlockMemAssigner::ApplyContinuousMemory(const NodePtr &n, const vector<in | |||
| MemoryBlock *BlockMemAssigner::ApplyOutMemory(const NodePtr &n, uint32_t index, const vector<int64_t> &ranges, | |||
| const bool is_op_reuse_mem, const bool continuous) { | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(n == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:NodePtr) is null"); | |||
| return nullptr, "[Check][Param]Input parameter n(type:NodePtr) is null"); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| n == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:NodePtr) is null"); | |||
| return nullptr, "[Check][Param]Input parameter n(type:NodePtr) is null"); | |||
| auto node_op_desc = n->GetOpDesc(); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(node_op_desc == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:OpDescPtr) is null"); | |||
| return nullptr, "[Check][Param]Input parameter n(type:OpDescPtr) is null"); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| node_op_desc == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "Input parameter n(type:OpDescPtr) is null"); | |||
| return nullptr, "[Check][Param]Input parameter n(type:OpDescPtr) is null"); | |||
| MemoryBlock *block = nullptr; | |||
| NodeIndexIO node_index_io(n, index, kOut); | |||
| int64_t size = 0; | |||
| auto output_op_desc = node_op_desc->GetOutputDescPtr(index); | |||
| GE_IF_BOOL_EXEC(output_op_desc == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "get output_desc failed, node_name:%s, output_index:%u", n->GetName().c_str(), index); | |||
| GELOGE(FAILED, "[Get][OutputDesc]node_name:%s, output_index:%u", n->GetName().c_str(), index); | |||
| return nullptr); | |||
| GE_IF_BOOL_EXEC( | |||
| output_op_desc == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "get output_desc failed, node_name:%s, output_index:%u", | |||
| n->GetName().c_str(), index); | |||
| GELOGE(FAILED, "[Get][OutputDesc]node_name:%s, output_index:%u", n->GetName().c_str(), index); | |||
| return nullptr); | |||
| GE_IF_BOOL_EXEC(ge::TensorUtils::GetSize(*output_op_desc, size) != SUCCESS, GELOGI("Get size failed")); | |||
| size_t no_align_size = 0; | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(GetNoAlignSize(*node_op_desc, index, no_align_size) != SUCCESS, | |||
| REPORT_CALL_ERROR("E19999", "Get no align size failed, node_name:%s, output_index:%u", n->GetName().c_str(), index); | |||
| return nullptr, "[Get][TensorSize]Get no align size, node_name:%s, output_index:%u", n->GetName().c_str(), index); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| GetNoAlignSize(*node_op_desc, index, no_align_size) != SUCCESS, | |||
| REPORT_CALL_ERROR("E19999", "Get no align size failed, node_name:%s, output_index:%u", | |||
| n->GetName().c_str(), index); | |||
| return nullptr, | |||
| "[Get][TensorSize]Get no align size, node_name:%s, output_index:%u", n->GetName().c_str(), index); | |||
| std::string symbol; | |||
| bool reuse_input = false; | |||
| @@ -1392,24 +1406,28 @@ MemoryBlock *BlockMemAssigner::ApplyOutMemory(const NodePtr &n, uint32_t index, | |||
| vector<bool> workspace_reuse_flag; | |||
| block = ApplyMemory(block_size, size, no_align_size, kOutput, n, index, | |||
| workspace_reuse_flag, is_op_reuse_mem, continuous, memory_type); | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(block == nullptr, | |||
| REPORT_CALL_ERROR("E19999", "apply out Memory failed, node_name:%s, block_size:%ld, out_index:%u", | |||
| n->GetName().c_str(), block_size, index); | |||
| return nullptr, "[Apply][Memory]node_name:%s, block_size:%ld, out_index:%u", | |||
| GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
| block == nullptr, | |||
| REPORT_CALL_ERROR("E19999", "apply out Memory failed, node_name:%s, block_size:%ld, out_index:%u", | |||
| n->GetName().c_str(), block_size, index); | |||
| return nullptr, | |||
| "[Apply][Memory]node_name:%s, block_size:%ld, out_index:%u", | |||
| n->GetName().c_str(), block_size, index); | |||
| } | |||
| int out_count = 0; | |||
| GE_IF_BOOL_EXEC(index >= n->GetAllOutDataAnchors().size(), | |||
| REPORT_INNER_ERROR("E19999", "out index:%u exceed out_size:%lu, node_name:%s", | |||
| index, n->GetAllOutDataAnchors().size(), n->GetName().c_str()); | |||
| GELOGE(FAILED, "[Check][OutIndex]index:%u exceed out_size:%lu, node_name:%s", | |||
| index, n->GetAllOutDataAnchors().size(), n->GetName().c_str()); | |||
| return nullptr); | |||
| GE_IF_BOOL_EXEC( | |||
| index >= n->GetAllOutDataAnchors().size(), | |||
| REPORT_INNER_ERROR("E19999", "out index:%u exceed out_size:%lu, node_name:%s", | |||
| index, n->GetAllOutDataAnchors().size(), n->GetName().c_str()); | |||
| GELOGE(FAILED, "[Check][OutIndex]index:%u exceed out_size:%lu, node_name:%s", | |||
| index, n->GetAllOutDataAnchors().size(), n->GetName().c_str()); | |||
| return nullptr); | |||
| auto out_data_anchor = n->GetOutDataAnchor(index); | |||
| GE_IF_BOOL_EXEC(out_data_anchor == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "out anchor is null, index:%u, node_name:%s", index, n->GetName().c_str()); | |||
| GELOGE(FAILED, "[Check][OutAnchor]is null, index:%u, node_name:%s", index, n->GetName().c_str()); | |||
| return nullptr); | |||
| GE_IF_BOOL_EXEC( | |||
| out_data_anchor == nullptr, | |||
| REPORT_INNER_ERROR("E19999", "out anchor is null, index:%u, node_name:%s", index, n->GetName().c_str()); | |||
| GELOGE(FAILED, "[Check][OutAnchor]is null, index:%u, node_name:%s", index, n->GetName().c_str()); | |||
| return nullptr); | |||
| for (const auto &in_anchor : out_data_anchor->GetPeerInDataAnchors()) { | |||
| auto owner_node = in_anchor->GetOwnerNode(); | |||
| auto op_desc = owner_node->GetOpDesc(); | |||
| @@ -1618,10 +1636,11 @@ Status BlockMemAssigner::AssignOutputMemoryWithReuse(const NodePtr &node, vector | |||
| REPORT_INNER_ERROR("E19999", "Attr[%s] size:%zu not equal to node output size:%zu, node_name:%s", | |||
| ATTR_NAME_OUTPUT_MEM_TYPE_LIST.c_str(), memorys_type.size(), | |||
| op_desc->GetOutputsSize(), op_desc->GetName().c_str()); | |||
| GELOGE(INTERNAL_ERROR, | |||
| "[Check][MemTypeAttr]Attr %s size:%zu not equal to node output size:%zu, node_name:%s", | |||
| ATTR_NAME_OUTPUT_MEM_TYPE_LIST.c_str(), memorys_type.size(), | |||
| op_desc->GetOutputsSize(), op_desc->GetName().c_str()); | |||
| GELOGE( | |||
| INTERNAL_ERROR, | |||
| "[Check][MemTypeAttr]Attr %s size:%zu not equal to node output size:%zu, node_name:%s", | |||
| ATTR_NAME_OUTPUT_MEM_TYPE_LIST.c_str(), memorys_type.size(), | |||
| op_desc->GetOutputsSize(), op_desc->GetName().c_str()); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| @@ -1751,7 +1770,8 @@ void BlockMemAssigner::AssignMemoryWithReuse(vector<int64_t> &ranges) { | |||
| TVM_ATTR_NAME_WORKSPACE_TYPE.c_str(), tvm_workspace_memory_type.size(), | |||
| temp.size(), n->GetName().c_str()); | |||
| GELOGE(INTERNAL_ERROR, "[Check][Attr]Attr %s size:%zu is not equal to workspace size:%zu, node_name:%s", | |||
| TVM_ATTR_NAME_WORKSPACE_TYPE.c_str(), tvm_workspace_memory_type.size(), temp.size(), n->GetName().c_str()); | |||
| TVM_ATTR_NAME_WORKSPACE_TYPE.c_str(), tvm_workspace_memory_type.size(), | |||
| temp.size(), n->GetName().c_str()); | |||
| return; | |||
| } | |||
| for (size_t i = 0; i < temp.size(); i++) { | |||
| @@ -2136,7 +2156,7 @@ void BlockMemAssigner::SetOpMemOffset(bool is_zero_copy) { | |||
| Status BlockMemAssigner::Assign() { | |||
| vector<int64_t> ranges; | |||
| if (GetMemoryRanges(ranges) != SUCCESS) { | |||
| GELOGE(FAILED, "GetMemoryRanges Fail!"); | |||
| GELOGE(FAILED, "[Get][MemoryRanges] Fail!"); | |||
| return FAILED; | |||
| } | |||
| GE_IF_BOOL_EXEC(ranges.empty(), return SUCCESS); | |||
| @@ -337,7 +337,7 @@ uint32_t GetContinuousMemoryType(const OpDescPtr &op_desc) { | |||
| } | |||
| if (continuous_type != 0) { | |||
| GELOGI("Current node %s continuous type %d", op_desc->GetName().c_str(), continuous_type); | |||
| GELOGI("[Get][MemType:Continuous]Current node %s, value is %d", op_desc->GetName().c_str(), continuous_type); | |||
| } | |||
| return continuous_type; | |||
| } | |||
| @@ -482,7 +482,7 @@ Status GraphMemoryAssigner::ReAssignContinuousMemory(bool is_loop_graph) { | |||
| "[Assign][Memory:Continuous:Input]fail for node:%s.", node->GetName().c_str()) | |||
| } | |||
| for (auto pair : memory_offset_) { | |||
| GELOGD("After reassign continuous memory, memory type = %ld, mem offset = %zu.", pair.first, | |||
| GELOGD("[Reassign][Memory:Continuous]At last, memory type = %ld, mem offset = %zu.", pair.first, | |||
| pair.second.mem_offset_); | |||
| } | |||
| return ge::SUCCESS; | |||
| @@ -490,7 +490,7 @@ Status GraphMemoryAssigner::ReAssignContinuousMemory(bool is_loop_graph) { | |||
| Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, int64_t &continuous_mem_start, | |||
| int64_t &continuous_mem_size, int64_t memory_type, uint32_t continuous_type, bool reverse_refresh) { | |||
| GELOGI("Current node %s needs continuous input", node->GetName().c_str()); | |||
| GELOGI("[Assign][Memory:Input:Continuous]start for Current node %s", node->GetName().c_str()); | |||
| auto iter = memory_offset_.find(memory_type); | |||
| if (iter == memory_offset_.end()) { | |||
| REPORT_INNER_ERROR("E19999", "find memory offset fail for mem_type:%ld, " | |||
| @@ -566,9 +566,9 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, | |||
| auto peer_output_offset = output_list.at(peer_out_data_anchor->GetIdx()); | |||
| output_list.at(peer_out_data_anchor->GetIdx()) = output_list_this.at(out2ins.begin()->first); | |||
| peer_op_desc->SetOutputOffset(output_list); | |||
| GELOGI("Node %s out %d ref in %d input node %s, use output offset %ld update %ld", node->GetName().c_str(), | |||
| out2ins.begin()->first, out2ins.begin()->second, peer_op_desc->GetName().c_str(), | |||
| output_list_this.at(out2ins.begin()->first), peer_output_offset); | |||
| GELOGI("[Update][Offset]Node %s out %d ref in %d input node %s, use output offset %ld update %ld", | |||
| node->GetName().c_str(), out2ins.begin()->first, out2ins.begin()->second, | |||
| peer_op_desc->GetName().c_str(), output_list_this.at(out2ins.begin()->first), peer_output_offset); | |||
| } else { | |||
| GELOGD("Node %s out %d ref in %d input node %s with total ref numbers %zu.", node->GetName().c_str(), | |||
| out2ins.begin()->first, out2ins.begin()->second, peer_op_desc->GetName().c_str(), out2ins.size()); | |||
| @@ -1671,7 +1671,7 @@ bool GraphMemoryAssigner::AssignContinuousInputMemoryWithAtomicProcessDirectly( | |||
| auto continuous_type = iter->second; | |||
| bool continuous_input = ((continuous_type & kTypeInput) != 0) || ((continuous_type & kTypeInputNoPadding) != 0); | |||
| if (continuous_input) { | |||
| GELOGI("Node %s 's precursor node %s need assign continuous input memory, store node firstly", | |||
| GELOGI("[Store][Node] of %s cause it's precursor node %s need assign continuous input memory", | |||
| input_continuous_node->GetName().c_str(), in_node->GetName().c_str()); | |||
| return false; | |||
| } | |||
| @@ -1681,7 +1681,7 @@ bool GraphMemoryAssigner::AssignContinuousInputMemoryWithAtomicProcessDirectly( | |||
| node_2_continuous_type.emplace(out_node, continuous_type); | |||
| bool continuous_input = ((continuous_type & kTypeInput) != 0) || ((continuous_type & kTypeInputNoPadding) != 0); | |||
| if (continuous_input) { | |||
| GELOGI("Node %s 's succeed node %s need assign continuous input memory, store node firstly", | |||
| GELOGI("[Store][Node] of %s cause it's succeed node %s need assign continuous input memory", | |||
| input_continuous_node->GetName().c_str(), out_node->GetName().c_str()); | |||
| return false; | |||
| } | |||
| @@ -428,7 +428,8 @@ Status AippOp::ConvertRelatedInputNameToRank() { | |||
| if (!convert_flag) { | |||
| string error_msg = "Top name " + related_input_name + "convert rank failed, Please" | |||
| " ensure top name in aipp config is the top name of data node."; | |||
| GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error_msg.c_str()); | |||
| GELOGE(PARAM_INVALID, "[Check][InputParam]%s", error_msg.c_str()); | |||
| REPORT_INPUT_ERROR("E19021", std::vector<std::string>({"reason"}), std::vector<std::string>({error_msg})); | |||
| return PARAM_INVALID; | |||
| } | |||
| @@ -124,13 +124,15 @@ Status InsertNewOpUtil::CheckInputNamePositionNotRepeat() { | |||
| if (another_item->related_input_name().empty()) { | |||
| string error_msg = "Can not both set related_input_name and related_input_rank!" | |||
| " Please ensure param is the same with the first aipp config(related_input_name)."; | |||
| GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error_msg.c_str()); | |||
| GELOGE(PARAM_INVALID, "[Check][InputParam]%s", error_msg.c_str()); | |||
| REPORT_INPUT_ERROR("E19021", std::vector<std::string>({"reason"}), std::vector<std::string>({error_msg})); | |||
| return PARAM_INVALID; | |||
| } | |||
| if (item->related_input_name() == another_item->related_input_name()) { | |||
| string error_msg = "Can not insert aipp to the same postion! Please ensure related_input_name" | |||
| " param is different in different aipp config."; | |||
| GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error_msg.c_str()); | |||
| GELOGE(PARAM_INVALID, "[Check][InputParam]%s", error_msg.c_str()); | |||
| REPORT_INPUT_ERROR("E19021", std::vector<std::string>({"reason"}), std::vector<std::string>({error_msg})); | |||
| return PARAM_INVALID; | |||
| } | |||
| } | |||
| @@ -150,13 +152,15 @@ Status InsertNewOpUtil::CheckInputRankPositionNoRepeat() { | |||
| if (!another_item->related_input_name().empty()) { | |||
| string error_msg = "Can not both set related_input_rank and related_input_name!" | |||
| " Please ensure param is the same with the first aipp config(related_input_rank)."; | |||
| GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error_msg.c_str()); | |||
| GELOGE(PARAM_INVALID, "[Check][InputParam]%s", error_msg.c_str()); | |||
| REPORT_INPUT_ERROR("E19021", std::vector<std::string>({"reason"}), std::vector<std::string>({error_msg})); | |||
| return PARAM_INVALID; | |||
| } | |||
| if (item->related_input_rank() == another_item->related_input_rank()) { | |||
| string error_msg = "Can not insert aipp to the same postion! Please ensure related_input_rank" | |||
| " param is different in different aipp config."; | |||
| GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error_msg.c_str()); | |||
| GELOGE(PARAM_INVALID, "[Check][InputParam]%s", error_msg.c_str()); | |||
| REPORT_INPUT_ERROR("E19021", std::vector<std::string>({"reason"}), std::vector<std::string>({error_msg})); | |||
| return PARAM_INVALID; | |||
| } | |||
| } | |||
| @@ -212,7 +216,7 @@ Status InsertNewOpUtil::CheckGraph(const ComputeGraphPtr &graph) { | |||
| } | |||
| } | |||
| } | |||
| GE_CHK_LOG_AND_ERRORMSG((aippNodes.size() == 0) || (aippNodes.size() == next_nodes_cnt), | |||
| GE_CHK_LOG_AND_ERRORMSG((aippNodes.size() == 0) || (aippNodes.size() == next_nodes_cnt), | |||
| PARAM_INVALID, | |||
| "Can not config part of outputs of Data node to support AIPP, config all " | |||
| "of the outputs of Data to support AIPP, or config none of them"); | |||
| @@ -41,6 +41,7 @@ target_link_options(engine PRIVATE | |||
| target_link_libraries(engine PRIVATE | |||
| $<BUILD_INTERFACE:intf_pub> | |||
| -Wl,--no-as-needed | |||
| c_sec | |||
| slog | |||
| -Wl,--as-needed | |||
| -lrt | |||
| @@ -9136,23 +9136,23 @@ TEST_F(UtestFormatTransferNdFractNz, invalid_src_data_type2) { | |||
| EXPECT_EQ(transfer.TransFormat(args, result), ACL_ERROR_GE_DATATYPE_INVALID); | |||
| } | |||
| // TEST_F(UtestFormatTransferNdFractNz, invalid_src_data_type3) { | |||
| // uint16_t data[1 * 1 * 1 * 16 * 16] = {0}; | |||
| // TransArgs args{reinterpret_cast<uint8_t *>(data), | |||
| // FORMAT_FRACTAL_NZ, | |||
| // FORMAT_NHWC, | |||
| // {1, 1, 1, 16, 16}, | |||
| // { | |||
| // 1, | |||
| // 1, | |||
| // 4, | |||
| // 4, | |||
| // }, | |||
| // DT_VARIANT}; | |||
| // TransResult result; | |||
| // FormatTransferFractalNzND transfer; | |||
| // EXPECT_EQ(transfer.TransFormat(args, result), ACL_ERROR_GE_DATATYPE_INVALID); | |||
| // } | |||
| TEST_F(UtestFormatTransferNdFractNz, invalid_src_data_type3) { | |||
| uint16_t data[1 * 1 * 1 * 16 * 16] = {0}; | |||
| TransArgs args{reinterpret_cast<uint8_t *>(data), | |||
| FORMAT_FRACTAL_NZ, | |||
| FORMAT_NHWC, | |||
| {1, 1, 1, 16, 16}, | |||
| { | |||
| 1, | |||
| 1, | |||
| 4, | |||
| 4, | |||
| }, | |||
| DT_STRING}; | |||
| TransResult result; | |||
| FormatTransferFractalNzND transfer; | |||
| EXPECT_EQ(transfer.TransFormat(args, result), ACL_ERROR_GE_DATATYPE_INVALID); | |||
| } | |||
| TEST_F(UtestFormatTransferNdFractNz, invalid_dst_format2) { | |||
| uint16_t data[1 * 1 * 1 * 1 * 16 * 16] = {0}; | |||
| @@ -5354,14 +5354,14 @@ TEST_F(UtestFormatTransferNhwcFz, build_transfer_uint8) { | |||
| EXPECT_NE(transfer, nullptr); | |||
| } | |||
| // TEST_F(UtestFormatTransferNhwcFz, invalid_data_type) { | |||
| // uint16_t data[1 * 4 * 4 * 1] = {0}; | |||
| // TransArgs args{ | |||
| // reinterpret_cast<uint8_t *>(data), FORMAT_NHWC, FORMAT_FRACTAL_NZ, {1, 4, 4}, {1, 1, 1, 16, 16}, DT_VARIANT}; | |||
| // FormatTransferFractalZ transfer; | |||
| // EXPECT_EQ(transfer.TransShape(args.src_format, args.src_shape, args.src_data_type, args.dst_format, args.dst_shape), | |||
| // ACL_ERROR_GE_DATATYPE_INVALID); | |||
| // } | |||
| TEST_F(UtestFormatTransferNhwcFz, invalid_data_type) { | |||
| uint16_t data[1 * 4 * 4 * 1] = {0}; | |||
| TransArgs args{ | |||
| reinterpret_cast<uint8_t *>(data), FORMAT_NHWC, FORMAT_FRACTAL_NZ, {1, 4, 4}, {1, 1, 1, 16, 16}, DT_STRING}; | |||
| FormatTransferFractalZ transfer; | |||
| EXPECT_EQ(transfer.TransShape(args.src_format, args.src_shape, args.src_data_type, args.dst_format, args.dst_shape), | |||
| ACL_ERROR_GE_DATATYPE_INVALID); | |||
| } | |||
| TEST_F(UtestFormatTransferNhwcFz, invalid_data_format) { | |||
| uint16_t data[1 * 4 * 4 * 1] = {0}; | |||
| @@ -52,34 +52,34 @@ TEST_F(UtestFormatTransfer, build_unsupported_transfer) { | |||
| EXPECT_EQ(transfer2, nullptr); | |||
| } | |||
| // TEST_F(UtestFormatTransfer, get_size_by_data_type) { | |||
| // EXPECT_EQ(GetSizeByDataType(DT_FLOAT), 4); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_FLOAT16), 2); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_INT8), 1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_INT16), 2); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_UINT16), 2); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_UINT8), 1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_INT32), 4); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_INT64), 8); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_UINT32), 4); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_UINT64), 8); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_BOOL), 1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_DOUBLE), 8); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_STRING), -1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_INT8), 1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_UINT8), 1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_COMPLEX64), 8); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_COMPLEX128), 16); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_QINT8), 1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_QINT16), 2); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_QINT32), 4); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_QUINT8), 1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_QUINT16), 2); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_RESOURCE), -1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_STRING_REF), -1); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_DUAL), 5); | |||
| // EXPECT_EQ(GetSizeByDataType(DT_UNDEFINED), -1); | |||
| // EXPECT_EQ(DT_UNDEFINED, 27); | |||
| // } | |||
| TEST_F(UtestFormatTransfer, get_size_by_data_type) { | |||
| EXPECT_EQ(GetSizeByDataType(DT_FLOAT), 4); | |||
| EXPECT_EQ(GetSizeByDataType(DT_FLOAT16), 2); | |||
| EXPECT_EQ(GetSizeByDataType(DT_INT8), 1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_INT16), 2); | |||
| EXPECT_EQ(GetSizeByDataType(DT_UINT16), 2); | |||
| EXPECT_EQ(GetSizeByDataType(DT_UINT8), 1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_INT32), 4); | |||
| EXPECT_EQ(GetSizeByDataType(DT_INT64), 8); | |||
| EXPECT_EQ(GetSizeByDataType(DT_UINT32), 4); | |||
| EXPECT_EQ(GetSizeByDataType(DT_UINT64), 8); | |||
| EXPECT_EQ(GetSizeByDataType(DT_BOOL), 1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_DOUBLE), 8); | |||
| EXPECT_EQ(GetSizeByDataType(DT_STRING), -1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_INT8), 1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_UINT8), 1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_COMPLEX64), 8); | |||
| EXPECT_EQ(GetSizeByDataType(DT_COMPLEX128), 16); | |||
| EXPECT_EQ(GetSizeByDataType(DT_QINT8), 1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_QINT16), 2); | |||
| EXPECT_EQ(GetSizeByDataType(DT_QINT32), 4); | |||
| EXPECT_EQ(GetSizeByDataType(DT_QUINT8), 1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_QUINT16), 2); | |||
| EXPECT_EQ(GetSizeByDataType(DT_RESOURCE), 8); | |||
| EXPECT_EQ(GetSizeByDataType(DT_STRING_REF), -1); | |||
| EXPECT_EQ(GetSizeByDataType(DT_DUAL), 5); | |||
| EXPECT_EQ(GetSizeByDataType(DT_UNDEFINED), -1); | |||
| EXPECT_EQ(DT_UNDEFINED, 28); | |||
| } | |||
| } // namespace formats | |||
| } // namespace ge | |||