Commit 68c96f4c authored by Samuel's avatar Samuel
Browse files

Fixed deadlock issue

parent 3fa300b9
...@@ -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