Browse Source

!530 Fixing static check

From: @xchu42
Reviewed-by: @ji_chen,@wqtshg
Signed-off-by: @ji_chen
tags/v1.2.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
73169daa68
6 changed files with 12 additions and 11 deletions
  1. +1
    -1
      ge/hybrid/executor/hybrid_profiler.cc
  2. +1
    -0
      ge/hybrid/executor/subgraph_executor.cc
  3. +3
    -3
      ge/hybrid/executor/worker/shape_inference_engine.cc
  4. +2
    -2
      ge/hybrid/model/node_item.h
  5. +1
    -1
      ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h
  6. +4
    -4
      ge/hybrid/node_executor/ge_local/ge_local_node_executor.cc

+ 1
- 1
ge/hybrid/executor/hybrid_profiler.cc View File

@@ -25,7 +25,7 @@ namespace ge {
namespace hybrid {
namespace {
const int kMaxEvents = 10000;
const int kEventDescMax = 256;
const int kEventDescMax = 512;
const int kMaxEventTypes = 8;
const int kIndent = 8;
}


+ 1
- 0
ge/hybrid/executor/subgraph_executor.cc View File

@@ -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);
GE_CHECK_LE(i + 1, input_desc.size());
const auto &tensor_desc = input_desc[i];
GE_CHECK_NOTNULL(tensor_desc);
auto node_state = subgraph_context_->GetOrCreateNodeState(input_node);
GE_CHECK_NOTNULL(node_state);
node_state->GetShapeInferenceState().UpdateInputShape(0, tensor_desc->GetOriginShape(), tensor_desc->GetShape());


+ 3
- 3
ge/hybrid/executor/worker/shape_inference_engine.cc View File

@@ -164,7 +164,7 @@ Status ShapeInferenceEngine::InferShapeForSubgraph(const NodeItem &node_item, co
for (auto &it : fused_subgraph.input_mapping) {
auto parent_tensor_desc = node_item.MutableInputDesc(it.first);
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 original shape to [%s]", parent_tensor_desc->GetOriginShape().ToString().c_str());
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) {
uint32_t parent_output_idx = it.first;
int parent_output_idx = it.first;
const auto &op_desc = it.second;
GELOGD("Update parent output[%d] by [%s]", parent_output_idx, op_desc->GetName().c_str());
auto input_desc = op_desc->MutableInputDesc(0);
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);
GELOGD("Update shape to [%s]", input_desc->GetShape().ToString().c_str());
GELOGD("Update original shape to [%s]", input_desc->GetOriginShape().ToString().c_str());


+ 2
- 2
ge/hybrid/model/node_item.h View File

@@ -30,8 +30,8 @@ class NodeTask;
class NodeExecutor;

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;
ComputeGraphPtr graph;
};


+ 1
- 1
ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h View File

@@ -27,7 +27,7 @@ class HybridModel;

class KnownNodeTask : public NodeTask {
public:
KnownNodeTask(std::shared_ptr<DavinciModel> davinci_model)
explicit KnownNodeTask(std::shared_ptr<DavinciModel> davinci_model)
: davinci_model_(davinci_model)
{}



+ 4
- 4
ge/hybrid/node_executor/ge_local/ge_local_node_executor.cc View File

@@ -61,10 +61,10 @@ Status RefInputTask::Execute(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());
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) {
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);
return INTERNAL_ERROR;
}
@@ -72,7 +72,7 @@ Status RefInputTask::RefOneByOne(TaskContext &context) {
auto input = context.GetInput(out_index);
GE_CHECK_NOTNULL(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());
}
GELOGI("node %s type %s ref input one by one end.", node_name_.c_str(), node_type_.c_str());


Loading…
Cancel
Save