mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Always build USE_DISTRIBUTED. (#160449)
Signed-off-by: Edward Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/160449 Approved by: https://github.com/wconstab, https://github.com/albanD, https://github.com/dcci
This commit is contained in:
committed by
PyTorch MergeBot
parent
6087ef41e5
commit
de893e96c7
@ -14,16 +14,10 @@ log = logging.getLogger(__name__)
|
||||
|
||||
def is_available() -> bool:
|
||||
"""
|
||||
Return ``True`` if the distributed package is available.
|
||||
|
||||
Otherwise,
|
||||
``torch.distributed`` does not expose any other APIs. Currently,
|
||||
``torch.distributed`` is available on Linux, MacOS and Windows. Set
|
||||
``USE_DISTRIBUTED=1`` to enable it when building PyTorch from source.
|
||||
Currently, the default value is ``USE_DISTRIBUTED=1`` for Linux and Windows,
|
||||
``USE_DISTRIBUTED=0`` for MacOS.
|
||||
Always returns ``True``. Note that even if distributed is available,
|
||||
there may not necessarily be any usable backends.
|
||||
"""
|
||||
return hasattr(torch._C, "_c10d_init")
|
||||
return True
|
||||
|
||||
|
||||
if is_available() and not torch._C._c10d_init():
|
||||
|
Reference in New Issue
Block a user