Browse Source

Fix pclint and codedex.

feature/build-system-rewrite
gaoyong10 4 years ago
parent
commit
8c2cfe9590
10 changed files with 111 additions and 116 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/session/anf_runtime_algorithm.cc
  2. +1
    -1
      mindspore/ccsrc/backend/session/kernel_graph.h
  3. +1
    -1
      mindspore/ccsrc/runtime/framework/actor/control_flow/entrance_actor.cc
  4. +8
    -7
      mindspore/ccsrc/runtime/framework/actor/control_flow/exit_actor.cc
  5. +1
    -1
      mindspore/ccsrc/runtime/framework/actor/data_prepare_actor.cc
  6. +62
    -67
      mindspore/ccsrc/runtime/framework/control_node_parser.cc
  7. +3
    -3
      mindspore/ccsrc/runtime/framework/control_node_parser.h
  8. +31
    -31
      mindspore/ccsrc/runtime/framework/control_node_scheduler.cc
  9. +3
    -3
      mindspore/ccsrc/runtime/framework/control_node_scheduler.h
  10. +0
    -1
      mindspore/ccsrc/vm/backend.cc

+ 1
- 1
mindspore/ccsrc/backend/session/anf_runtime_algorithm.cc View File

@@ -2641,7 +2641,7 @@ int64_t AnfRuntimeAlgorithm::GetAttrGroups(const AnfNodePtr &node, size_t index)
return 1;
}

AnfNodePtr AnfRuntimeAlgorithm::GetTupleIndexes(const AnfNodePtr &node, std::vector<size_t> *index_stack) {
AnfNodePtr AnfRuntimeAlgorithm::GetTupleIndexes(const AnfNodePtr &node, std::vector<size_t> *const index_stack) {
MS_EXCEPTION_IF_NULL(node);
MS_EXCEPTION_IF_NULL(index_stack);



+ 1
- 1
mindspore/ccsrc/backend/session/kernel_graph.h View File

@@ -405,7 +405,7 @@ class KernelGraph : public FuncGraph {
void set_is_loop_count_sink(bool is_loop_count_sink) { is_loop_count_sink_ = is_loop_count_sink; }
const mindspore::HashMap<AnfNodePtr, AnfNodePtr> &front_backend_anf_map() { return front_backend_anf_map_; }

AnfWithOutIndex GetElementInTupleBackendFrontIndexMap(const AnfNodePtr &back_node) {
AnfWithOutIndex GetElementInTupleBackendFrontIndexMap(const AnfNodePtr &back_node) const {
auto iter = tuple_backend_front_anf_index_map_.find(back_node);
if (iter == tuple_backend_front_anf_index_map_.end()) {
return AnfWithOutIndex(nullptr, 0);


+ 1
- 1
mindspore/ccsrc/runtime/framework/actor/control_flow/entrance_actor.cc View File

@@ -43,7 +43,7 @@ void EntranceActor::RunOpRealParameterWithBranchID(const OpRealParameterWithBran
OpContext<DeviceTensor> *const context) {
MS_EXCEPTION_IF_NULL(context);
auto &sequential_num = context->sequential_num_;
real_parameters_with_branch_id_[sequential_num].emplace(real_parameter_with_branch_id);
(void)real_parameters_with_branch_id_[sequential_num].emplace(real_parameter_with_branch_id);

auto is_run = CheckRunningCondition(context);
MS_LOG(DEBUG) << "Actor(" << GetAID().Name()


+ 8
- 7
mindspore/ccsrc/runtime/framework/actor/control_flow/exit_actor.cc View File

@@ -80,17 +80,17 @@ void ExitActor::SendOutput(OpContext<DeviceTensor> *const context) {
// 3.Send output partial in output branch.
const auto &partial_iter = output_branch_partial_arrows_.find(output_branch_id_);
if (partial_iter != output_branch_partial_arrows_.end()) {
for (const auto &partial_arrow : partial_iter->second) {
MS_EXCEPTION_IF_NULL(partial_arrow);
if (IntToSize(partial_arrow->from_output_index_) >= input_partials_.size()) {
std::string error_info = "Invalid partial input:" + std::to_string(partial_arrow->from_output_index_) +
for (const auto &arrow : partial_iter->second) {
MS_EXCEPTION_IF_NULL(arrow);
if (IntToSize(arrow->from_output_index_) >= input_partials_.size()) {
std::string error_info = "Invalid partial input:" + std::to_string(arrow->from_output_index_) +
" current:" + std::to_string(input_partials_.size()) + " for actor:" + GetAID().Name();
SET_OPCONTEXT_FAIL_RET_WITH_ERROR((*context), error_info);
}
auto output_partial = input_partials_[partial_arrow->from_output_index_];
auto output_partial = input_partials_[arrow->from_output_index_];
MS_EXCEPTION_IF_NULL(output_partial->func_graph_);
ActorDispatcher::Send(partial_arrow->to_op_id_, &ControlActor::RunOpPartial, output_partial,
IntToSize(partial_arrow->to_input_index_), context);
ActorDispatcher::Send(arrow->to_op_id_, &ControlActor::RunOpPartial, output_partial,
IntToSize(arrow->to_input_index_), context);
}
}
}
@@ -192,6 +192,7 @@ void ExitActor::CopyDeviceAddress(OpContext<DeviceTensor> *const context) {
if (output_data_by_output_index_[i].empty()) {
continue;
}

const auto &data = input_device_tensors_[i];
MS_EXCEPTION_IF_NULL(data);
for (auto &output_data : output_data_by_output_index_[i]) {


+ 1
- 1
mindspore/ccsrc/runtime/framework/actor/data_prepare_actor.cc View File

@@ -90,7 +90,7 @@ void FetchContinuousMemoryInfo(const CNodePtr &node, std::vector<DeviceTensorPtr
}
}

void ValueTupleToValue(const ValuePtr &value, std::vector<ValuePtr> *values) {
void ValueTupleToValue(const ValuePtr &value, std::vector<ValuePtr> *const values) {
MS_EXCEPTION_IF_NULL(value);
MS_EXCEPTION_IF_NULL(values);
if (value->isa<ValueTuple>()) {


+ 62
- 67
mindspore/ccsrc/runtime/framework/control_node_parser.cc View File

@@ -157,7 +157,7 @@ std::set<FuncGraphPtr> GetFuncGraphbyCallNode(const AnfNodePtr &node, std::stack
for (size_t i = kMakeTupleInputStartPos; i < tuple_inputs.size(); ++i) {
MS_EXCEPTION_IF_NULL(tuple_inputs[i]);
std::stack<size_t> tmp_output_indexs = *output_indexs;
func_graphs.emplace(GetFuncGraphFromPartial(tuple_inputs[i], &tmp_output_indexs));
(void)func_graphs.emplace(GetFuncGraphFromPartial(tuple_inputs[i], &tmp_output_indexs));
}
} else if (tuple_node->isa<Parameter>()) {
const auto &abstract = tuple_node->abstract();
@@ -223,7 +223,7 @@ KernelWithIndex FetchRealInputNode(const KernelWithIndex &node_with_index) {
}

// Fetch all the output index in the sub-abstract of abstract.
std::set<size_t> FetchRealIndexByAbstract(const AbstractBasePtr &abstract, std::vector<size_t> *indexes) {
std::set<size_t> FetchRealIndexByAbstract(const AbstractBasePtr &abstract, std::vector<size_t> *const indexes) {
MS_EXCEPTION_IF_NULL(abstract);
MS_EXCEPTION_IF_NULL(indexes);
AbstractBasePtr dst_abstract = abstract;
@@ -232,7 +232,7 @@ std::set<size_t> FetchRealIndexByAbstract(const AbstractBasePtr &abstract, std::
if (indexes->empty()) {
size_t output_num = AnfAlgo::GetOutputNumByAbstract(abstract);
for (size_t i = 0; i < output_num; ++i) {
output_indexs.emplace(i);
(void)output_indexs.emplace(i);
}
return output_indexs;
}
@@ -286,13 +286,13 @@ std::set<size_t> FetchRealIndexByAbstract(const AbstractBasePtr &abstract, std::
// Fetch real output index.
auto tmp_indexs = FetchRealIndexByAbstract(dst_abstract, indexes);
for (auto tmp_index : tmp_indexs) {
output_indexs.emplace(tmp_index + pre_abstract_num);
(void)output_indexs.emplace(tmp_index + pre_abstract_num);
}
return output_indexs;
}

// Get all the real parameters corresponding to node.
void FetchRealParameterByNode(const KernelWithIndex &node, std::set<KernelWithIndex> *real_parameters,
void FetchRealParameterByNode(const KernelWithIndex &node, std::set<KernelWithIndex> *const real_parameters,
std::set<KernelWithIndex> *invalid_call_nodes,
const mindspore::HashMap<AnfNodePtr, std::set<FuncGraphPtr>> &call_node_to_func_graphs) {
auto node_with_index = node;
@@ -301,13 +301,13 @@ void FetchRealParameterByNode(const KernelWithIndex &node, std::set<KernelWithIn
}
if (node_with_index.first->isa<ValueNode>() || node_with_index.first->isa<Parameter>()) {
// If node is a valuenode or parameter, the real parameter is itself.
real_parameters->emplace(node_with_index);
(void)real_parameters->emplace(node_with_index);
} else if (AnfAlgo::IsCallNode(node_with_index.first)) {
// If node is a call node, the real parameters are the outputs of funcgraph the node called.
if (invalid_call_nodes->find(node_with_index) != invalid_call_nodes->end()) {
return;
}
invalid_call_nodes->emplace(node_with_index);
(void)invalid_call_nodes->emplace(node_with_index);
const auto &iter = call_node_to_func_graphs.find(node_with_index.first);
if (iter == call_node_to_func_graphs.end()) {
MS_LOG(EXCEPTION) << "Invalid call node:" << node_with_index.first->DebugString();
@@ -347,18 +347,18 @@ void FetchRealParameterByNode(const KernelWithIndex &node, std::set<KernelWithIn
}
} else {
// If node is a kernel, the real parameter is itself.
real_parameters->emplace(node_with_index);
(void)real_parameters->emplace(node_with_index);
}
}

// Fetch all the weight parameters related to node. It runs like this:
// if we have a map like {{a, {b, c}}, {b, {d, e}}}, final we will get {{a, {b, c, d, e}}, {b, {c, d}}}.
void FetchWeightbyHostParameter(const AnfNodePtr &node, std::set<AnfNodePtr> *dest_nodes,
void FetchWeightbyHostParameter(const AnfNodePtr &node, std::set<AnfNodePtr> *const dest_nodes,
const RealToFormalParameter &front_to_front_weight) {
if (dest_nodes->find(node) != dest_nodes->end()) {
return;
}
dest_nodes->emplace(node);
(void)dest_nodes->emplace(node);
auto iter = front_to_front_weight.find({node, 0});
if (iter == front_to_front_weight.end()) {
return;
@@ -385,15 +385,15 @@ AnfNodePtr FetchSourceNodeByAutoMonad(const AnfNodePtr &node) {
}

// Topologically sort all funcgraphs according to the function call relationship.
std::vector<FuncGraphPtr> TopoSortForFuncGraph(const FuncGraphPtr &root, FuncGraphCallRelation *edges) {
std::vector<FuncGraphPtr> TopoSortForFuncGraph(const FuncGraphPtr &root, FuncGraphCallRelation *const edges) {
MS_EXCEPTION_IF_NULL(root->manager());
std::set<FuncGraphPtr> nodes;
nodes.emplace(root);
(void)nodes.emplace(root);

FuncGraphSet subs = root->manager()->func_graphs();
for (auto sub : subs) {
if (sub != root && root != nullptr) {
nodes.emplace(sub);
(void)nodes.emplace(sub);
}
}

@@ -408,7 +408,7 @@ std::vector<FuncGraphPtr> TopoSortForFuncGraph(const FuncGraphPtr &root, FuncGra
while (!que.empty()) {
const auto node = que.front();
que.pop();
result.emplace_back(node);
(void)result.emplace_back(node);
for (auto iter = edges->begin(); iter != edges->end();) {
auto &sub_edges = iter->second;
for (auto sub_iter = sub_edges.begin(); sub_iter != sub_edges.end();) {
@@ -444,7 +444,7 @@ std::vector<KernelWithIndex> FetchAllOutputWithIndex(const AnfNodePtr &node) {
MS_EXCEPTION_IF_NULL(value_tuple);
const auto tuple_value = value_tuple->value();
for (size_t i = 0; i < tuple_value.size(); ++i) {
result.emplace_back(node, i);
(void)result.emplace_back(node, i);
}
return result;
}
@@ -460,9 +460,9 @@ std::vector<KernelWithIndex> FetchAllOutputWithIndex(const AnfNodePtr &node) {
} else if (AnfAlgo::CheckPrimitiveType(node_with_index.first, prim::kPrimSwitch) ||
AnfAlgo::CheckPrimitiveType(node_with_index.first, prim::kPrimSwitchLayer)) {
} else if (AnfAlgo::IsCallNode(node_with_index.first)) {
result.emplace_back(node_with_index.first, i);
(void)result.emplace_back(node_with_index.first, i);
} else {
result.emplace_back(node_with_index);
(void)result.emplace_back(node_with_index);
}
}

@@ -539,13 +539,13 @@ void CreateDeviceTensorForFrontNode(const KernelWithIndex &front_node_with_index
}

// Fetch all funcgraph by a seed graph, if a calls b, b calls c, and c calls a, return a set of a, b, c.
void FetchAllExecutionFunction(const FuncGraphPtr &func_graph, std::set<FuncGraphPtr> *checked_funcgraphs,
void FetchAllExecutionFunction(const FuncGraphPtr &func_graph, std::set<FuncGraphPtr> *const checked_funcgraphs,
const std::unordered_map<FuncGraphPtr, std::set<FuncGraphPtr>> &call_relation) {
MS_EXCEPTION_IF_NULL(func_graph);
if (checked_funcgraphs->find(func_graph) != checked_funcgraphs->end()) {
return;
}
checked_funcgraphs->emplace(func_graph);
(void)checked_funcgraphs->emplace(func_graph);
auto iter = call_relation.find(func_graph);
if (iter == call_relation.end()) {
return;
@@ -626,7 +626,7 @@ std::vector<KernelWithIndex> FetchInputNodeByNode(const AnfNodePtr &node) {
const auto &abstract = real_node->abstract();
if (abstract == nullptr) {
MS_LOG(WARNING) << "Empty abstract for node:" << real_node->DebugString();
results.emplace_back(AnfAlgo::VisitKernelWithReturnType(real_node, real_index));
(void)results.emplace_back(AnfAlgo::VisitKernelWithReturnType(real_node, real_index));
return results;
}

@@ -651,7 +651,7 @@ std::vector<KernelWithIndex> FetchInputNodeByNode(const AnfNodePtr &node) {
size_t output_num = AnfAlgo::GetOutputNumByAbstract(abstract);
if (!abstract->isa<abstract::AbstractTuple>()) {
for (size_t i = 0; i < output_num; ++i) {
results.emplace_back(real_node, i);
(void)results.emplace_back(real_node, i);
}
return results;
}
@@ -663,7 +663,7 @@ std::vector<KernelWithIndex> FetchInputNodeByNode(const AnfNodePtr &node) {
for (const auto &sub_abstract : sub_abstracts) {
MS_EXCEPTION_IF_NULL(sub_abstract);
if (!sub_abstract->isa<abstract::AbstractMonad>()) {
results.emplace_back(real_node, index++);
(void)results.emplace_back(real_node, index++);
}
}
return results;
@@ -672,7 +672,7 @@ std::vector<KernelWithIndex> FetchInputNodeByNode(const AnfNodePtr &node) {
// Add formal parameter and real parameter into realationship map.
void AddFormalToRealParameter(const AnfNodePtr &formal_parameter, const AnfNodePtr &real_parameter,
const CallNodeToFuncGraph &call_node_to_func_graphs,
FormalToRealParameter *formal_to_real_parameters) {
FormalToRealParameter *const formal_to_real_parameters) {
MS_EXCEPTION_IF_NULL(formal_parameter);
auto abstract = formal_parameter->abstract();
MS_EXCEPTION_IF_NULL(abstract);
@@ -778,7 +778,7 @@ bool IsCsrNode(const AnfNodePtr &node) {
AnfAlgo::CheckPrimitiveType(node, prim::kPrimCSRTensorGetDenseShape);
}

KernelWithIndex GetFrontNodeByKernelGraph(const AnfNodePtr &backend_node, KernelGraph *const graph) {
KernelWithIndex GetFrontNodeByKernelGraph(const AnfNodePtr &backend_node, const KernelGraph *const graph) {
MS_EXCEPTION_IF_NULL(graph);
const auto &front_node = graph->GetFrontAnfByBackendAnf(backend_node);
if (front_node != nullptr) {
@@ -819,9 +819,9 @@ std::vector<KernelWithIndex> FetchInputNodeByCNode(const AnfNodePtr &node) {
if (inputs.size() != kSwitchInputNum) {
MS_LOG(EXCEPTION) << "Invalid switch node:" << node->DebugString();
}
results.emplace_back(AnfAlgo::VisitKernelWithReturnType(inputs[kSwitchCondPos], 0));
results.emplace_back(AnfAlgo::VisitKernelWithReturnType(inputs[kSwitchFalseBranchPos], 0));
results.emplace_back(AnfAlgo::VisitKernelWithReturnType(inputs[kSwitchTrueBranchPos], 0));
(void)results.emplace_back(AnfAlgo::VisitKernelWithReturnType(inputs[kSwitchCondPos], 0));
(void)results.emplace_back(AnfAlgo::VisitKernelWithReturnType(inputs[kSwitchFalseBranchPos], 0));
(void)results.emplace_back(AnfAlgo::VisitKernelWithReturnType(inputs[kSwitchTrueBranchPos], 0));
return results;
}

@@ -1081,7 +1081,7 @@ void ControlNodeParser::ParseDeviceContextForFuncGraph(const std::vector<AnfNode
const auto &abstract = parameter->abstract();
MS_EXCEPTION_IF_NULL(abstract);
for (size_t i = 0; i < AnfAlgo::GetOutputNumByAbstract(abstract); ++i) {
front_parameters.emplace_back(parameter, i);
(void)front_parameters.emplace_back(parameter, i);
}
}
std::vector<const DeviceContext *> parameter_device_contexts(front_parameters.size(), default_context);
@@ -1162,7 +1162,7 @@ void ControlNodeParser::ParseDeviceContextForPartialNode(const std::vector<AnfNo
std::vector<const DeviceContext *> device_contexts;
// In partial node, the first input is always a partial, maybe a funcgraph or a partial node, so we need
// to insert an empty device context for it.
device_contexts.emplace_back(nullptr);
(void)device_contexts.emplace_back(nullptr);
for (size_t i = 0; i < inputs.size() - kPartialInputStartPos; ++i) {
if (i >= iter->second.size()) {
MS_LOG(EXCEPTION) << "Invalid device context index:" << i << " for funcgraph:" << func_graph->ToString()
@@ -1170,7 +1170,7 @@ void ControlNodeParser::ParseDeviceContextForPartialNode(const std::vector<AnfNo
<< " for partial node:" << cnode->DebugString();
}
MS_EXCEPTION_IF_NULL(iter->second[i]);
device_contexts.emplace_back(iter->second[i]);
(void)device_contexts.emplace_back(iter->second[i]);
}
control_node_to_device_contexts_[control_node] = device_contexts;
}
@@ -1198,7 +1198,7 @@ void ControlNodeParser::ParseDeviceContextForCallNode(const std::vector<AnfNodeP
std::vector<const DeviceContext *> device_contexts;
// In call node, the first input is always a partial, maybe a funcgraph or a partial node, so we need
// to insert an empty device context for it.
device_contexts.emplace_back(nullptr);
(void)device_contexts.emplace_back(nullptr);
const auto &cnode = control_node->cast<CNodePtr>();
MS_EXCEPTION_IF_NULL(cnode);
const auto &inputs = cnode->inputs();
@@ -1216,13 +1216,8 @@ void ControlNodeParser::ParseDeviceContextForCallNode(const std::vector<AnfNodeP

// Fetch the device contexts for the real parameters on the call node.
for (size_t i = iter->second.size() - call_input_num; i < iter->second.size(); ++i) {
if (i >= iter->second.size()) {
MS_LOG(EXCEPTION) << "Invalid device context index:" << i << " for funcgraph:" << func_graph->ToString()
<< " device context size:" << iter->second.size()
<< " for partial node:" << cnode->DebugString();
}
MS_EXCEPTION_IF_NULL(iter->second[i]);
device_contexts.emplace_back(iter->second[i]);
(void)device_contexts.emplace_back(iter->second[i]);
}
control_node_to_device_contexts_[control_node] = device_contexts;
}
@@ -1237,7 +1232,7 @@ void ControlNodeParser::ParseDeviceContextForReturnNode(const DeviceContext *def
MS_EXCEPTION_IF_NULL(call_node);
const auto &func_graph = call_node->func_graph();
MS_EXCEPTION_IF_NULL(func_graph);
func_graph_call_relation[func_graph].emplace_back(call_node_to_func_graphs.second);
(void)func_graph_call_relation[func_graph].emplace_back(call_node_to_func_graphs.second);
}

// Topologically sort all funcgraphs according to the function call relationship.
@@ -1267,11 +1262,11 @@ void ControlNodeParser::ParseDeviceContextForReturnNode(const DeviceContext *def
MS_LOG(EXCEPTION) << "Cannot find device context for funcgraph:" << func_graph->ToString();
}
MS_EXCEPTION_IF_NULL(func_graph_iter->second[iter - func_graph->parameters().begin()]);
return_device_contexts.emplace_back(func_graph_iter->second[iter - func_graph->parameters().begin()]);
(void)return_device_contexts.emplace_back(func_graph_iter->second[iter - func_graph->parameters().begin()]);
} else if (output_node.first->isa<ValueNode>()) {
// If the output is parameter, used the default context type.
MS_EXCEPTION_IF_NULL(default_context);
return_device_contexts.emplace_back(default_context);
(void)return_device_contexts.emplace_back(default_context);
} else if (AnfAlgo::IsCallNode(output_node.first)) {
// If the output is call node, get the device context type by the output of funcgraph.
const auto &func_graphs = call_node_to_func_graphs_[output_node.first];
@@ -1295,10 +1290,10 @@ void ControlNodeParser::ParseDeviceContextForReturnNode(const DeviceContext *def
<< " index:" << output_node.second;
}
MS_EXCEPTION_IF_NULL(call_device_contexts[output_node.second]);
return_device_contexts.emplace_back(call_device_contexts[output_node.second]);
(void)return_device_contexts.emplace_back(call_device_contexts[output_node.second]);
} else if (AnfAlgo::CheckPrimitiveType(output_node.first, prim::kPrimPartial) ||
AnfAlgo::CheckPrimitiveType(output_node.first, prim::kPrimSwitch)) {
return_device_contexts.emplace_back(default_context);
(void)return_device_contexts.emplace_back(default_context);
} else if (output_node.first->isa<CNode>()) {
// If the output is a cnode, get the device context type by the kernel.
const auto &iter = front_to_backend_kernels_.find(output_node);
@@ -1306,7 +1301,7 @@ void ControlNodeParser::ParseDeviceContextForReturnNode(const DeviceContext *def
MS_LOG(EXCEPTION) << "Cannot find backend kernel for cnode:" << output_node.first->DebugString();
}
MS_EXCEPTION_IF_NULL(iter->second.second);
return_device_contexts.emplace_back(iter->second.second);
(void)return_device_contexts.emplace_back(iter->second.second);
} else {
MS_LOG(EXCEPTION) << "Invalid node for return:" << output_node.first->DebugString();
}
@@ -1384,7 +1379,7 @@ FuncGraphPtr ControlNodeParser::FetchFuncGraphByKernelGraph(const KernelGraph *c
}

void ControlNodeParser::FetchFrontValueNode(const std::vector<AnfNodePtr> &control_nodes,
DeviceContext *default_context) {
const DeviceContext *const default_context) {
MS_EXCEPTION_IF_NULL(default_context);

for (const auto &formal_to_real_parameter : formal_to_real_parameters_) {
@@ -1395,11 +1390,11 @@ void ControlNodeParser::FetchFrontValueNode(const std::vector<AnfNodePtr> &contr

const auto &iter = front_to_backend_parameters_.find(real_parameter_with_index);
if (iter != front_to_backend_parameters_.end() && (!iter->second.empty())) {
front_value_nodes_.emplace(real_parameter_with_index, iter->second.begin()->second);
(void)front_value_nodes_.emplace(real_parameter_with_index, iter->second.begin()->second);
CreateDeviceTensorForValueNode(real_parameter_with_index, iter->second.begin()->first,
iter->second.begin()->second);
} else {
front_value_nodes_.emplace(real_parameter_with_index, default_context);
(void)front_value_nodes_.emplace(real_parameter_with_index, default_context);
CreateDeviceTensorForFrontNode(real_parameter_with_index, default_context);
}
}
@@ -1414,7 +1409,7 @@ void ControlNodeParser::FetchFrontValueNode(const std::vector<AnfNodePtr> &contr
const auto &backend_parameter = front_to_backend_parameters.second.begin()->first;
const auto &device_context = front_to_backend_parameters.second.begin()->second;
CreateDeviceTensorForValueNode(front_to_backend_parameters.first, backend_parameter, device_context);
front_value_nodes_.emplace(front_to_backend_parameters.first, device_context);
(void)front_value_nodes_.emplace(front_to_backend_parameters.first, device_context);
}
}

@@ -1437,7 +1432,7 @@ void ControlNodeParser::FetchFrontValueNode(const std::vector<AnfNodePtr> &contr
if (IsFrontValueNode(input_with_index) &&
front_value_nodes_.find({input_with_index, iter->second[i]}) == front_value_nodes_.end()) {
CreateDeviceTensorForFrontNode(input_with_index, iter->second[i]);
front_value_nodes_.emplace(input_with_index, iter->second[i]);
(void)front_value_nodes_.emplace(input_with_index, iter->second[i]);
}
}
}
@@ -1502,9 +1497,9 @@ void ControlNodeParser::ParseFormalToRealParameter(const std::vector<AnfNodePtr>
std::set<KernelWithIndex> invalid_real_parameter{formal_parameter};
ParseAllRealParameterByFormalParameter(real_parameter, formal_to_real_parameters, &total_real_parameters,
&invalid_real_parameter);
real_to_formal_parameters_[real_parameter].emplace(formal_parameter);
(void)real_to_formal_parameters_[real_parameter].emplace(formal_parameter);
} else {
total_real_parameters.emplace(real_parameter);
(void)total_real_parameters.emplace(real_parameter);
}
}
std::swap(formal_to_real_parameters_[formal_parameter], total_real_parameters);
@@ -1513,12 +1508,12 @@ void ControlNodeParser::ParseFormalToRealParameter(const std::vector<AnfNodePtr>

void ControlNodeParser::ParseAllRealParameterByFormalParameter(const KernelWithIndex &formal_parameter,
const FormalToRealParameter &formal_to_real_parameters,
std::set<KernelWithIndex> *total_real_parameters,
std::set<KernelWithIndex> *const total_real_parameters,
std::set<KernelWithIndex> *invalid_real_parameter) {
if (invalid_real_parameter->find(formal_parameter) != invalid_real_parameter->end()) {
return;
}
invalid_real_parameter->emplace(formal_parameter);
(void)invalid_real_parameter->emplace(formal_parameter);

// Get all the actual parameters corresponding to parameter recursively.
const auto &dst_iter = formal_to_real_parameters_.find(formal_parameter);
@@ -1538,7 +1533,7 @@ void ControlNodeParser::ParseAllRealParameterByFormalParameter(const KernelWithI
const auto &real_parameters = src_iter->second;
for (const auto &real_parameter : real_parameters) {
MS_EXCEPTION_IF_NULL(real_parameter.first);
total_real_parameters->emplace(real_parameter);
(void)total_real_parameters->emplace(real_parameter);
if (real_parameter.first->isa<Parameter>()) {
ParseAllRealParameterByFormalParameter(real_parameter, formal_to_real_parameters, total_real_parameters,
invalid_real_parameter);
@@ -1623,13 +1618,13 @@ void ControlNodeParser::ParseFrontToBackendParameter(const std::vector<KernelGra
call_node_to_func_graphs_);
for (const auto real_parameter : real_parameters) {
if (real_parameter.first->isa<Parameter>() || real_parameter.first->isa<ValueNode>()) {
front_to_backend_parameters_[real_parameter].emplace(parameter, device_context);
(void)front_to_backend_parameters_[real_parameter].emplace(parameter, device_context);
}
}
} else if (front_tuple_parameter_with_index.first != nullptr) {
front_to_backend_parameters_[front_tuple_parameter_with_index].emplace(parameter, device_context);
(void)front_to_backend_parameters_[front_tuple_parameter_with_index].emplace(parameter, device_context);
} else {
front_to_backend_parameters_[{front_node, 0}].emplace(parameter, device_context);
(void)front_to_backend_parameters_[{front_node, 0}].emplace(parameter, device_context);
}
}
}
@@ -1664,7 +1659,7 @@ void ControlNodeParser::ParseCallNodeToFuncGraph(const std::vector<AnfNodePtr> &

auto func_graphs = func_graph_analyzer->GetCallerFuncGraphs(control_node);
for (auto func_graph : func_graphs) {
call_node_to_func_graphs_[control_node].emplace(func_graph);
(void)call_node_to_func_graphs_[control_node].emplace(func_graph);
}
}
}
@@ -1758,7 +1753,7 @@ void ControlNodeParser::ParseFirstControlNodeForFuncGraph(const std::vector<AnfN
IsFirstControlNode(control_node, &checked_nodes, unrecursion_call_nodes_)) {
const auto &func_graph = control_node->func_graph();
MS_EXCEPTION_IF_NULL(func_graph);
func_graph_to_first_control_nodes_[func_graph].emplace(control_node);
(void)func_graph_to_first_control_nodes_[func_graph].emplace(control_node);
}
}
}
@@ -1784,7 +1779,7 @@ void ControlNodeParser::ParseUnRecursionCallNode() {
FetchAllExecutionFunction(func_graph, &exexution_func_graphs, func_graph_call_relation);
}
if (exexution_func_graphs.find(dest_func_graph) == exexution_func_graphs.end()) {
unrecursion_call_nodes_.emplace(call_node);
(void)unrecursion_call_nodes_.emplace(call_node);
MS_LOG(DEBUG) << "Add unrecursion call control node:" << call_node->DebugString();
}
}
@@ -1809,7 +1804,7 @@ void ControlNodeParser::ParseNeedStackControlNode(const std::vector<AnfNodePtr>
continue;
}
}
need_stack_control_nodes_.emplace(control_node);
(void)need_stack_control_nodes_.emplace(control_node);
MS_LOG(DEBUG) << "Add need stack control node:" << control_node->DebugString();
break;
}
@@ -1834,13 +1829,13 @@ void ControlNodeParser::ParseNeedStackControlNode(const std::vector<AnfNodePtr>
}

if (call_input_num != 0 && (AnfAlgo::CheckPrimitiveType(inputs[kReturnInputPos], prim::kPrimDepend))) {
need_stack_control_nodes_.emplace(control_node);
(void)need_stack_control_nodes_.emplace(control_node);
}
} else if (AnfAlgo::CheckPrimitiveType(control_node, prim::kPrimPartial) ||
AnfAlgo::CheckPrimitiveType(control_node, prim::kPrimSwitch) ||
AnfAlgo::CheckPrimitiveType(control_node, prim::kPrimSwitchLayer)) {
if (!IsInputInSameLevel(control_node)) {
need_stack_control_nodes_.emplace(control_node);
(void)need_stack_control_nodes_.emplace(control_node);
MS_LOG(DEBUG) << "Add need stack control node:" << control_node->DebugString();
}
}
@@ -1865,7 +1860,7 @@ void ControlNodeParser::ParseNeedStackKernelGraph(const KernelGraphToDeviceConte
MS_LOG(EXCEPTION) << "Failed to find device context for kernel graph:" << kernel_graph->ToString();
}
// Collect kernel graphs in group.
kernel_graph_group_info->graphs_.emplace(kernel_graph);
(void)kernel_graph_group_info->graphs_.emplace(kernel_graph);

// Collect inputs in group.
const auto &real_parameters = kernel_graph->input_nodes();
@@ -1908,14 +1903,14 @@ void ControlNodeParser::ParseNeedStackKernelGraph(const KernelGraphToDeviceConte

kernel_graphs_to_group_info_[kernel_graph] = kernel_graph_group_info;
if (kernel_graph_group_info->need_stack_) {
call_input_kernel_graphs_.emplace(kernel_graph.get());
(void)call_input_kernel_graphs_.emplace(kernel_graph.get());
}
}
kernel_graph_group_info->group_name_ = "kernel_graph";
for (const auto &graph : kernel_graph_group_info->graphs_) {
kernel_graph_group_info->group_name_ += ("_" + std::to_string(graph->graph_id()));
}
kernel_graph_group_infos_.emplace(kernel_graph_group_info);
(void)kernel_graph_group_infos_.emplace(kernel_graph_group_info);
}
}
}
@@ -2011,13 +2006,13 @@ bool ControlNodeParser::IsInputInSameLevel(const AnfNodePtr &node) {
return true;
}

void ControlNodeParser::CreateDeviceTensorForRootGraphParameter(DeviceContext *default_context) {
void ControlNodeParser::CreateDeviceTensorForRootGraphParameter(DeviceContext *const default_context) {
MS_EXCEPTION_IF_NULL(default_context);
for (const auto &parameter : root_graph_parameters_) {
KernelWithIndex parameter_with_index(parameter, 0);
if (front_to_backend_parameters_.find(parameter_with_index) == front_to_backend_parameters_.end()) {
CreateDeviceTensorForFrontNode(parameter_with_index, default_context);
front_to_backend_parameters_[parameter_with_index].emplace(parameter, default_context);
(void)front_to_backend_parameters_[parameter_with_index].emplace(parameter, default_context);
}
}
}


+ 3
- 3
mindspore/ccsrc/runtime/framework/control_node_parser.h View File

@@ -101,7 +101,7 @@ bool HasAbstractRef(const AnfNodePtr &node);
bool IsCsrNode(const AnfNodePtr &node);
// Get the front node corresponding to the backend node, if the front node is not a parameter node, return the
// corresponding cnode.
KernelWithIndex GetFrontNodeByKernelGraph(const AnfNodePtr &backend_node, KernelGraph *const graph);
KernelWithIndex GetFrontNodeByKernelGraph(const AnfNodePtr &backend_node, const KernelGraph *const graph);
// Get all the real input of the frontend node, skip the virtual node like maketuple, tuplegetitem.
std::vector<KernelWithIndex> FetchInputNodeByCNode(const AnfNodePtr &node);
// Fetch the sub abstract from the top abstract by the index.
@@ -156,7 +156,7 @@ class ControlNodeParser {
// value nodes will not enter the kernel graph, so these nodes need to be saved separately, and space is allocated for
// them separately during initialization.
// The interface is initialized by finding the backend node in the kernel graph that the front node finally sends to.
void FetchFrontValueNode(const std::vector<AnfNodePtr> &control_nodes, DeviceContext *default_context);
void FetchFrontValueNode(const std::vector<AnfNodePtr> &control_nodes, const DeviceContext *const default_context);
// Create branch id for all call node in the control flow.
void CreateBranchIDForCallNode(const std::vector<AnfNodePtr> &control_nodes);

@@ -225,7 +225,7 @@ class ControlNodeParser {
void ParseNodeLevel(const std::vector<AnfNodePtr> &control_nodes);
// When the parameter is directly used as the condition of the switch, there will be no back-end node, and a device
// tensor needs to be created for it.
void CreateDeviceTensorForRootGraphParameter(DeviceContext *default_context);
void CreateDeviceTensorForRootGraphParameter(DeviceContext *const default_context);
// In control flow, funcgraph will be cut into multiple kernel graphs for execution, and this relationship is recorded
// in this map.
FuncGraphToKernelGraphGroup func_graph_to_kernel_graph_groups_;


+ 31
- 31
mindspore/ccsrc/runtime/framework/control_node_scheduler.cc View File

@@ -45,7 +45,7 @@ std::string GetStackActorNameByExitName(const std::string &exit_name) {
}

// Fetch the depend nodes according to the monad node.
void FetchRealDependNodeByAutoMonad(const AnfNodePtr &node, std::set<AnfNodePtr> *depend_nodes) {
void FetchRealDependNodeByAutoMonad(const AnfNodePtr &node, std::set<AnfNodePtr> *const depend_nodes) {
// Find the real input node, include the monad node and make tuple node.
const std::vector<PrimitivePtr> return_types = {prim::kPrimDepend, prim::kPrimUpdateState, prim::kPrimLoad,
prim::kPrimMakeTuple};
@@ -77,7 +77,7 @@ void FetchRealDependNodeByAutoMonad(const AnfNodePtr &node, std::set<AnfNodePtr>
FetchRealDependNodeByAutoMonad(real_inputs[i], depend_nodes);
}
} else {
depend_nodes->emplace(real_node);
(void)depend_nodes->emplace(real_node);
}
}

@@ -131,7 +131,7 @@ std::vector<SwitchActorPtr> ControlNodeScheduler::BuildSwitchActor(const GraphCo
const auto &parameters = FetchInputNodeByCNode(control_node);
const auto &switch_actor =
std::make_shared<SwitchActor>(actor_name, memory_manager_aid_, parameters, control_node);
switch_actors.emplace_back(switch_actor);
(void)switch_actors.emplace_back(switch_actor);
InsertActor(switch_actor.get());
}
}
@@ -151,7 +151,7 @@ std::vector<GatherActorPtr> ControlNodeScheduler::BuildGatherActor(const GraphCo
const auto &parameters = FetchInputNodeByCNode(control_node);
const auto &gather_actor =
std::make_shared<GatherActor>(actor_name, memory_manager_aid_, parameters, control_node);
gather_actors.emplace_back(gather_actor);
(void)gather_actors.emplace_back(gather_actor);
InsertActor(gather_actor.get());

// The gather actor corresponding to a call node needs to set the branch id.
@@ -178,7 +178,7 @@ std::vector<EntranceActorPtr> ControlNodeScheduler::BuildEntranceActor(const Gra
for (const auto &call_node_to_func_graph : call_node_to_func_graphs) {
const auto &node = call_node_to_func_graph.first;
for (const auto &func_graph : call_node_to_func_graph.second) {
func_graph_to_call_nodes[func_graph].emplace(node, 0);
(void)func_graph_to_call_nodes[func_graph].emplace(node, 0);
}
}

@@ -201,7 +201,7 @@ std::vector<EntranceActorPtr> ControlNodeScheduler::BuildEntranceActor(const Gra
MS_EXCEPTION_IF_NULL(abstract);
size_t output_num = AnfAlgo::GetOutputNumByAbstract(abstract);
for (size_t i = 0; i < output_num; ++i) {
formal_parameters.emplace_back(parameter, i);
(void)formal_parameters.emplace_back(parameter, i);
}
}

@@ -225,7 +225,7 @@ std::vector<EntranceActorPtr> ControlNodeScheduler::BuildEntranceActor(const Gra
entrance_actor->device_contexts_.clear();
entrance_actor->device_contexts_.insert(entrance_actor->device_contexts_.begin(), context_iter->second.begin(),
context_iter->second.begin() + formal_parameters.size());
entrance_actors.emplace_back(entrance_actor);
(void)entrance_actors.emplace_back(entrance_actor);
InsertActor(entrance_actor.get());
}
}
@@ -254,7 +254,7 @@ std::vector<ExitActorPtr> ControlNodeScheduler::BuildExitActor(const GraphCompil
MS_LOG(EXCEPTION) << "Failed to get device contexts for funcgraph:" << func_graph->ToString();
}
exit_actor->device_contexts_ = context_iter->second;
exit_actors.emplace_back(exit_actor);
(void)exit_actors.emplace_back(exit_actor);
InsertActor(exit_actor.get());
}
}
@@ -280,20 +280,20 @@ std::vector<ExitActorPtr> ControlNodeScheduler::BuildExitActor(const GraphCompil
continue;
}
// Collect inputs of exit actor.
formal_parameters.emplace_back(node_with_context.first);
(void)formal_parameters.emplace_back(node_with_context.first);
// Get the device contexts of the exit actor's cnode inputs.
const AnfNodePtr &backend_node = node_with_context.second.first.first;
MS_EXCEPTION_IF_NULL(backend_node);
is_need_copy_device_tensors.emplace_back(
(void)is_need_copy_device_tensors.emplace_back(
is_need_copy_device_tensor(backend_node, node_with_context.second.first.second));
device_contexts.emplace_back(node_with_context.second.second);
(void)device_contexts.emplace_back(node_with_context.second.second);
}

const auto &actor_name = kernel_graph_group_info->group_name_ + kExitActorNameSuffix;
const auto &exit_actor = std::make_shared<ExitActor>(actor_name, memory_manager_aid_, formal_parameters, nullptr);
exit_actor->is_need_copy_device_tensors_.swap(is_need_copy_device_tensors);
exit_actor->device_contexts_.swap(device_contexts);
exit_actors.emplace_back(exit_actor);
(void)exit_actors.emplace_back(exit_actor);
InsertActor(exit_actor.get());
}

@@ -326,8 +326,8 @@ std::vector<StackActorPtr> ControlNodeScheduler::BuildStackActor(const GraphComp
}
if (iter->second == kernel_graph_group_info->level_ &&
(!(parser->IsRootGraphParameter(from_node) && IsPersistentDeviceTensor(from_node)))) {
formal_parameters.emplace_back(node_with_context.first);
device_contexts.emplace_back(node_with_context.second);
(void)formal_parameters.emplace_back(node_with_context.first);
(void)device_contexts.emplace_back(node_with_context.second);
} else {
formal_parameters.insert(formal_parameters.begin(), node_with_context.first);
device_contexts.insert(device_contexts.begin(), node_with_context.second);
@@ -335,7 +335,7 @@ std::vector<StackActorPtr> ControlNodeScheduler::BuildStackActor(const GraphComp
}
}
const auto &stack_actor = std::make_shared<StackActor>(actor_name, memory_manager_aid_, formal_parameters);
stack_actors.emplace_back(stack_actor);
(void)stack_actors.emplace_back(stack_actor);
stack_actor->device_contexts_.swap(device_contexts);
stack_actor->input_stack_data_num_ = input_parameter_data_num;
InsertActor(stack_actor.get());
@@ -347,7 +347,7 @@ std::vector<StackActorPtr> ControlNodeScheduler::BuildStackActor(const GraphComp
}

void ControlNodeScheduler::BuildStackActorForControlNode(const GraphCompilerInfo &graph_compiler_info,
std::vector<StackActorPtr> *stack_actors) {
std::vector<StackActorPtr> *const stack_actors) {
const auto &parser = graph_compiler_info.control_node_parser_;
MS_EXCEPTION_IF_NULL(parser);

@@ -407,8 +407,8 @@ void ControlNodeScheduler::BuildStackActorForControlNode(const GraphCompilerInfo

if (control_node_level == iter->second &&
(!(parser->IsRootGraphParameter(parameter.first) && IsPersistentDeviceTensor(parameter.first)))) {
formal_parameters.emplace_back(parameter);
device_contexts.emplace_back(device_context);
(void)formal_parameters.emplace_back(parameter);
(void)device_contexts.emplace_back(device_context);
} else {
formal_parameters.insert(formal_parameters.begin(), parameter);
device_contexts.insert(device_contexts.begin(), device_context);
@@ -431,11 +431,11 @@ void ControlNodeScheduler::BuildStackActorForControlNode(const GraphCompilerInfo
stack_actor->input_stack_partials_num_ = input_parameter_partials_num;

InsertActor(stack_actor.get());
stack_actors->emplace_back(stack_actor);
(void)stack_actors->emplace_back(stack_actor);
}
}

void ControlNodeScheduler::Link(ActorSet *actor_set, const GraphCompilerInfo &graph_compiler_info) {
void ControlNodeScheduler::Link(ActorSet *const actor_set, const GraphCompilerInfo &graph_compiler_info) {
MS_EXCEPTION_IF_NULL(actor_set);
MS_EXCEPTION_IF_NULL(actor_set->control_actors_);

@@ -572,7 +572,7 @@ void ControlNodeScheduler::LinkArrowForControlActor(ControlActorSet *const contr
}
}

void ControlNodeScheduler::LinkArrowFromStackActor(StackActor *stack_actor, ControlActor *to_actor) {
void ControlNodeScheduler::LinkArrowFromStackActor(StackActor *const stack_actor, ControlActor *const to_actor) {
MS_EXCEPTION_IF_NULL(stack_actor);
MS_EXCEPTION_IF_NULL(to_actor);

@@ -678,7 +678,7 @@ void ControlNodeScheduler::LinkArrowByParameter(const AnfNodePtr &parameter, Con
const KernelWithIndex &to_node_with_index,
const ControlNodeParserPtr &parser) {
if (parser->IsRootGraphParameter(parameter) && IsPersistentDeviceTensor(parameter)) {
to_actor->device_tensor_store_keys_.emplace_back(to_node_with_index.second, parameter);
(void)to_actor->device_tensor_store_keys_.emplace_back(to_node_with_index.second, parameter);
return;
}
// Link arrow from entrance actor.
@@ -1025,14 +1025,14 @@ void ControlNodeScheduler::LinkControlArrowByAutoMonad(ControlActor *to_actor, c
auto exit_actor_name = func_graph->ToString() + kExitActorNameSuffix;
from_actor = FetchActor(exit_actor_name);
MS_EXCEPTION_IF_NULL(from_actor);
from_actors.emplace_back(from_actor);
(void)from_actors.emplace_back(from_actor);
auto exit_actor = dynamic_cast<ExitActor *>(from_actor);
MS_EXCEPTION_IF_NULL(exit_actor);
LinkControlArrowForExitActor(exit_actor, to_actor, branch_id);
}
to_actor->input_controls_num_ -= (func_graphs.size() - 1);
} else if (from_actor != nullptr) {
from_actors.emplace_back(from_actor);
(void)from_actors.emplace_back(from_actor);
LinkControlArrow(from_actor, to_actor);
} else {
if (graph == nullptr) {
@@ -1046,7 +1046,7 @@ void ControlNodeScheduler::LinkControlArrowByAutoMonad(ControlActor *to_actor, c
<< " to actor:" << to_actor->GetAID() << " is already exist.";
continue;
}
from_actors.emplace_back(from_actor);
(void)from_actors.emplace_back(from_actor);
LinkControlArrow(from_actor, to_actor);
}
if (to_actor->type_ != KernelTransformType::kStackActor || parser->IsRecursionCallNode(depend_node) ||
@@ -1060,7 +1060,7 @@ void ControlNodeScheduler::LinkControlArrowByAutoMonad(ControlActor *to_actor, c
stack_actor->input_controls_num_--;
stack_actor->input_stack_controls_num_++;
for (const auto &actor : from_actors) {
stack_actor->stack_control_aids_.emplace(actor->GetAID());
(void)stack_actor->stack_control_aids_.emplace(actor->GetAID());
}
}
}
@@ -1316,7 +1316,7 @@ void ControlNodeScheduler::LinkDataArrow(AbstractActor *const from_actor, Abstra
(void)to_actor->input_data_arrow_aids_.emplace_back(from_actor->GetAID());
}

void ControlNodeScheduler::LinkControlArrow(AbstractActor *from_actor, AbstractActor *to_actor) {
void ControlNodeScheduler::LinkControlArrow(AbstractActor *const from_actor, AbstractActor *to_actor) {
MS_EXCEPTION_IF_NULL(from_actor);
MS_EXCEPTION_IF_NULL(to_actor);
(void)from_actor->output_control_arrows_.emplace_back(to_actor->GetAID());
@@ -1373,16 +1373,16 @@ void ControlNodeScheduler::LinkPartialArrow(ControlActor *const from_actor, Cont
MS_EXCEPTION_IF_NULL(from_actor);
MS_EXCEPTION_IF_NULL(to_actor);
auto op_arrow = std::make_shared<DataArrow>(from_index, to_actor->GetAID(), to_index);
from_actor->output_partial_arrows_.emplace_back(op_arrow);
(void)from_actor->output_partial_arrows_.emplace_back(op_arrow);
to_actor->input_partials_num_++;
to_actor->input_partial_arrow_aids_.emplace_back(from_actor->GetAID());
(void)to_actor->input_partial_arrow_aids_.emplace_back(from_actor->GetAID());
}

void ControlNodeScheduler::LinkBranchIDArrow(ControlActor *const from_actor, ControlActor *const to_actor) {
MS_EXCEPTION_IF_NULL(from_actor);
MS_EXCEPTION_IF_NULL(to_actor);
from_actor->output_branch_id_arrows_.emplace_back(to_actor->GetAID());
to_actor->input_branch_id_arrow_aids_.emplace_back(from_actor->GetAID());
(void)from_actor->output_branch_id_arrows_.emplace_back(to_actor->GetAID());
(void)to_actor->input_branch_id_arrow_aids_.emplace_back(from_actor->GetAID());
to_actor->input_branch_ids_num_++;
}



+ 3
- 3
mindspore/ccsrc/runtime/framework/control_node_scheduler.h View File

@@ -40,7 +40,7 @@ class ControlNodeScheduler {
// Transform the control nodes to control actors.
ControlActorSetPtr Build(const GraphCompilerInfo &graph_compiler_info, const AID &memory_manager_aid);
// Link control actors.
void Link(ActorSet *actor_set, const GraphCompilerInfo &graph_compiler_info);
void Link(ActorSet *const actor_set, const GraphCompilerInfo &graph_compiler_info);

bool CheckActorValid(const ControlActorSetPtr &control_actor_set);

@@ -55,7 +55,7 @@ class ControlNodeScheduler {
std::vector<ExitActorPtr> BuildExitActor(const GraphCompilerInfo &graph_compiler_info);
std::vector<StackActorPtr> BuildStackActor(const GraphCompilerInfo &graph_compiler_info);
void BuildStackActorForControlNode(const GraphCompilerInfo &graph_compiler_info,
std::vector<StackActorPtr> *stack_actors);
std::vector<StackActorPtr> *const stack_actors);
// Interface to link control actors.
void LinkControlArrowForControlActor(ActorSet *const actor_set, const GraphCompilerInfo &graph_compiler_info);
void LinkBranchIDArrowForControlActor(ControlActorSet *const control_actor_set);
@@ -89,7 +89,7 @@ class ControlNodeScheduler {
const ControlNodeParserPtr &parser);

// Interface tool to link arrows between actors.
void LinkControlArrow(AbstractActor *from_actor, AbstractActor *to_actor);
void LinkControlArrow(AbstractActor *const from_actor, AbstractActor *to_actor);
void LinkLoopBodyControlArrow(AbstractActor *from_actor, EntranceActor *to_actor);
// Data arrow with branch id is only exists from gather actor to entrance actor.
void LinkDataWithBranchIDArrow(GatherActor *const gather_actor, EntranceActor *const entrance_actor,


+ 0
- 1
mindspore/ccsrc/vm/backend.cc View File

@@ -467,7 +467,6 @@ const ActorInfo &MindRTBackend::CompileGraphs(const FuncGraphPtr &func_graph) {
func_graph_to_kernel_graph_ids_.clear();
control_nodes_.clear();
auto subgraph_need_compile = CompileGraph(root_graph);

// Compile sub graphs.
if (subgraph_need_compile) {
MS_EXCEPTION_IF_NULL(root_graph->manager());


Loading…
Cancel
Save