+
    –°³j±A  ã                   ó~  € ^ RI t ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIH	t	 ^ RI
t
^ RIHu Hu Hu Ht ^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHtHt ^ R	IHtHtHt ^ R
I H!t!H"t"H#t# ^ RI$H%t% ^ RI&H't' ^ RI(H)t) ^ RI*H+t+ ^ RI,H-t- . ROt.]+! ]/4      t0] ! R R4      4       t1 ! R R4      t2R R lt3R R lt4RR R llt5R# )é    N)ÚCallable)Ú	dataclassÚfield)ÚAny)Úget_default_numa_optionsÚjustknobs_check)ÚeventsÚmetrics)Ú
WorkerSpec)Úcreate_healthcheck_serverÚHealthCheckServer)Ú_AliveCallbackProxyÚLocalElasticAgentÚTORCHELASTIC_HEALTH_CHECK_PORT)ÚDefaultLogsSpecsÚ	LogsSpecsÚSignalException)ÚChildFailedError)ÚRendezvousParameters)Úparse_rendezvous_endpoint)Ú
get_logger)ÚNumaOptionsÚLaunchConfigÚelastic_launchc                   ó¢   a € ] tR t^/t o RtRtRtRtRtRt	]
! ]R7      tRt^tRtRtRt]
! ]R7      tRtR	tRtR
tRtRtRtRtR tV 3R ltRtV tR# )r   aÞ  
Creates a rendezvous config.

Args:
    min_nodes: Minimum amount of nodes that the user function will
                    be launched on. Elastic agent ensures that the user
                    function start only when the min_nodes amount enters
                    the rendezvous.
    max_nodes: Maximum amount of nodes that the user function
                    will be launched on.
    nproc_per_node: On each node the elastic agent will launch
                        this amount of workers that will execute user
                        defined function.
    rdzv_backend: rdzv_backend to use in the rendezvous (zeus-adapter, etcd).
    rdzv_endpoint: The endpoint of the rdzv sync. storage.
    rdzv_configs: Key, value pair that specifies rendezvous specific configuration.
    rdzv_timeout: Legacy argument that specifies timeout for the rendezvous. It is going
        to be removed in future versions, see the note below. The default timeout is 900 seconds.
    run_id: The unique run id of the job (if not passed a unique one will be
            deduced from run environment - flow workflow id in flow - or auto generated).
    role: User defined role of the worker (defaults to "trainer").
    max_restarts: The maximum amount of restarts that elastic agent will conduct
                on workers before failure.
    monitor_interval: The interval in seconds that is used by the elastic_agent
                    as a period of monitoring workers.
    start_method: The method is used by the elastic agent to start the
                workers (spawn, fork, forkserver).
    metrics_cfg: configuration to initialize metrics.
    local_addr: address of the local node if any. If not set, a lookup on the local
            machine's FQDN will be performed.
    local_ranks_filter: ranks for which to show logs in console. If not set, show from all.
    event_log_handler: name of the event logging handler as registered in
      `elastic/events/handlers.py <https://docs.pytorch.org/docs/stable/elastic/events.html>`_.
    duplicate_stdout_filters: If non-empty, duplicates stdout to a file containing only lines
                            that match _any_ of the filter strings.
    duplicate_stderr_filters: If non-empty, duplicates stderr to a file containing only lines
                            that match _any_ of the filter strings.
    virtual_local_rank: Enable virtual local rank mode for workers (defaults to False).
                       When enabled, LOCAL_RANK is set to 0 for all workers and
                       CUDA_VISIBLE_DEVICES is adjusted so each worker accesses its
                       assigned GPU at device index 0.
    shutdown_timeout: Time in seconds to wait for graceful shutdown of workers before
                    sending SIGKILL. Can also be set via TORCH_ELASTIC_SHUTDOWN_TIMEOUT
                    environment variable. Defaults to 30 seconds.


.. note::
    `rdzv_timeout` is a legacy argument that will be removed in future.
    Set the timeout via `rdzv_configs['timeout']`

NÚ Údefault_roleÚetcd)Údefault_factorygš™™™™™¹?ÚspawnÚnullzSIGTERM,SIGINT,SIGHUP,SIGQUITFc                óú  € R pV P                   R8w  d   V P                   V P                  R&   MRV P                  9  d   WP                  R&   V P                  f   \        4       V n        V P                  fŠ    \
        P                  P                  4       ;'       d,    \
        P                  P                  4       V P                  8H  pV'       d0   \        4       V n        \        P                  RV P                  4       V P                  f1   \        \         P"                  P%                  RR4      4      V n        R# V P                  ^ 8  d   \'        RV P                   24      hR#   \         d    Rp L¯i ; i)	i„  ÚtimeoutNFzUsing default numa options = %rÚTORCH_ELASTIC_SHUTDOWN_TIMEOUTÚ30z+shutdown_timeout must be non-negative, got éÿÿÿÿ)Úrdzv_timeoutÚrdzv_configsÚ
logs_specsr   Únuma_optionsÚtorchÚacceleratorÚis_availableÚdevice_countÚnproc_per_nodeÚRuntimeErrorr   ÚloggerÚinfoÚshutdown_timeoutÚintÚosÚenvironÚgetÚ
ValueError)ÚselfÚdefault_timeoutÚshould_use_default_numas   &  Ú_/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributed/launcher/api.pyÚ__post_init__ÚLaunchConfig.__post_init__}   sK  € ØˆØ×Ñ Ô"Ø+/×+<Ñ+<ˆD×Ñ˜iÒ(Ø˜d×/Ñ/Ô/Ø+:×Ñ˜iÑ(ð �?‰?Ò"Ü.Ó0ˆDŒOà×ÑÒ$ð0ä×%Ñ%×2Ñ2Ó4÷ Pð PÜ×)Ñ)×6Ñ6Ó8¸D×<OÑ<OÑOð (÷ 'Ü$<Ó$>�Ô!Ü—‘Ð=¸t×?PÑ?PÔQð × Ñ Ò(Ü$'Ü—
‘
—‘Ð?ÀÓFó%ˆDÖ!ð ×"Ñ" QÔ&ÜØ=¸d×>SÑ>SÐ=TÐUóð ñ 'øô  ô 0Ø*/Ò'ð0ús   Á9$E* Â,E* Å*E:Å9E:c                óÜ  <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[R,          ;R&   S[;R&   S[;R&   S[;R&   S[;R	&   S[S[S[3,          ;R
&   S[ ;R&   S[ ;R&   S[;R&   S[;R&   S[R,          ;R&   S[S[S[3,          ;R&   S[R,          ;R&   S[;R&   S[R,          ;R&   S[;R&   S[S[,          R,          ;R&   S[S[,          R,          ;R&   S[;R&   S[ R,          ;R&   # )é   Ú	min_nodesÚ	max_nodesr/   Nr)   Úrun_idÚroleÚrdzv_endpointÚrdzv_backendr(   r'   Úmax_restartsÚmonitor_intervalÚstart_methodÚlog_line_prefix_templateÚmetrics_cfgÚ
local_addrÚevent_log_handlerr*   Úsignals_to_handleÚduplicate_stdout_filtersÚduplicate_stderr_filtersÚvirtual_local_rankr3   )	r4   r   ÚstrÚdictr   Úfloatr   ÚlistÚbool)ÚformatÚ__classdict__s   "€r<   Ú__annotate__ÚLaunchConfig.__annotate__/   s”  ø‡ ‚ ñl �Nñm ñn �Nño ñp Ññq ñr ˜DÕ Ñ'ñs ñt Ññu ñv Ññw ñx Ññy ñz Ññ{ ñ| ‘s™C�x•.Ñ>ñ} ñ~ Ññ ñ@ ÑñA ñB Ñ!ñC ñD ÑñE ñF " D�jÑ/ñG ñH ‘c™3�h•Ñ=ñI ñJ �d•
Ñ!ñK ñL Ñ#ñM ñN  Õ$Ñ+ñO ñP Ñ<ñQ ñR #¡3�i¨$Õ.Ñ5ñS ñT #¡3�i¨$Õ.Ñ5ñU ñV Ñ$ñW ñX ˜D•jÑ'òY ó    )r)   r*   r3   r&   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r)   rC   rD   rE   rF   r   rS   r(   r'   rG   rH   rI   rJ   rK   rL   rM   r*   rN   rO   rP   rQ   r3   r=   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©rX   s   @r<   r   r   /   s�   ø‡ € ñ2ðn $(€JØ€FØ€DØ€MØ€LÙ#(¸Ô#>€LØ€LØ€LØ!ÐØ€LØ+/ÐÙ"'¸Ô"=€KØ!€JØ#ÐØ'+€LØ<ÐØ15ÐØ15ÐØ$ÐØ#'Ðò÷] ƒ r[   c                   ó@   a € ] tR t^Ÿt o RtRV 3R lR lltR tRtV tR# )r   aÏ  
Launches a torchelastic agent on the container that invoked the entrypoint.

    1. Pass the ``entrypoint`` arguments as non ``kwargs`` (e.g. no named parameters)/
       ``entrypoint`` can be a function or a command.
    2. The return value is a map of each worker's output mapped
       by their respective global rank.

Usage

::

def worker_fn(foo):
    # ...

def main():
    # entrypoint is a function.
    outputs = elastic_launch(LaunchConfig, worker_fn)(foo)
    # return rank 0's output
    return outputs[0]

    # entrypoint is a command and ``script.py`` is the python module.
    outputs = elastic_launch(LaunchConfig, "script.py")(args)
    outputs = elastic_launch(LaunchConfig, "python")("script.py")
Nc                óX   <€ V ^8„  d   QhRS[ RS[S[,          R,          RS[R,          /# )r@   ÚconfigÚ
entrypointNÚhealth_check_server)r   r   rR   r   )rW   rX   s   "€r<   rY   Úelastic_launch.__annotate__º   s7   ø€ ÷ 8ñ 8áð8ñ ™s•N TÕ)ð8ñ /°Õ5ñ	8r[   c                ó*   € Wn         W n        W0n        R # ©N©Ú_configÚ_entrypointÚ_health_check_server)r9   rg   rh   ri   s   &&&&r<   Ú__init__Úelastic_launch.__init__º   s   € ð ŒØ%ÔØ$7Ö!r[   c                ón   € \        V P                  V P                  \        V4      V P                  R 7      # ))ri   )Úlaunch_agentrn   ro   rU   rp   )r9   Úargss   &*r<   Ú__call__Úelastic_launch.__call__Ä   s/   € ÜØ�L‰LØ×ÑÜ�‹JØ $× 9Ñ 9ô	
ð 	
r[   rm   rl   )	r\   r]   r^   r_   r`   rq   rv   rb   rc   rd   s   @r<   r   r   Ÿ   s   ø‡ € ñ÷48ò 8÷
ð 
r[   c                óv   € V ^8„  d   QhR\         \        ,          R,          R\        \        ,          R\        /# )r@   rh   Nru   Úreturn)r   rR   rU   r   )rW   s   "r<   rY   rY   Í   s/   € ÷ ñ ¤X´¥^°dÕ%:ð Ä$ÄsÅ)ð ÔPSñ r[   c                óÊ   € \        V \        4      '       d   V P                  # \        V \        4      '       d+   V \        P
                  8X  d   \        R V 4       R4      # V # R# )a¥  Retrieve entrypoint name with the rule:
1. If entrypoint is a function, use ``entrypoint.__qualname__``.
2. If entrypoint is a string, check its value:
    2.1 if entrypoint equals to ``sys.executable`` (like "python"), use the first element from ``args``
        which does not start with hyphen letter (for example, "-u" will be skipped).
    2.2 otherwise, use ``entrypoint`` value.
3. Otherwise, return empty string.
c              3   óD   "  € T F  q^ ,          R8w  g   K  Vx € K  	  R# 5i)r   Ú-N© )Ú.0Úargs   & r<   Ú	<genexpr>Ú'_get_entrypoint_name.<locals>.<genexpr>Ú   s   é € Ð>© °Aµ¸#±Ÿš«ùs   ‚ –
 r   )Ú
isinstancer   r\   rR   ÚsysÚ
executableÚnext)rh   ru   s   &&r<   Ú_get_entrypoint_namer†   Í   sR   € ô �*œh×'Ò'Ø×"Ñ"Ð"Ü	�J¤×	$Ò	$ØœŸ™Ô'ÜÑ>©Ó>ÀÓCÐCàÐár[   c                ón   € V ^8„  d   QhR\         R\        \        R,          \        R,          3,          /# )r@   Úrdzv_parametersry   N)r   ÚtuplerR   r4   )rW   s   "r<   rY   rY   á   s.   € ÷ &ñ &Ü)ð&ä
Œ3��:”s˜T•zÐ!Õ"ñ&r[   c                 óÖ   € V P                   R 8w  d   R# V P                  pVP                  4       pV'       g   \        R4      h\	        VRR7      w  r#VR8X  d   \        RV R24      hW#3# )ÚstaticzKEndpoint is missing in endpoint. Try to add --master-addr and --master-port)Údefault_portzport is missing in endpoint: z. Try to specify --master-port)NNr&   )ÚbackendÚendpointÚstripr8   r   )rˆ   rŽ   Úmaster_addrÚmaster_ports   &   r<   Ú_get_addr_and_portr’   á   s�   € ð ×Ñ (Ô*ØÐØ×'Ñ'€HØ�~‰~Ó€HßÜØYó
ð 	
ô  9¸ÐPRÔSÑ€KØ�bÔÜØ+¨H¨:Ð5SÐTó
ð 	
ð Ð%Ð%r[   c                ó¾   € V ^8„  d   QhR\         R\        \        ,          R,          R\        \        ,          R\
        R,          R\        \        \        3,          /# )r@   rg   rh   Nru   ri   ry   )r   r   rR   rU   r   r   rS   r4   )rW   s   "r<   rY   rY   ô   s[   € ÷ b)ñ b)Üðb)äœ3• Õ%ðb)ô Œs�)ðb)ô +¨TÕ1ð	b)ô
 
Œ#Œsˆ(…^ñb)r[   c                 ó.
  € V P                   '       gE   \        \        P                  ! 4       P                  4      p\
        P                  R V4       W@n         \        W4      p\
        P                  R/ RVbRV P                  bRV P                  bRV P                  bRV P                   bRV P                  bRV P                  bR	V P                  bR
V P                  bRV P                   bRV P"                  P$                  bRV P&                  bRV P(                  bRV P*                  bRV P,                  bRV P.                  bRV P0                  b4       \3        R#RV P                  RV P                  RV P                   RV P                  RV P                  RV P4                  /V P                  B p\7        V4      w  rxV P,                  \8        P:                  R&   Vfx   \8        P<                  ! \>        4      p	V	eZ   \A        RRR7      '       dG    \C        \E        4       \	        V	4      ^<R7      pVPG                  4        \
        P                  RV	4       \K        V PL                  V P                  V\O        V4      \P        PR                  ! V4      V P                  V P                   VVV P4                  V P(                  V P*                  V P.                  V P0                  V PT                  R 7      p
\W        V
V P"                  V PX                  V PZ                  V P\                  VR!7      pVe>   VP^                  p\a        V\D        4      '       d   VPc                  VPd                  4       Rp \f        Ph                  ! \f        Pj                  ! V P&                  4      4       VPm                  4       p\n        Pp                  ! VPs                  4       V P(                  4       VPu                  4       '       d   \w        VVPx                  R"7      hVPz                  V'       d   V
P|                  P                  4        # #   \H         d    \
        P                  RRR7       Rp ELi ; i  \v         d    h \€         d4    Rp\n        Pp                  ! TPƒ                  4       T P(                  4       h \H         d2    \n        Pp                  ! TPƒ                  4       T P(                  4       h i ; i  T'       d   T
P|                  P                  4        i i ; i)$z3config has no run_id, generated a random run_id: %saR  Starting elastic_operator with launch configs:
  entrypoint               : %(entrypoint)s
  min_nodes                : %(min_nodes)s
  max_nodes                : %(max_nodes)s
  nproc_per_node           : %(nproc_per_node)s
  run_id                   : %(run_id)s
  rdzv_backend             : %(rdzv_backend)s
  rdzv_endpoint            : %(rdzv_endpoint)s
  rdzv_configs             : %(rdzv_configs)s
  max_restarts             : %(max_restarts)s
  monitor_interval         : %(monitor_interval)s
  log_dir                  : %(log_dir)s
  metrics_cfg              : %(metrics_cfg)s
  event_log_handler        : %(event_log_handler)s
  numa_options             : %(numa_options)s
  signals_to_handle        : %(signals_to_handle)s
  duplicate_stdout_filters : %(duplicate_stdout_filters)s
  duplicate_stderr_filters : %(duplicate_stderr_filters)s
rh   rA   rB   r/   rC   rF   rE   r(   rG   rH   Úlog_dirrK   rM   r*   rN   rO   rP   r�   rŽ   rL   ÚTORCHELASTIC_SIGNALS_TO_HANDLENzNai_infra/pytorch_distributed:torchelastic_enable_healthcheck_before_rendezvousF)Údefault)Úalive_callbackÚportr#   z>Started early health check server on port %s before rendezvousz)Failed to start early health check serverT)Úexc_info)rD   Úlocal_world_sizerh   ru   Úrdzv_handlerrG   rH   r�   r‘   rL   rM   r*   rO   rP   rQ   )Úspecr)   rI   rJ   r3   ri   )ÚnameÚfailuresr}   )BrC   rR   ÚuuidÚuuid4r4   r1   Úwarningr†   r2   rA   rB   r/   rF   rE   r(   rG   rH   r)   Úroot_log_dirrK   rM   r*   rN   rO   rP   r   rL   r’   r5   r6   Úgetenvr   r   r   r   ÚstartÚ	Exceptionr   rD   r‰   Úrdzv_registryÚget_rendezvous_handlerrQ   r   rI   rJ   r3   r˜   r‚   Úset_delegateÚ_get_alive_timer
   Úinitialize_metricsÚMetricsConfigÚrunr	   ÚrecordÚget_event_succeededÚ	is_failedr   rŸ   Úreturn_valuesrœ   Úshutdownr   Úget_event_failed)rg   rh   ru   ri   rC   Úentrypoint_namerˆ   r�   r‘   Úhealthcheck_portr�   ÚagentÚcbÚshutdown_rdzvÚresults   &&&&           r<   rt   rt   ô   sÖ  € ð �=�=ˆ=Ü”T—Z’Z“\×%Ñ%Ó&ˆÜ�‰ÐLÈfÔUØŒä*¨:Ó<€Oä
‡K�Kð	Fð$	
Ø˜/ð	
à˜×)Ñ)ð	
ð ˜×)Ñ)ð	
ð ˜f×3Ñ3ð		
ð
 �f—m‘mð	
ð ˜F×/Ñ/ð	
ð ˜V×1Ñ1ð	
ð ˜F×/Ñ/ð	
ð ˜F×/Ñ/ð	
ð  × 7Ñ 7ð	
ð �v×(Ñ(×5Ñ5ð	
ð ˜6×-Ñ-ð	
ð   ×!9Ñ!9ð	
ð ˜F×/Ñ/ð	
ð   ×!9Ñ!9ð	
ð  '¨×(GÑ(Gð!	
ð" '¨×(GÑ(Gð#	
ô'&ôP +ñ Ø×#Ñ#ðà×%Ñ%ðð �}‰}ðð ×"Ñ"ð	ð
 ×"Ñ"ðð ×$Ñ$ðð ×
Ñ
ñ€Oô  2°/ÓBÑ€Kð 4:×3KÑ3K„B‡J�JÐ/Ñ0ð Ò"ÜŸ9š9Ô%CÓDÐØÒ'¬OØ\Ø÷-
ó -
ð+Ü&?Ü#6Ó#8ÜÐ-Ó.Øô'Ð#ð
 $×)Ñ)Ô+Ü—‘ØTØ$ôô Ø�[‰[Ø×.Ñ.ØÜ�4‹[Ü"×9Ò9¸/ÓJØ×(Ñ(Ø×0Ñ0ØØØ×$Ñ$Ø ×2Ñ2Ø×(Ñ(Ø!'×!@Ñ!@Ø!'×!@Ñ!@Ø!×4Ñ4ô€Dô$ ØØ×$Ñ$Ø×(Ñ(Ø!'×!@Ñ!@Ø×0Ñ0Ø/ô€Eð Ò&Ø ×/Ñ/ˆÜ�bÔ-×.Ò.Ø�O‰O˜E×1Ñ1Ô2à€Mð )Ü×"Ò"¤7×#8Ò#8¸×9KÑ9KÓ#LÔMà—‘“ˆä�Š�e×/Ñ/Ó1°6×3KÑ3KÔLà×Ñ×Òô
 #Ø$ØŸ™ôð ð
 ×#Ñ#÷ Ø×Ñ×&Ñ&Õ(ð øôM ô +Ü—‘Ø?È$ð ô ð '+Ó#ð	+ûôr ô ØÜô ð ˆÜ�Š�e×,Ñ,Ó.°×0HÑ0HÔIØÜô Ü�Š�e×,Ñ,Ó.°×0HÑ0HÔIØðû÷ Ø×Ñ×&Ñ&Õ(ð ús8   ÈAP> Í/B+Q) Ð>$Q&Ñ%Q&Ñ)S,Ñ>;S,Ò:2S,Ó,S/ Ó/%T)r   r   rt   rl   )6r5   rƒ   r    Úcollections.abcr   Údataclassesr   r   Útypingr   r+   Ú-torch.distributed.elastic.rendezvous.registryÚdistributedÚelasticÚ
rendezvousÚregistryr§   Útorch._utils_internalr   r   Útorch.distributed.elasticr	   r
   Ú*torch.distributed.elastic.agent.server.apir   Ú:torch.distributed.elastic.agent.server.health_check_serverr   r   Ú:torch.distributed.elastic.agent.server.local_elastic_agentr   r   r   Ú)torch.distributed.elastic.multiprocessingr   r   r   Ú0torch.distributed.elastic.multiprocessing.errorsr   Ú$torch.distributed.elastic.rendezvousr   Ú*torch.distributed.elastic.rendezvous.utilsr   Ú'torch.distributed.elastic.utils.loggingr   Útorch.numa.bindingr   Ú__all__r\   r1   r   r   r†   r’   rt   r}   r[   r<   Ú<module>rÎ      s¥   ðó 
Û 
Û Ý $ß (Ý ã ß EÖ Eß Kß 5Ý A÷÷ñ ÷
ñ õ
 NÝ EÝ PÝ >Ý *ò =€á	�HÓ	€ð ÷lð ló ðl÷^+
ñ +
õ\õ(&÷&b)ñ b)r[   