MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / make_from_op_node

Function make_from_op_node

imperative/src/impl/ops/collective_comm.cpp:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46std::shared_ptr<OpDef> make_from_op_node(cg::OperatorNodeBase* node) {
47 auto&& comm = node->cast_final_safe<opr::CollectiveComm>();
48 auto&& group_client = comm.group_client();
49 auto [addr, port] = split_address(group_client->get_addr());
50 auto comp_node = node->config().get_single_comp_node().to_string_logical();
51 return std::make_shared<CollectiveComm>(
52 comm.param().mode, comm.key(), comm.nr_devices(), comm.rank(),
53 comm.is_root(), comm.local_grad(), addr, std::stoi(port), comm.dtype(),
54 comm.backend(), comp_node);
55}
56
57OP_TRAIT_REG(CollectiveComm, CollectiveComm, opr::CollectiveComm)
58 .apply_on_var_node(apply_on_var_node)

Callers

nothing calls this directly

Calls 11

split_addressFunction · 0.85
to_string_logicalMethod · 0.80
get_single_comp_nodeMethod · 0.80
backendMethod · 0.80
paramMethod · 0.45
keyMethod · 0.45
nr_devicesMethod · 0.45
rankMethod · 0.45
is_rootMethod · 0.45
local_gradMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected