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

Class _RemoteSend

imperative/python/megengine/distributed/functional.py:793–806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

791
792
793class _RemoteSend(Function):
794 def __init__(self, op: RemoteSend):
795 self.op = op
796
797 def forward(self, data):
798 self.device = str(data.device)
799 (self.dummy,) = apply(self.op, data)
800 return self.dummy
801
802 def backward(self, grad):
803 assert grad is None
804 has_grad = get_client().bcast_val(None, self.op.key, 2)
805 if has_grad:
806 return remote_recv(self.op.rank_to, device=self.device, inp=self.dummy,)
807
808
809class _RemoteRecv(Function):

Callers 1

remote_sendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected