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

Method InitFromProtoExceptConsumedRegsts

oneflow/core/graph/task_node.cpp:207–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205bool TaskNode::IsMeaningLess() { return produced_regsts_.empty() && consumed_regsts_.empty(); }
206
207void TaskNode::InitFromProtoExceptConsumedRegsts(const TaskProto& task_proto) {
208 // Step1: init some scalar items.
209 CHECK(task_proto.task_type() == GetTaskType());
210 machine_id_ = task_proto.machine_id();
211 thrd_id_ = task_proto.thrd_id();
212 task_id_ = task_proto.task_id();
213 new_task_id_.reset(new TaskId(DecodeTaskIdFromInt64(task_id_)));
214 CHECK(task_proto.job_id() == GlobalJobDesc().job_id());
215 chain_id_ = task_proto.chain_id();
216 order_in_chain_ = task_proto.order_in_chain();
217 // Step2: check exec_gph empty.
218 CHECK(task_proto.exec_sequence().exec_node().empty());
219 // Step3: init produced_regst.
220 for (const auto& pair : task_proto.produced_regst_desc()) {
221 const auto& regst_desc = ProduceRegst(pair.first, pair.second.enable_reuse_mem());
222 // regst_desc->consumers_ will be initialized by RegstDesc::InitConsumersFromProto.
223 regst_desc->InitFromProtoExceptConsumers(pair.second);
224 }
225}
226
227Maybe<void> TaskNode::InitConsumedRegstsFromProto(
228 const TaskProto& task_proto,

Calls 11

DecodeTaskIdFromInt64Function · 0.85
thrd_idMethod · 0.80
machine_idMethod · 0.45
task_idMethod · 0.45
resetMethod · 0.45
job_idMethod · 0.45
chain_idMethod · 0.45
order_in_chainMethod · 0.45
emptyMethod · 0.45
enable_reuse_memMethod · 0.45

Tested by

no test coverage detected