MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / SetTaskRegstInplaceInfo

Method SetTaskRegstInplaceInfo

oneflow/core/graph/task_graph.cpp:781–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779}
780
781void TaskGraph::SetTaskRegstInplaceInfo(const InplaceObasInfo& obas_info,
782 const HashSet<TaskNode*>& dev_nodes) const {
783 auto TaskNode4SoleOpName = MakeGetterTaskNode4SoleOpName(dev_nodes);
784 auto Op4OpName = [&](const std::string& op_name) -> const Operator* {
785 return TaskNode4SoleOpName(op_name)->exec_gph().SoleNode()->op().get();
786 };
787 InplaceLbiGraph inplace_gph(obas_info, Op4OpName);
788 inplace_gph.ForEachConnectedComponent([&](const HashSet<const InplaceLbiNode*>& inplace_nodes) {
789 for (const auto* inplace_node : inplace_nodes) {
790 if (inplace_node->in_edges().empty()) { continue; }
791 const auto* inplace_edge = inplace_node->SoleInEdge();
792 auto* exec_node = TaskNode4SoleOpName(inplace_edge->op().op_name())->exec_gph().SoleNode();
793 RegstDesc* in_regst = exec_node->RegstDesc4BnInOp(inplace_edge->ibn());
794 RegstDesc* out_regst = exec_node->RegstDesc4BnInOp(inplace_edge->obn());
795 out_regst->set_hint_inplace_consumed_regst_desc_id(in_regst->regst_desc_id());
796 }
797 });
798}
799
800void TaskGraph::ForEachGpuDeviceNodes(
801 const std::function<void(const HashSet<TaskNode*>& dev_nodes)>& Handler) const {

Callers

nothing calls this directly

Calls 10

SoleNodeMethod · 0.80
SoleInEdgeMethod · 0.80
RegstDesc4BnInOpMethod · 0.80
getMethod · 0.45
opMethod · 0.45
emptyMethod · 0.45
regst_desc_idMethod · 0.45

Tested by

no test coverage detected