/usr/local/lib64/python3.6/site-packages/torch/distributed/__pycache__
NameSizeModeActions
argparse_util.cpython-36.pyc39860644editdlrm
constants.cpython-36.pyc2500644editdlrm
distributed_c10d.cpython-36.pyc1016250644editdlrm
launch.cpython-36.pyc69680644editdlrm
remote_device.cpython-36.pyc36690644editdlrm
rendezvous.cpython-36.pyc79580644editdlrm
run.cpython-36.pyc233170644editdlrm
__init__.cpython-36.pyc17890644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/distributed/__pycache__/rendezvous.cpython-36.pyc (7958B)
3 Eg! @s4yddlmZmZWnek r0edYnXddlZddlZddlZddlmZddl m Z m Z m Z ddl jZddlmZmZmZmZddlmZiad d Zd"eeed d d ZddZedddZedddZedddZ efeedddZ!efeedddZ"ede!ede"ededS)#)urlparse urlunparsezEurllib cannot be found, urlparse from python2 is no longer supported.N) timedelta)DictOptionalUnion) FileStore PrefixStoreStoreTCPStore)default_pg_timeoutcCs"|tkrtdj||t|<dS)aRegisters a new rendezvous handler. Before we can run collective algorithms, participating processes need to find each other and exchange information to be able to communicate. We call this process rendezvous. The outcome of the rendezvous process is a triplet containing a shared key/value store, the rank of the process, and the total number of participating processes. If none of the bundled rendezvous methods apply to your execution environment you can opt to register your own rendezvous handler. Pick a unique name and use the URL scheme to identify it when calling the `rendezvous()` function. Args: scheme (str): URL scheme to identify your rendezvous handler. handler (function): Handler that is invoked when the `rendezvous()` function is called with a URL that uses the corresponding scheme. It must be a generator function that yields the triplet. z/Rendezvous handler for {}:// already registeredN)_rendezvous_handlers RuntimeErrorformat)schemehandlerrH/usr/local/lib64/python3.6/site-packages/torch/distributed/rendezvous.pyregister_rendezvous_handlers r)urlrank world_sizecKs*t|tjs tdjt||t|tjs:tdj|t|tjsTtdj|t|}|dksn|dkrt ddt d|j j dD}d|krd |kst d j|d |dkr||d<|dkr||d <|jd jdjd d|jDd}t|}|jtkrtdj|jt|j|f|S)Nz`url` must be a string. {}: {}z`rank` must be an integer. {}z#`world_size` must be an integer. {}r css|]}|jdVqdS)=N)split).0pairrrr Dszrendezvous..&rrzEThe url: {url} has node-specific arguments(rank, world_size) already.)rz{}cSsg|]\}}dj||qS)z{}={})r)rkvrrr Rszrendezvous..)queryzNo rendezvous handler for {}://r#r#r#) isinstancesixZstring_classesrrtypenumbersIntegralrdictfilterr"rAssertionError_replacejoinitemsrrr)rrrkwargsresultZ query_dictrrr rendezvous6s0     r1cCs td|S)Nz+Error initializing torch.distributed using ) ValueError)msgrrr_rendezvous_error\sr4)rc ksdd}t|}|j}tjdkrPddl}|j|j}|jj|}|rPtjj |}|s\|dt ddt d|j j dD}d |kr|d d |kr|d t|d }t|d } t|| } | || fVtd dS)NcSs td|S)Nzfile:// rendezvous: )r4)r3rrr_errorasz(_file_rendezvous_handler.._errorwin32rz path missingcss|]}|jdVqdS)rN)r)rrrrrrssz+_file_rendezvous_handler..rrzrank parameter missingrzworld size parameter missingz3Unable to perform rerendezvous using file:// method)rpathsysplatformurllib.requestnetlocrequest url2pathnameosnormpathr)r*r"rintrr) rr/r5r0r7urllib full_pathr"rrstorerrr_file_rendezvous_handler`s*         rD)returncCstjjddtdkS)NZTORCHELASTIC_USE_AGENT_STORET)r>environgetstrrrrr_torchelastic_use_agent_storesrIcCsPtr0tjd}t|||d|}td||S|dk}t|||||ddSdS)a Smartly creates a c10d Store object on ``rank`` based on whether we need to re-use agent store. The TCPStore server is assumed to be hosted on ``hostname:port``. If ``torchelastic_use_agent_store()`` is ``True``, then it is assumed that the agent leader (node rank 0) hosts the TCPStore server (for which the endpoint is specified by the given ``hostname:port``). Hence ALL ranks will create and return a TCPStore client (e.g. ``start_daemon=False``). If ``torchelastic_use_agent_store()`` is ``False``, then rank 0 will host the TCPStore (with multi-tenancy) and it is assumed that rank 0's hostname and port are correctly passed via ``hostname`` and ``port``. All non-zero ranks will create and return a TCPStore client. ZTORCHELASTIC_RESTART_COUNTFz/worker/attempt_rT)Z multi_tenantN)rIr>rFr r )hostnameportrrtimeoutattemptZ tcp_storeZ start_daemonrrr_create_c10d_stores rN)rrLc ksdd}t|}|js|dtddtd|jjdD}d|krN|dd |kr^|d t|d}t|d }|jdk stt |j|j|||}|||fVt d dS) NcSs td|S)Nztcp:// rendezvous: )r4)r3rrrr5sz'_tcp_rendezvous_handler.._errorzport number missingcss|]}|jdVqdS)rN)r)rrrrrrsz*_tcp_rendezvous_handler..rrzrank parameter missingrzworld size parameter missingz3Unable to perform re-rendezvous using tcp:// method) rrKr)r*r"rr@rJr+rNr) rrLr/r5r0r"rrrCrrr_tcp_rendezvous_handlers    rOc +sddfddttdfdd }t|}tdd td|jjd D}d |krft|d }n t|d }d |krt|d }n t|d}|d}t|d} t|| |||} | ||fVtddS)NcSs td|S)Nzenv:// rendezvous: )r4)r3rrrr5sz'_env_rendezvous_handler.._errorcs d|S)Nz-environment variable %s expected, but not setr)var)r5rr _env_errorsz+_env_rendezvous_handler.._env_error)env_varrEcs$tjj|d}|s|n|SdS)N)r>rFrG)rRZenv_val)rQrr_get_env_or_raises z2_env_rendezvous_handler.._get_env_or_raisecss|]}|jdVqdS)rN)r)rrrrrrsz*_env_rendezvous_handler..rrZRANKrZ WORLD_SIZEZ MASTER_ADDRZ MASTER_PORTz3Unable to perform re-rendezvous using env:// method) rHrr)r*r"rr@rNr) rrLr/rSr0r"rrZ master_addrZ master_portrCr)rQr5r_env_rendezvous_handlers       rTZtcpenvfiler#r#)r#r#)# urllib.parserr ImportErrorr'r>r8datetimertypingrrrZ torch._sixZ_sixr%Ztorch.distributedrr r r constantsr rrrHr@r1r4rDboolrIrNrOrTrrrrs0    &"-