Unverified Commit a7319cee authored by Christian Sarofeen's avatar Christian Sarofeen Committed by GitHub
Browse files

Merge pull request #18 from rotabulo/fix_ddp

Fixed deadlock issue
parents 3fa300b9 68c96f4c
...@@ -3,11 +3,12 @@ from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors ...@@ -3,11 +3,12 @@ from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
import torch.distributed as dist import torch.distributed as dist
from torch.nn.modules import Module from torch.nn.modules import Module
from torch.autograd import Variable from torch.autograd import Variable
from collections import OrderedDict
def flat_dist_call(tensors, call, extra_args=None): def flat_dist_call(tensors, call, extra_args=None):
flat_dist_call.warn_on_half = True flat_dist_call.warn_on_half = True
buckets = {} buckets = OrderedDict()
for tensor in tensors: for tensor in tensors:
tp = tensor.type() tp = tensor.type()
if tp not in buckets: if tp not in buckets:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment