code: def step(self):
      # multi-gpu synchronize gradients
      for param in self.model.parameters():
          if param.requires_grad and param.grad is not None:
              dist.all_reduce(param.grad.data, op=dist.ReduceOp.SUM)
              param.grad.data /= self.ndev
      self.opt.step()
      self.opt.optimizer.zero_grad()
  
imports: import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the MultiGPULossCompute obj's underlying member method code with example usage: obj.step() without return types