Add timeout kwarg to init_process_group (#14435)
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Wed, 28 Nov 2018 19:32:47 +0000 (11:32 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 28 Nov 2018 19:35:01 +0000 (11:35 -0800)
commit0f62af4ab1883cd59f4dfd71945c9755dc138644
tree8de9c6214d5c776d6e0403b4561354bf1b505f8a
parent7c4aef9dfc71c0c79eb0c442a111127793da4611
Add timeout kwarg to init_process_group (#14435)

Summary:
This applies to the gloo backend only. Timeout support for the NCCL and
MPI backends is tracked in issues #14371 and #14372 respectively.

When creating a new process group (either the global one or any subgroup
created through `new_group`) you can specify a timeout keyword
argument (of type datetime.timedelta). This timeout applies to all
collective operations executed against that process group, such that any
operation taking longer than the timeout will throw a runtime error.
Using a different, better catchable error type is tracked in #14433.

This fixes #14376.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14435

Differential Revision: D13234317

Pulled By: pietern

fbshipit-source-id: 973993b67994dc64861c0977cbb6f051ec9d87f6
test/test_distributed.py
torch/distributed/distributed_c10d.py