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

Function GenCompTaskNode

oneflow/core/graph/task_graph.cpp:327–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325} // namespace
326
327CompTaskNode* GenCompTaskNode(
328 const OpNode* op_node, int64_t parallel_id,
329 const std::function<StreamId(const OpNode* op_node, int64_t parallel_id, TaskType task_type)>&
330 GetOrCreateStreamId) {
331 const ParallelDesc& parallel_desc = op_node->parallel_desc();
332 int64_t parallel_num = parallel_desc.parallel_num();
333 CompTaskNode* comp_task_node = NewCompTaskNode4OpNode(op_node);
334 int64_t machine_id = CHECK_JUST(parallel_desc.MachineId4ParallelId(parallel_id));
335 comp_task_node->set_machine_id(machine_id);
336 comp_task_node->mut_parallel_ctx()->set_parallel_id(parallel_id);
337 comp_task_node->mut_parallel_ctx()->set_parallel_num(parallel_num);
338 StreamId stream_id = GetOrCreateStreamId(op_node, parallel_id, comp_task_node->GetTaskType());
339 comp_task_node->set_thrd_id(EncodeStreamIdToInt64(stream_id));
340 comp_task_node->set_op_node(op_node);
341 return comp_task_node;
342}
343
344void GenSortedCompTaskNodes(const OpNode* op_node, std::vector<CompTaskNode*>* sorted_comp_tasks) {
345 int64_t parallel_idx = 0;

Calls 10

NewCompTaskNode4OpNodeFunction · 0.85
EncodeStreamIdToInt64Function · 0.85
MachineId4ParallelIdMethod · 0.80
set_machine_idMethod · 0.80
mut_parallel_ctxMethod · 0.80
set_thrd_idMethod · 0.80
set_op_nodeMethod · 0.80
parallel_descMethod · 0.45
parallel_numMethod · 0.45
GetTaskTypeMethod · 0.45

Tested by

no test coverage detected