Home
last modified time | relevance | path

Searched refs:sub_graph (Results 1 – 25 of 34) sorted by relevance

12

/third_party/mindspore/mindspore/ccsrc/backend/optimizer/graph_kernel/
Dadd_stitch_atomic_clean_gpu.cc33 CNodePtr StitchAtomicCleanInsertter::CreateInplaceAssignNode(const FuncGraphPtr &sub_graph, in CreateInplaceAssignNode() argument
38 …ode({NewValueNode(prim::kPrimInplaceAssign), new_parameter, atomic_add_node_, out_node}, sub_graph, in CreateInplaceAssignNode()
47 auto sub_graph = AnfAlgo::GetCNodeFuncGraphPtr(composite_node); in ProcessOriginCNode() local
48 auto mng_sub = sub_graph->manager(); in ProcessOriginCNode()
50 mng_sub = Manage(sub_graph, false); in ProcessOriginCNode()
51 sub_graph->set_manager(mng_sub); in ProcessOriginCNode()
60 auto parameter = sub_graph->add_parameter(); in ProcessOriginCNode()
64 auto inplace_assign = CreateInplaceAssignNode(sub_graph, parameter); in ProcessOriginCNode()
78 AddDepend(sub_graph, user_cnode, inplace_assign, pair.first, pair.second); in ProcessOriginCNode()
85 auto old_graph_name = GetValue<std::string>(sub_graph->get_attr(FUNC_GRAPH_ATTR_GRAPH_KERNEL)); in ProcessOriginCNode()
[all …]
Dtsa_atomic_add_to_first_tensor.cc64 auto sub_graph = AnfAlgo::GetCNodeFuncGraphPtr(cnode); in FindTsaFirstRealInputInGraph() local
65 auto mng_sub = sub_graph->manager(); in FindTsaFirstRealInputInGraph()
67 mng_sub = Manage(sub_graph, false); in FindTsaFirstRealInputInGraph()
68 sub_graph->set_manager(mng_sub); in FindTsaFirstRealInputInGraph()
73 auto parameters = sub_graph->parameters(); in FindTsaFirstRealInputInGraph()
187 auto sub_graph = AnfAlgo::GetCNodeFuncGraphPtr(composite_node); in ProcessOriginCNode() local
188 auto mng_sub = sub_graph->manager(); in ProcessOriginCNode()
190 mng_sub = Manage(sub_graph, false); in ProcessOriginCNode()
191 sub_graph->set_manager(mng_sub); in ProcessOriginCNode()
196 …CreateInplaceAssignNodeAndCorrectReturn(sub_graph, sub_graph->parameters()[tsa_first_input_index_]… in ProcessOriginCNode()
[all …]
Dadd_atomic_clean.cc107 auto sub_graph = AnfAlgo::GetCNodeFuncGraphPtr(node); in FindCandidate() local
108 auto mng_sub = sub_graph->manager(); in FindCandidate()
110 mng_sub = Manage(sub_graph, false); in FindCandidate()
111 sub_graph->set_manager(mng_sub); in FindCandidate()
115 auto real_return_node = sub_graph->get_return()->input(kFirstDataInputIndex); in FindCandidate()
271 void AtomicCleanInsertter::CreateInplaceAssignNodeAndCorrectReturn(const FuncGraphPtr &sub_graph, in CreateInplaceAssignNodeAndCorrectReturn() argument
277 auto retrun_node = sub_graph->get_return()->input(kFirstDataInputIndex); in CreateInplaceAssignNodeAndCorrectReturn()
293 …ode({NewValueNode(prim::kPrimInplaceAssign), new_parameter, atomic_add_node_, out_node}, sub_graph, in CreateInplaceAssignNodeAndCorrectReturn()
311 new_out_node = sub_graph->NewCNode(output_args); in CreateInplaceAssignNodeAndCorrectReturn()
315 sub_graph->set_output(new_out_node); in CreateInplaceAssignNodeAndCorrectReturn()
[all …]
Dshape_ops_splitter.cc121 auto sub_graph = AnfAlgo::GetCNodeFuncGraphPtr(anf_node); in Run() local
124 changed = Process(sub_graph); in Run()
Dadd_stitch_atomic_clean_gpu.h37 …CNodePtr CreateInplaceAssignNode(const FuncGraphPtr &sub_graph, const AnfNodePtr &new_parameter) c…
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/opencl/
Dfill_tests.cc84 …auto *sub_graph = new (std::nothrow) kernel::OpenCLSubGraph(kernels, kernels, kernels, sub_inner_k… in TEST_F() local
85 if (sub_graph == nullptr) { in TEST_F()
94 sub_graph->Init(); in TEST_F()
99 sub_graph->Execute(); in TEST_F()
102 delete sub_graph; in TEST_F()
154 …auto *sub_graph = new (std::nothrow) kernel::OpenCLSubGraph(kernels, kernels, kernels, sub_inner_k… in TEST_F() local
155 if (sub_graph == nullptr) { in TEST_F()
164 sub_graph->Init(); in TEST_F()
169 sub_graph->Execute(); in TEST_F()
172 delete sub_graph; in TEST_F()
Dcast_tests.cc117 …auto *sub_graph = new (std::nothrow) kernel::OpenCLSubGraph(kernels, kernels, kernels, sub_inner_k… in TEST_F() local
118 if (sub_graph == nullptr) { in TEST_F()
131 sub_graph->Init(); in TEST_F()
136 sub_graph->Execute(); in TEST_F()
147 delete sub_graph; in TEST_F()
227 …auto *sub_graph = new (std::nothrow) kernel::OpenCLSubGraph(kernels, kernels, kernels, sub_inner_k… in TEST_F() local
228 if (sub_graph == nullptr) { in TEST_F()
241 sub_graph->Init(); in TEST_F()
246 sub_graph->Execute(); in TEST_F()
257 delete sub_graph; in TEST_F()
Dcommon.cc144 auto sub_graph = new (std::nothrow) OpenCLSubGraph(kernels, kernels, kernels, sub_inner_kernel); in TestMain() local
145 if (sub_graph == nullptr) { in TestMain()
152 EXPECT_TRUE(sub_graph->Init() == RET_OK); in TestMain()
156 EXPECT_TRUE(sub_graph->Prepare() == RET_OK); // will set Tensor's allocator be OpenCLAllocator in TestMain()
180 EXPECT_TRUE(sub_graph->Execute() == RET_OK); // will call UnmapBuffer() for input in TestMain()
202 delete sub_graph; in TestMain()
309 auto sub_graph = new (std::nothrow) OpenCLSubGraph(kernels, kernels, kernels, sub_inner_kernel); in TestMain() local
310 if (sub_graph == nullptr) { in TestMain()
317 EXPECT_TRUE(sub_graph->Init() == RET_OK); in TestMain()
321 EXPECT_TRUE(sub_graph->Prepare() == RET_OK); // will set Tensor's allocator be OpenCLAllocator in TestMain()
[all …]
/third_party/mindspore/mindspore/lite/src/
Dlite_model.cc142 auto sub_graph = this->graph_.sub_graphs_[i]; in Destroy() local
143 delete sub_graph; in Destroy()
147 int LiteModel::ConvertSubGraph(const schema::SubGraph &sub_graph) { in ConvertSubGraph() argument
148 …if (sub_graph.name() == nullptr || sub_graph.inputIndices() == nullptr || sub_graph.outputIndices(… in ConvertSubGraph()
149 sub_graph.tensorIndices() == nullptr) { in ConvertSubGraph()
160 subgraph->name_ = sub_graph.name()->c_str(); in ConvertSubGraph()
161 auto in_count = sub_graph.inputIndices()->size(); in ConvertSubGraph()
163 subgraph->input_indices_.push_back(sub_graph.inputIndices()->Get(i)); in ConvertSubGraph()
165 auto out_count = sub_graph.outputIndices()->size(); in ConvertSubGraph()
167 subgraph->output_indices_.push_back(sub_graph.outputIndices()->Get(i)); in ConvertSubGraph()
[all …]
Dlite_model.h237 auto sub_graph = sub_graphs->template GetAs<schema::SubGraph>(i); in GenerateModel() local
238 int ret = ConvertSubGraph(*sub_graph); in GenerateModel()
268 int ConvertSubGraph(const schema::SubGraph &sub_graph);
Dscheduler.cc1134 kernel::SubGraphKernel *sub_graph = nullptr; in CreateSubGraphKernel() local
1136sub_graph = CreateCustomSubGraph(std::move(input_kernels), std::move(output_kernels), kernels, inn… in CreateSubGraphKernel()
1140sub_graph = new (std::nothrow) kernel::OpenCLSubGraph(input_kernels, output_kernels, kernels, inne… in CreateSubGraphKernel()
1141 if (sub_graph == nullptr) { in CreateSubGraphKernel()
1153sub_graph = new (std::nothrow) kernel::CpuFp16SubGraph(input_kernels, output_kernels, kernels, inn… in CreateSubGraphKernel()
1154 if (sub_graph == nullptr) { in CreateSubGraphKernel()
1171sub_graph = new (std::nothrow) kernel::CpuFp32SubGraph(input_kernels, output_kernels, kernels, inn… in CreateSubGraphKernel()
1172 if (sub_graph == nullptr) { in CreateSubGraphKernel()
1178 if (sub_graph == nullptr) { in CreateSubGraphKernel()
1182 sub_graph->set_context(&context); in CreateSubGraphKernel()
[all …]
Dlite_session.cc630 auto sub_graph = reinterpret_cast<kernel::SubGraphKernel *>(kernel); in PrepareKernels() local
631 MS_ASSERT(sub_graph != nullptr); in PrepareKernels()
632 auto kernel_in_subgraph = sub_graph->nodes(); in PrepareKernels()
940 auto sub_graph = reinterpret_cast<kernel::OpenCLSubGraph *>(kernel); in ReSizeKernels() local
941 ret = sub_graph->ReSize(false); in ReSizeKernels()
944 auto sub_graph = reinterpret_cast<kernel::SubGraphKernel *>(kernel); in ReSizeKernels() local
945 ret = sub_graph->ReSize(); in ReSizeKernels()
/third_party/mindspore/mindspore/lite/tools/optimizer/graph/
Dinfershape_pass.cc74 int ModifySubGraphInputCNodeFormat(const FuncGraphPtr &sub_graph, const ParameterPtr &certain_input, in ModifySubGraphInputCNodeFormat() argument
76 MS_ASSERT(sub_graph != nullptr && certain_input != nullptr); in ModifySubGraphInputCNodeFormat()
77 auto manager = sub_graph->manager(); in ModifySubGraphInputCNodeFormat()
234 STATUS InferShapePass::SetSubGraphInput(const CNodePtr &cnode, const FuncGraphPtr &sub_graph) { in SetSubGraphInput() argument
235 MS_ASSERT(cnode != nullptr && sub_graph != nullptr); in SetSubGraphInput()
236 auto sub_inputs = sub_graph->get_inputs(); in SetSubGraphInput()
237 sub_inputs_map_[sub_graph] = sub_inputs; in SetSubGraphInput()
269 if (ModifySubGraphInputCNodeFormat(sub_graph, param_node, format) != lite::RET_OK) { in SetSubGraphInput()
300 STATUS InferShapePass::SetSubGraphOutput(const FuncGraphPtr &sub_graph) { in SetSubGraphOutput() argument
301 MS_ASSERT(sub_graph != nullptr); in SetSubGraphOutput()
[all …]
Dinfershape_pass.h38 STATUS SetSubGraphInput(const CNodePtr &cnode, const FuncGraphPtr &sub_graph);
39 STATUS SetSubGraphOutput(const FuncGraphPtr &sub_graph);
40 STATUS SetSubGraphAbstract(const CNodePtr &cnode, const FuncGraphPtr &sub_graph);
Ddecrease_transpose_algo.h56 int SetSubGraphInput(const CNodePtr &cnode, const FuncGraphPtr &sub_graph);
58 int SetSubGraphOutput(const FuncGraphPtr &sub_graph);
59 int SetSubGraphAbstract(const CNodePtr &cnode, const FuncGraphPtr &sub_graph);
Ddecrease_transpose_algo.cc476 int DecreaseTransposeAlgo::SetSubGraphInput(const CNodePtr &cnode, const FuncGraphPtr &sub_graph) { in SetSubGraphInput() argument
477 MS_ASSERT(cnode != nullptr && sub_graph != nullptr); in SetSubGraphInput()
478 auto sub_inputs = sub_graph->get_inputs(); in SetSubGraphInput()
479 sub_inputs_map_[sub_graph] = sub_inputs; in SetSubGraphInput()
531 auto &sub_graph = iter->first; in ResetSubGraphInput() local
533 auto manager = sub_graph->manager(); in ResetSubGraphInput()
536 auto param_node = sub_graph->add_parameter(); in ResetSubGraphInput()
549 int DecreaseTransposeAlgo::SetSubGraphOutput(const FuncGraphPtr &sub_graph) { in SetSubGraphOutput() argument
550 MS_ASSERT(sub_graph != nullptr); in SetSubGraphOutput()
551 auto return_node = sub_graph->get_return(); in SetSubGraphOutput()
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/trt_pass/
Dgraph_converter.cc127 … const FuncGraphPtr &sub_graph, in BuildTrtNode() argument
130 MS_EXCEPTION_IF_NULL(sub_graph); in BuildTrtNode()
131 auto converter = std::make_shared<TrtConverterContext>(sub_graph); in BuildTrtNode()
152 const AnfNodePtrList &parameters = sub_graph->parameters(); in BuildTrtNode()
197 FuncGraphPtr sub_graph; in ReplaceSubgraphWithTrtNode() local
200 std::tie(sub_graph, args, outputs) = sub_graph_info; in ReplaceSubgraphWithTrtNode()
204 std::tie(anf_trt_index_map, trt_node) = BuildTrtNode(root, sub_graph, args); in ReplaceSubgraphWithTrtNode()
263 const Subgraph &sub_graph = graph_partition->CreateNewGraph(segment.second); in Run() local
264 ret = ReplaceSubgraphWithTrtNode(fg, sub_graph); in Run()
Dgraph_converter.h42 bool ReplaceSubgraphWithTrtNode(const FuncGraphPtr &root_graph, const Subgraph &sub_graph);
46 const FuncGraphPtr &sub_graph,
/third_party/mindspore/mindspore/lite/tools/common/
Dfunc_graph_subgraph.cc477 const FuncGraphPtr &sub_graph, std::vector<AnfNodePtr> *partial_inputs, in CreateParameterForPartialSubGraph() argument
479 MS_ASSERT(sub_graph != nullptr); in CreateParameterForPartialSubGraph()
483 std::string graph_name = sub_graph->get_attr("graph_name")->ToString(); in CreateParameterForPartialSubGraph()
505 auto new_parameter = sub_graph->add_parameter(); in CreateParameterForPartialSubGraph()
518 auto new_parameter = sub_graph->add_parameter(); in CreateParameterForPartialSubGraph()
528 auto new_parameter = sub_graph->add_parameter(); in CreateParameterForPartialSubGraph()
534 sub_graph->AddNode(input); in CreateParameterForPartialSubGraph()
535 input->set_func_graph(sub_graph); in CreateParameterForPartialSubGraph()
545 …const FuncGraphPtr &sub_graph, const std::map<AnfNodePtr, AnfNodePtr> &partial_inputs_and_subgraph… in CreateCNodeForPartialSubGraph() argument
546 MS_ASSERT(sub_graph != nullptr); in CreateCNodeForPartialSubGraph()
[all …]
Dfunc_graph_subgraph.h64 …int CreateParameterForPartialSubGraph(const FuncGraphPtr &sub_graph, std::vector<AnfNodePtr> *part…
66 int CreateCNodeForPartialSubGraph(const FuncGraphPtr &sub_graph,
/third_party/mindspore/mindspore/lite/tools/converter/parser/
Dunused_node_remove_pass.cc46 auto sub_graph = GetValueNode<FuncGraphPtr>(node); in ProcessGraph() local
47 MS_ASSERT(sub_graph != nullptr); in ProcessGraph()
48 auto status = ProcessGraph(sub_graph); in ProcessGraph()
/third_party/mindspore/mindspore/ccsrc/debug/
Danf_ir_dump.cc385 void DumpShape(const AnfNodePtr &nd, const FuncGraphPtr &sub_graph, const std::shared_ptr<SubGraphI… in DumpShape() argument
386 if (nd == nullptr || sub_graph == nullptr || gsub == nullptr) { in DumpShape()
390 if (nd != sub_graph->get_return()) { in DumpShape()
405 void DumpCNode(const CNodePtr &nd, const FuncGraphPtr &sub_graph, OrderedMap<AnfNodePtr, int32_t> *… in DumpCNode() argument
408 if (nd == nullptr || sub_graph == nullptr || para_map == nullptr || gsub == nullptr) { in DumpCNode()
412 if (nd != sub_graph->get_return()) { in DumpCNode()
444 DumpShape(nd, sub_graph, gsub); in DumpCNode()
491 FuncGraphPtr sub_graph = nd->func_graph(); in DumpIRInSubgraph() local
492 if (sub_graph == nullptr) { in DumpIRInSubgraph()
496 std::shared_ptr<SubGraphIRInfo> gsub = (*sub_graphs)[sub_graph]; in DumpIRInSubgraph()
[all …]
Ddraw.cc69 auto sub_graph = nd->func_graph(); in DrawNodes() local
70 if (sub_graph != nullptr) { in DrawNodes()
71 auto gsub = (*sub_graphs)[sub_graph]; in DrawNodes()
74 gsub = std::make_shared<ModelDigraph>(sub_graph->ToString()); in DrawNodes()
76 gsub = std::make_shared<Digraph>(sub_graph->ToString()); in DrawNodes()
78 (*sub_graphs)[sub_graph] = gsub; in DrawNodes()
/third_party/mindspore/mindspore/lite/src/train/
Dtrain_export.cc513 auto sub_graph = std::make_unique<schema::SubGraphT>(); in ExportInit() local
514 if (sub_graph == nullptr) { in ExportInit()
518 sub_graph->name = model_name + "_subgraph"; in ExportInit()
519 meta_graph_->subGraph.emplace_back(std::move(sub_graph)); in ExportInit()
/third_party/mindspore/mindspore/ccsrc/backend/session/
Dascend_auto_monad.cc543 auto &sub_graph = callee.graph; in DoSearchRecursiveCall() local
544 if (sub_graph == ctx->start_caller) { in DoSearchRecursiveCall()
555 if (ctx->visited.find(sub_graph) != ctx->visited.end()) { in DoSearchRecursiveCall()
560 (void)ctx->visited.emplace(sub_graph); in DoSearchRecursiveCall()
562 auto &call_info = context_.call_info_map[sub_graph]; in DoSearchRecursiveCall()
566 DoSearchRecursiveCall(sub_graph, site, ctx); in DoSearchRecursiveCall()
1610 for (auto &sub_graph : sub_graphs) { in GenerateExecuteOrder() local
1611 if (context_.IsVisited(sub_graph)) { in GenerateExecuteOrder()
1615 GenerateGraphOrder(sub_graph); in GenerateExecuteOrder()
1616 AppendGraphOrder(&execution_order, sub_graph); in GenerateExecuteOrder()

12