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

Method BuildExecGphAndRegst

oneflow/core/graph/copy_task_node.cpp:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28void CopyTaskNode::ConsumeAllRegsts() { ConsumeRegst("copy_in", SoleInDataEdge()->GetSoleRegst()); }
29
30void CopyTaskNode::BuildExecGphAndRegst() {
31 auto out_regst = GetProducedRegst("copy_out");
32 auto in_regst = GetSoleConsumedRegst("copy_in");
33 out_regst->CopyBlobDescFrom(in_regst.get());
34 ExecNode* node = mut_exec_gph().NewNode();
35 auto constructed = CHECK_JUST(ConstructOp(NewCopyOpConf()));
36
37 // prevent filling parallel desc for copy commnet
38 if (constructed->op_conf().has_user_conf()) {
39 std::shared_ptr<Shape> hierarchy = std::make_shared<Shape>(Shape({1}));
40 auto parallel_desc =
41 ParallelDesc::New(constructed->op_conf().device_tag(), {"0:0-0"}, hierarchy).GetOrThrow();
42 CHECK_JUST(constructed->FillOpParallelDesc(parallel_desc));
43 }
44
45 node->mut_op() = constructed;
46 node->BindBnWithRegst(node->op()->SoleIbn(), in_regst);
47 node->BindBnWithRegst(node->op()->SoleObn(), out_regst);
48}
49
50void CopyTaskNode::InferProducedDataRegstTimeShape() { NaiveInferProducedDataRegstTimeShape(); }
51

Callers

nothing calls this directly

Calls 11

ConstructOpFunction · 0.85
CopyBlobDescFromMethod · 0.80
NewNodeMethod · 0.80
FillOpParallelDescMethod · 0.80
mut_opMethod · 0.80
BindBnWithRegstMethod · 0.80
ShapeClass · 0.50
NewFunction · 0.50
getMethod · 0.45
GetOrThrowMethod · 0.45
opMethod · 0.45

Tested by

no test coverage detected