Skip to content

Commit

Permalink
hotfix: use concurrent.futures.Timeout (#8)
Browse files Browse the repository at this point in the history
* hotfix: fix timeout typo

* hotfix: test timeout

* hotfix: set timeout 0.1s
  • Loading branch information
jasperzhong committed Jun 23, 2020
1 parent b261e4b commit f6fd608
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions byteps/mxnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ def __init__(self, params, optimizer, optimizer_params=None, root_rank=0, compre
)
byteps_declare_tensor("gradient_" + str(i), **byteps_params)

def __del__(self):
self._f.close()

def _register_compressor(self, params, optimizer_params, compression_params):
"""Register compressor for BytePS
Expand Down
4 changes: 2 additions & 2 deletions byteps/mxnet/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def decompress(self, tensor, ctx, *args, **kwargs):
try:
self.future.result(timeout=0.1)
tensor += self.cache
except TimeoutError:
print("timeout")
except concurrent.futures.TimeoutError:
print("timeout for wd-momentum")
return self.compressor.decompress(tensor, ctx)


Expand Down

0 comments on commit f6fd608

Please sign in to comment.