| @@ -25,7 +25,7 @@ namespace ge { | |||||
| namespace hybrid { | namespace hybrid { | ||||
| namespace { | namespace { | ||||
| const int kMaxEvents = 10000; | const int kMaxEvents = 10000; | ||||
| const int kEventDescMax = 256; | |||||
| const int kEventDescMax = 512; | |||||
| const int kMaxEventTypes = 8; | const int kMaxEventTypes = 8; | ||||
| const int kIndent = 8; | const int kIndent = 8; | ||||
| } | } | ||||
| @@ -93,6 +93,7 @@ Status SubgraphExecutor::InitInputsForUnknownShape(const std::vector<TensorValue | |||||
| GELOGD("[%s] Start to update input[%zu] for subgraph data node.", graph_item_->GetName().c_str(), i); | GELOGD("[%s] Start to update input[%zu] for subgraph data node.", graph_item_->GetName().c_str(), i); | ||||
| GE_CHECK_LE(i + 1, input_desc.size()); | GE_CHECK_LE(i + 1, input_desc.size()); | ||||
| const auto &tensor_desc = input_desc[i]; | const auto &tensor_desc = input_desc[i]; | ||||
| GE_CHECK_NOTNULL(tensor_desc); | |||||
| auto node_state = subgraph_context_->GetOrCreateNodeState(input_node); | auto node_state = subgraph_context_->GetOrCreateNodeState(input_node); | ||||
| GE_CHECK_NOTNULL(node_state); | GE_CHECK_NOTNULL(node_state); | ||||
| node_state->GetShapeInferenceState().UpdateInputShape(0, tensor_desc->GetOriginShape(), tensor_desc->GetShape()); | node_state->GetShapeInferenceState().UpdateInputShape(0, tensor_desc->GetOriginShape(), tensor_desc->GetShape()); | ||||
| @@ -164,7 +164,7 @@ Status ShapeInferenceEngine::InferShapeForSubgraph(const NodeItem &node_item, co | |||||
| for (auto &it : fused_subgraph.input_mapping) { | for (auto &it : fused_subgraph.input_mapping) { | ||||
| auto parent_tensor_desc = node_item.MutableInputDesc(it.first); | auto parent_tensor_desc = node_item.MutableInputDesc(it.first); | ||||
| GE_CHECK_NOTNULL(parent_tensor_desc); | GE_CHECK_NOTNULL(parent_tensor_desc); | ||||
| GELOGD("Start to update shape by input[%u]", it.first); | |||||
| GELOGD("Start to update shape by input[%d]", it.first); | |||||
| GELOGD("Update shape to [%s]", parent_tensor_desc->GetShape().ToString().c_str()); | GELOGD("Update shape to [%s]", parent_tensor_desc->GetShape().ToString().c_str()); | ||||
| GELOGD("Update original shape to [%s]", parent_tensor_desc->GetOriginShape().ToString().c_str()); | GELOGD("Update original shape to [%s]", parent_tensor_desc->GetOriginShape().ToString().c_str()); | ||||
| for (auto &tensor_desc : it.second) { | for (auto &tensor_desc : it.second) { | ||||
| @@ -183,12 +183,12 @@ Status ShapeInferenceEngine::InferShapeForSubgraph(const NodeItem &node_item, co | |||||
| } | } | ||||
| for (auto &it : fused_subgraph.output_mapping) { | for (auto &it : fused_subgraph.output_mapping) { | ||||
| uint32_t parent_output_idx = it.first; | |||||
| int parent_output_idx = it.first; | |||||
| const auto &op_desc = it.second; | const auto &op_desc = it.second; | ||||
| GELOGD("Update parent output[%d] by [%s]", parent_output_idx, op_desc->GetName().c_str()); | GELOGD("Update parent output[%d] by [%s]", parent_output_idx, op_desc->GetName().c_str()); | ||||
| auto input_desc = op_desc->MutableInputDesc(0); | auto input_desc = op_desc->MutableInputDesc(0); | ||||
| GE_CHECK_NOTNULL(input_desc); | GE_CHECK_NOTNULL(input_desc); | ||||
| auto parent_output_tensor_desc = node_item.op_desc->MutableOutputDesc(parent_output_idx); | |||||
| auto parent_output_tensor_desc = node_item.MutableOutputDesc(parent_output_idx); | |||||
| GE_CHECK_NOTNULL(parent_output_tensor_desc); | GE_CHECK_NOTNULL(parent_output_tensor_desc); | ||||
| GELOGD("Update shape to [%s]", input_desc->GetShape().ToString().c_str()); | GELOGD("Update shape to [%s]", input_desc->GetShape().ToString().c_str()); | ||||
| GELOGD("Update original shape to [%s]", input_desc->GetOriginShape().ToString().c_str()); | GELOGD("Update original shape to [%s]", input_desc->GetOriginShape().ToString().c_str()); | ||||
| @@ -30,8 +30,8 @@ class NodeTask; | |||||
| class NodeExecutor; | class NodeExecutor; | ||||
| struct FusedSubgraph { | struct FusedSubgraph { | ||||
| std::map<uint32_t, std::vector<GeTensorDescPtr>> input_mapping; | |||||
| std::map<uint32_t, OpDescPtr> output_mapping; | |||||
| std::map<int, std::vector<GeTensorDescPtr>> input_mapping; | |||||
| std::map<int, OpDescPtr> output_mapping; | |||||
| std::vector<NodePtr> nodes; | std::vector<NodePtr> nodes; | ||||
| ComputeGraphPtr graph; | ComputeGraphPtr graph; | ||||
| }; | }; | ||||
| @@ -27,7 +27,7 @@ class HybridModel; | |||||
| class KnownNodeTask : public NodeTask { | class KnownNodeTask : public NodeTask { | ||||
| public: | public: | ||||
| KnownNodeTask(std::shared_ptr<DavinciModel> davinci_model) | |||||
| explicit KnownNodeTask(std::shared_ptr<DavinciModel> davinci_model) | |||||
| : davinci_model_(davinci_model) | : davinci_model_(davinci_model) | ||||
| {} | {} | ||||
| @@ -61,10 +61,10 @@ Status RefInputTask::Execute(TaskContext &context) { | |||||
| Status RefInputTask::RefOneByOne(TaskContext &context) { | Status RefInputTask::RefOneByOne(TaskContext &context) { | ||||
| GELOGI("node %s type %s ref input one by one begin.", node_name_.c_str(), node_type_.c_str()); | GELOGI("node %s type %s ref input one by one begin.", node_name_.c_str(), node_type_.c_str()); | ||||
| uint32_t input_num = context.NumInputs(); | |||||
| uint32_t output_num = context.NumOutputs(); | |||||
| int input_num = context.NumInputs(); | |||||
| int output_num = context.NumOutputs(); | |||||
| if (output_num > input_num) { | if (output_num > input_num) { | ||||
| GELOGE(INTERNAL_ERROR, "node %s type %s has %u outputs but only %u inputs, can't ref one by one.", | |||||
| GELOGE(INTERNAL_ERROR, "node %s type %s has %d outputs but only %d inputs, can't ref one by one.", | |||||
| node_name_.c_str(), node_type_.c_str(), output_num, input_num); | node_name_.c_str(), node_type_.c_str(), output_num, input_num); | ||||
| return INTERNAL_ERROR; | return INTERNAL_ERROR; | ||||
| } | } | ||||
| @@ -72,7 +72,7 @@ Status RefInputTask::RefOneByOne(TaskContext &context) { | |||||
| auto input = context.GetInput(out_index); | auto input = context.GetInput(out_index); | ||||
| GE_CHECK_NOTNULL(input); | GE_CHECK_NOTNULL(input); | ||||
| GE_CHK_STATUS_RET(context.SetOutput(out_index, *input)); | GE_CHK_STATUS_RET(context.SetOutput(out_index, *input)); | ||||
| GELOGD("node %s type %s output[%u] ref input[%u] addr=%p.", | |||||
| GELOGD("node %s type %s output[%d] ref input[%d] addr=%p.", | |||||
| node_name_.c_str(), node_type_.c_str(), out_index, out_index, input->GetData()); | node_name_.c_str(), node_type_.c_str(), out_index, out_index, input->GetData()); | ||||
| } | } | ||||
| GELOGI("node %s type %s ref input one by one end.", node_name_.c_str(), node_type_.c_str()); | GELOGI("node %s type %s ref input one by one end.", node_name_.c_str(), node_type_.c_str()); | ||||