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

Method InferBlobDescsByInputs

oneflow/core/graph/exec_graph.cpp:130–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128} // namespace
129
130void ExecNode::InferBlobDescsByInputs(const ParallelContext* parallel_ctx) {
131 auto GetBlobDesc4BnInOp = GetBlobDesc4BnInOpFunc();
132 const OpNode* op_node = Singleton<OpGraph>::Get()->OpNode4OpName(op()->op_name());
133 const NdSbpSignature* nd_sbp_signature = nullptr;
134 if (op_node != nullptr) { nd_sbp_signature = &op_node->nd_sbp_signature(); }
135
136 if (op_node != nullptr && parallel_ctx->parallel_num() > 1 && nd_sbp_signature != nullptr) {
137 CHECK_JUST(CheckPhysicalBlobDesc(
138 *op(), op()->input_bns(),
139 std::bind(&Operator::GetLogicalBlobDesc4Ibn, op().get(), std::placeholders::_1),
140 nd_sbp_signature, parallel_ctx, GetBlobDesc4BnInOp));
141 }
142 CHECK_JUST_MSG(op_->InferBlobDescsIf(GetBlobDesc4BnInOp, parallel_ctx, &GlobalJobDesc()),
143 std::stringstream() << " infer blob descs is failed, op name " << op_->op_loc());
144 if (op_node != nullptr && parallel_ctx->parallel_num() > 1 && nd_sbp_signature != nullptr) {
145 CHECK_JUST(CheckPhysicalBlobDesc(
146 *op(), op()->output_bns(),
147 std::bind(&Operator::GetLogicalBlobDesc4Obn, op().get(), std::placeholders::_1),
148 nd_sbp_signature, parallel_ctx, GetBlobDesc4BnInOp));
149 }
150 CHECK_JUST_MSG(op_->InferInplaceObn2IbnIf(&mut_inplace_obn2ibn_, &con_inplace_obn2ibn_,
151 GetBlobDesc4BnInOp, parallel_ctx),
152 std::stringstream()
153 << " infer inplace obn to ibn is failed, op name " << op_->op_loc());
154}
155
156void ExecNode::InferBlobDescsByNdSbp(const ParallelContext* parallel_ctx) {
157 const HashSet<std::string> ibns{op()->input_bns().begin(), op()->input_bns().end()};

Callers

nothing calls this directly

Calls 9

GetFunction · 0.85
CheckPhysicalBlobDescFunction · 0.85
bindFunction · 0.85
OpNode4OpNameMethod · 0.80
nd_sbp_signatureMethod · 0.80
InferBlobDescsIfMethod · 0.80
InferInplaceObn2IbnIfMethod · 0.80
parallel_numMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected