Home
last modified time | relevance | path

Searched refs:mng (Results 1 – 25 of 90) sorted by relevance

1234

/third_party/mindspore/mindspore/ccsrc/backend/optimizer/graph_kernel/
Dshape_ops_splitter.cc53 void SplitNode(const AnfNodePtr &node, const FuncGraphManagerPtr &mng) { in SplitNode() argument
54 const auto &index_set = mng->node_users()[node]; in SplitNode()
77 bool ShapeOpsSplitter::IsMultiUserShapeOps(const AnfNodePtr &node, const FuncGraphManagerPtr &mng) … in IsMultiUserShapeOps()
78 auto &users = mng->node_users(); in IsMultiUserShapeOps()
88 auto mng = func_graph->manager(); in Process() local
89 if (mng == nullptr) { in Process()
90 mng = Manage(func_graph, true); in Process()
91 func_graph->set_manager(mng); in Process()
97 if (node != nullptr && IsMultiUserShapeOps(node, mng)) { in Process()
98 SplitNode(node, mng); in Process()
[all …]
Doptimize_assign.cc77 auto mng = AnfAlgo::GetCNodeFuncGraphPtr(gk_node)->manager(); in HasPathToParamUser() local
78 MS_EXCEPTION_IF_NULL(mng); in HasPathToParamUser()
95 const FuncGraphManagerPtr &mng) { in KeepExecOrder() argument
110 mng->Replace(getitem, load_node); in KeepExecOrder()
121 auto mng = func_graph->manager(); in UpdateUsersOfGraphKernel() local
122 MS_EXCEPTION_IF_NULL(mng); in UpdateUsersOfGraphKernel()
123 for (const auto &getitem_iter : mng->node_users()[cnode]) { in UpdateUsersOfGraphKernel()
126 …auto getitem_users = mng->node_users()[getitem]; // get a copy of getitem's users before replacing in UpdateUsersOfGraphKernel()
134 mng->Replace(getitem, assign_to); in UpdateUsersOfGraphKernel()
137 KeepExecOrder(func_graph, getitem, assign_to, mng); in UpdateUsersOfGraphKernel()
[all …]
Draise_reduction_precision.cc62 auto mng = reduce_node->func_graph()->manager(); in ReplaceNode() local
63 MS_EXCEPTION_IF_NULL(mng); in ReplaceNode()
65 auto users = mng->node_users()[reduce_node]; in ReplaceNode()
71 if (!(mng->Replace(user_node, reduce_node))) { in ReplaceNode()
83 auto mng = func_graph->manager(); in Process() local
84 if (mng == nullptr) { in Process()
85 mng = Manage(func_graph, true); in Process()
86 func_graph->set_manager(mng); in Process()
100 mng->RemoveRoots(); in Process()
101 mng->KeepRoots({func_graph}); in Process()
[all …]
Deliminate_redundant_output.cc56 bool GetGraphKernelGetitemList(const FuncGraphManagerPtr &mng, const AnfNodePtr &node, AnfNodePtrLi… in GetGraphKernelGetitemList() argument
58 MS_EXCEPTION_IF_NULL(mng); in GetGraphKernelGetitemList()
69 auto users = mng->node_users()[node]; in GetGraphKernelGetitemList()
81 mng->Replace(getitem, (*getitem_list)[idx]); in GetGraphKernelGetitemList()
126 auto mng = func_graph->manager(); in Run() local
127 MS_EXCEPTION_IF_NULL(mng); in Run()
134 GetGraphKernelGetitemList(mng, node, &getitem_list, false); in Run()
188 auto mng = func_graph->manager(); in Run() local
189 MS_EXCEPTION_IF_NULL(mng); in Run()
194 changed = GetGraphKernelGetitemList(mng, node, &getitem_list, true) || changed; in Run()
[all …]
Duss_atomic_add.cc51 auto mng = kernel_graph->manager(); in Run() local
52 if (mng == nullptr) { in Run()
53 mng = Manage(kernel_graph, true); in Run()
54 kernel_graph->set_manager(mng); in Run()
71 InsertAtomicClean(kernel_graph, node, mng); in Run()
76 mng->RemoveRoots(); in Run()
77 mng->KeepRoots({func_graph}); in Run()
Ddecrease_compute_precision.cc82 auto mng = func_graph->manager(); in InsertCastForGraphKernel() local
107 (void)mng->Replace(cur_input, value_node); in InsertCastForGraphKernel()
118 (void)mng->Replace(cur_input, cast); in InsertCastForGraphKernel()
129 auto mng = func_graph->manager(); in Process() local
130 if (mng == nullptr) { in Process()
131 mng = Manage(func_graph, true); in Process()
132 func_graph->set_manager(mng); in Process()
143 (void)mng->Replace(node, in_node); in Process()
153 (void)mng->Replace(node, new_node); in Process()
158 mng->RemoveRoots(); in Process()
[all …]
Dcast_matmul_fusion.cc50 auto mng = func_graph->manager(); in DoFuse() local
51 if (mng == nullptr) { in DoFuse()
52 mng = Manage(func_graph, true); in DoFuse()
53 func_graph->set_manager(mng); in DoFuse()
55 MS_EXCEPTION_IF_NULL(mng); in DoFuse()
82 auto user_index_set = mng->node_users()[cast_node]; in DoFuse()
84 (void)mng->Replace(cast_node, (cast_node->cast<CNodePtr>())->input(1)); in DoFuse()
96 auto mng = func_graph->manager(); in Run() local
97 MS_EXCEPTION_IF_NULL(mng); in Run()
Dupdate_state_formatter.cc83 auto mng = func_graph->manager(); in Run() local
84 MS_EXCEPTION_IF_NULL(mng); in Run()
98 (void)mng->Replace(node, new_node); in Run()
108 auto mng = func_graph->manager(); in Run() local
109 MS_EXCEPTION_IF_NULL(mng); in Run()
127 (void)mng->Replace(node, new_node); in Run()
135 auto mng = func_graph->manager(); in Run() local
136 MS_EXCEPTION_IF_NULL(mng); in Run()
139 GetGraphKernelGetitemList(mng, node, &getitems_, false); in Run()
141 FindIndexesToUpdateState(mng); in Run()
[all …]
Dtsa_atomic_add_to_first_tensor.cc90 auto mng = main_graph->manager(); in ProcessTsaFirstNode() local
91 if (mng == nullptr) { in ProcessTsaFirstNode()
92 mng = Manage(main_graph, true); in ProcessTsaFirstNode()
93 main_graph->set_manager(mng); in ProcessTsaFirstNode()
97 auto users = mng->node_users()[tsa_first_input]; in ProcessTsaFirstNode()
208 const FuncGraphManagerPtr &mng) { in ProcessTsa() argument
223 ProcessOriginCNodeUser(main_graph, origin_composite_node, outter_node, update_state_node, mng); in ProcessTsa()
231 auto mng = kernel_graph->manager(); in Run() local
232 if (mng == nullptr) { in Run()
233 mng = Manage(kernel_graph, true); in Run()
[all …]
Dvalue_graph_binder.cc32 auto mng = func_graph->manager(); in Run() local
33 if (mng == nullptr) { in Run()
34 mng = Manage(func_graph, true); in Run()
35 func_graph->set_manager(mng); in Run()
43 mng->Replace(vptr, new_node); in Run()
Dadd_atomic_clean.cc448 … const FuncGraphManagerPtr &mng, in FindOriginCNodeUsers() argument
452 auto users = mng->node_users()[composite_node]; in FindOriginCNodeUsers()
457 auto users = mng->node_users()[composite_node]; in FindOriginCNodeUsers()
479 for (const auto &[user, index] : mng->node_users()[get_item_cnode]) { in FindOriginCNodeUsers()
485 for (const auto &[user, index] : mng->node_users()[node_index.first]) { in FindOriginCNodeUsers()
495 auto real_users = mng->node_users()[pair.first]; in FindOriginCNodeUsers()
505 … const AnfNodePtr &update_state_node, const FuncGraphManagerPtr &mng) { in ProcessOriginCNodeUser() argument
508 FindOriginCNodeUsers(main_graph, composite_node, mng, true); in ProcessOriginCNodeUser()
529 const FuncGraphManagerPtr &mng) { in InsertAtomicClean() argument
546 …ocessOriginCNodeUser(main_graph, origin_composite_node, broadcast_to_node, update_state_node, mng); in InsertAtomicClean()
[all …]
Drewrite_output_shape.cc42 auto mng = func_graph->manager(); in Run() local
43 MS_EXCEPTION_IF_NULL(mng); in Run()
44 (void)mng->Replace(output, mt_node); in Run()
102 auto mng = func_graph->manager(); in Run() local
103 MS_EXCEPTION_IF_NULL(mng); in Run()
104 (void)mng->Replace(output, output->input(1)); in Run()
Ddecrease_transfer_precision.cc89 auto mng = func_graph->manager(); in Run() local
90 if (mng == nullptr) { in Run()
91 mng = Manage(func_graph, true); in Run()
92 func_graph->set_manager(mng); in Run()
94 auto users_map = mng->node_users(); in Run()
149 auto mng = gk_graph->manager(); in Process_Father() local
150 MS_EXCEPTION_IF_NULL(mng); in Process_Father()
239 auto mng = gk_graph->manager(); in Process_Son() local
240 MS_EXCEPTION_IF_NULL(mng); in Process_Son()
244 auto user_nodes = mng->node_users()[old_input]; in Process_Son()
[all …]
Dinsert_pad.cc149 …(const CNodePtr &matmul, const FuncGraphPtr &func_graph, const FuncGraphManagerPtr &mng, bool left, in InsertPad() argument
185 …InsertUnpad(const CNodePtr &matmul, const FuncGraphPtr &func_graph, const FuncGraphManagerPtr &mng, in InsertUnpad() argument
210 (void)mng->Replace(matmul, unpad_cnode); in InsertUnpad()
234 auto mng = func_graph->manager(); in InsertPadUnpad() local
235 MS_EXCEPTION_IF_NULL(mng); in InsertPadUnpad()
247 InsertPad(mm_cnode, func_graph, mng, true, pad_shape_a, tail_shape_a); in InsertPadUnpad()
250 InsertPad(mm_cnode, func_graph, mng, false, pad_shape_b, tail_shape_b); in InsertPadUnpad()
254 InsertUnpad(mm_cnode, func_graph, mng, unpad_shape, tail_shape_unpad); in InsertPadUnpad()
274 auto mng = func_graph->manager(); in Run() local
275 if (mng == nullptr) { in Run()
[all …]
Dadd_stitch_atomic_clean_gpu.cc130 auto mng = kernel_graph->manager(); in Run() local
131 if (mng == nullptr) { in Run()
132 mng = Manage(kernel_graph, true); in Run()
133 kernel_graph->set_manager(mng); in Run()
141 InsertAtomicClean(kernel_graph, node, mng); in Run()
147 UpdateMng(mng, func_graph); in Run()
Dgraph_kernel_helper.cc69 AnfNodePtrList EliminateMakeTuple(const FuncGraphPtr &fg, const FuncGraphManagerPtr &mng) { in EliminateMakeTuple() argument
87 mng->Replace(out_node, new_out); in EliminateMakeTuple()
223 auto mng = fg->manager(); in ConvertNonscalarTensorToParameter() local
224 if (mng == nullptr) { in ConvertNonscalarTensorToParameter()
225 mng = Manage(fg, false); in ConvertNonscalarTensorToParameter()
226 fg->set_manager(mng); in ConvertNonscalarTensorToParameter()
241 mng->Replace(value_node, parameter); in ConvertNonscalarTensorToParameter()
259 FuncGraphManagerPtr mng = fg->manager(); in MixedNodesTransToGraph() local
260 if (mng == nullptr) { in MixedNodesTransToGraph()
261 mng = Manage(fg, false); in MixedNodesTransToGraph()
[all …]
Dadd_atomic_clean.h84 …lean(const KernelGraphPtr &main_graph, const AnfNodePtr &anf_node, const FuncGraphManagerPtr &mng);
90 const FuncGraphManagerPtr &mng);
99 const FuncGraphManagerPtr &mng,
102 const FuncGraphManagerPtr &mng);
Dreorder_ops.cc203 …Ops::ReorderTypeInsensitiveCastDown(const FuncGraphPtr &func_graph, const FuncGraphManagerPtr &mng, in ReorderTypeInsensitiveCastDown() argument
223 mng->node_users()[type_insens_node].size() > 1) { in ReorderTypeInsensitiveCastDown()
255 (void)mng->Replace(node, new_type_insens_node); in ReorderTypeInsensitiveCastDown()
259 …erOps::ReorderCastUpTypeInsensitive(const FuncGraphPtr &func_graph, const FuncGraphManagerPtr &mng, in ReorderCastUpTypeInsensitive() argument
278 mng->node_users()[cast_node].size() == 1) { in ReorderCastUpTypeInsensitive()
319 (void)mng->Replace(node, new_cast_node); in ReorderCastUpTypeInsensitive()
329 auto mng = GetFuncGraphManager(func_graph); in ReorderCastTypeInsensitive() local
340 changed = ReorderCastUpTypeInsensitive(func_graph, mng, node) || changed; in ReorderCastTypeInsensitive()
343 changed = ReorderTypeInsensitiveCastDown(func_graph, mng, node) || changed; in ReorderCastTypeInsensitive()
/third_party/mindspore/tests/ut/cpp/ir/
Dmanager_test.cc246 void CheckAnalysisSize(std::shared_ptr<FuncGraphManager> mng);
344 void TestManager::CheckAnalysisSize(std::shared_ptr<FuncGraphManager> mng) { in CheckAnalysisSize() argument
345 auto size = mng->func_graphs().size(); in CheckAnalysisSize()
347 ASSERT_EQ(size, mng->free_variables_total().size()); in CheckAnalysisSize()
353 auto mng = Manage(func_graph); in TEST_F() local
373 auto mng = Manage(func_graph); in TEST_F() local
375 mng->Replace(cnode_add, x); in TEST_F()
383 auto mng = Manage(f); in TEST_F() local
385 ASSERT_EQ(6, mng->all_nodes().size()); in TEST_F()
386 ASSERT_EQ(2, mng->func_graphs().size()); in TEST_F()
[all …]
/third_party/mindspore/mindspore/ccsrc/frontend/optimizer/
Drecompute.cc81 std::vector<CNodePtr> FindCandidateRecomputedNodes(const FuncGraphManagerPtr &mng, in FindCandidateRecomputedNodes() argument
83 MS_EXCEPTION_IF_NULL(mng); in FindCandidateRecomputedNodes()
91 const auto &node_users = mng->node_users(); in FindCandidateRecomputedNodes()
111 void GetMaxSubGraph(const FuncGraphManagerPtr &mng, std::unordered_set<CNodePtr> *recomputed_nodes,… in GetMaxSubGraph() argument
113 MS_EXCEPTION_IF_NULL(mng); in GetMaxSubGraph()
142 const auto &node_users = mng->node_users(); in GetMaxSubGraph()
162 void GetOriginRecomputeAndTargetNodes(const FuncGraphManagerPtr &mng, in GetOriginRecomputeAndTargetNodes() argument
166 MS_EXCEPTION_IF_NULL(mng); in GetOriginRecomputeAndTargetNodes()
169 const auto &node_users = mng->node_users(); in GetOriginRecomputeAndTargetNodes()
241 bool HasForwardOutput(const FuncGraphManagerPtr &mng, const AnfNodePtr &node) { in HasForwardOutput() argument
[all …]
Dgraph_transform.h42 FuncGraphPtr operator()(const FuncGraphPtr &fg, const FuncGraphManagerPtr &mng) { in operator()
46 auto new_fg = TransformGraphParam(fg, mng); in operator()
71 FuncGraphPtr TransformGraphParam(const FuncGraphPtr &fg, const FuncGraphManagerPtr &mng) { in TransformGraphParam() argument
99 mng->AddFuncGraph(new_fg); in TransformGraphParam()
/third_party/mindspore/mindspore/core/ir/
Dfunc_graph.cc311 auto mng = manager_.lock(); in free_variables_total() local
312 MS_EXCEPTION_IF_NULL(mng); in free_variables_total()
313 auto &fv_total = mng->free_variables_total(); in free_variables_total()
381 auto mng = manager_.lock(); in func_graphs_used_total() local
382 MS_EXCEPTION_IF_NULL(mng); in func_graphs_used_total()
383 auto &used = mng->func_graphs_used_total(shared_from_base<FuncGraph>()); in func_graphs_used_total()
465 auto mng = manager_.lock(); in parent() local
466 MS_EXCEPTION_IF_NULL(mng); in parent()
467 return mng->parent(shared_from_base<FuncGraph>()); in parent()
471 auto mng = manager_.lock(); in children() local
[all …]
/third_party/mindspore/mindspore/ccsrc/frontend/optimizer/irpass/
Dspecialize_transform.h51 auto mng = func_graph->manager(); in operator() local
52 MS_EXCEPTION_IF_NULL(mng); in operator()
54 mng->AddFuncGraph(new_fg); in operator()
64 mng->Replace(params[i], NewReplaceValueNode(need_eliminate_args[i])); in operator()
66 mng->SetParameters(new_fg, new_params); in operator()
Dinline.h181 auto mng = fg->manager(); in InlineMove() local
182 MS_EXCEPTION_IF_NULL(mng); in InlineMove()
183 ReplaceParams(mng, args, fg); in InlineMove()
185 mng->MoveAllCNodeDropGraph(fg, node->func_graph(), inputs[0]->scope()); in InlineMove()
223 void ReplaceParams(const FuncGraphManagerPtr &mng, const std::vector<AnfNodePtr> &new_params, in ReplaceParams() argument
232 (void)mng->Replace(params[i], new_params[i]); in ReplaceParams()
255 auto mng = fg->manager(); in SimplifyAfterParameter() local
256 MS_EXCEPTION_IF_NULL(mng); in SimplifyAfterParameter()
259 if (mng->node_users()[fg_params[i]].size() != 0) { in SimplifyAfterParameter()
/third_party/mindspore/mindspore/ccsrc/frontend/optimizer/ad/
Ddfunctor.h173 void TransformArgsForPrimitive(const FuncGraphManagerPtr &mng, const FuncGraphPtr &bprop_fg,
177 void TransformArgsForFuncGraph(const FuncGraphManagerPtr &mng, const FuncGraphPtr &bprop_fg,
233 auto mng = Manage({cloned_bprop_fg, outer}, false); in BpropToK() local
246 TransformArgsForPrimitive(mng, cloned_bprop_fg, primal, outer, &transf_args); in BpropToK()
249 TransformArgsForFuncGraph(mng, cloned_bprop_fg, current_primal_fg, outer, &transf_args); in BpropToK()
262 (void)mng->Replace(out_param, out_value); in BpropToK()
266 (void)mng->Replace(dout, new_dout); in BpropToK()

1234