mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Enable distributed package on windows, Gloo backend supported only (#42897)
Summary: Fixes https://github.com/pytorch/pytorch/issues/42095 For test case part will be committed to this PR later mrshenli, please help to review Pull Request resolved: https://github.com/pytorch/pytorch/pull/42897 Reviewed By: osalpekar Differential Revision: D23841786 Pulled By: mrshenli fbshipit-source-id: 334ba1ed73eff2f668857390fc32d1bc7f08e5f3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c6500bcf14
commit
0122299f9b
@ -6,9 +6,12 @@ except ImportError:
|
||||
import torch._six as six
|
||||
import numbers
|
||||
import os
|
||||
from . import FileStore, TCPStore
|
||||
import sys
|
||||
from . import FileStore
|
||||
from .constants import default_pg_timeout
|
||||
|
||||
if sys.platform != 'win32':
|
||||
from . import TCPStore
|
||||
|
||||
_rendezvous_handlers = {}
|
||||
|
||||
@ -90,6 +93,10 @@ def _file_rendezvous_handler(url, **kwargs):
|
||||
|
||||
result = urlparse(url)
|
||||
path = result.path
|
||||
if sys.platform == 'win32':
|
||||
import urllib.request
|
||||
path = urllib.request.url2pathname(result.path)
|
||||
|
||||
if not path:
|
||||
raise _error("path missing")
|
||||
query = dict(pair.split("=") for pair in filter(None, result.query.split("&")))
|
||||
@ -175,7 +182,8 @@ def _env_rendezvous_handler(url, timeout=default_pg_timeout, **kwargs):
|
||||
# If this configuration is invalidated, there is nothing we can do about it
|
||||
raise RuntimeError("Unable to perform rerendezvous using env:// method")
|
||||
|
||||
if sys.platform != 'win32':
|
||||
register_rendezvous_handler("tcp", _tcp_rendezvous_handler)
|
||||
register_rendezvous_handler("env", _env_rendezvous_handler)
|
||||
|
||||
register_rendezvous_handler("file", _file_rendezvous_handler)
|
||||
register_rendezvous_handler("tcp", _tcp_rendezvous_handler)
|
||||
register_rendezvous_handler("env", _env_rendezvous_handler)
|
||||
|
Reference in New Issue
Block a user