Ë
    g^(h¯  ã                   óÄ   — d dl Z d dlmZmZmZ d dlmZ d dlmZm	Z	 g d¢Z
e	eeeedf   Z G d„ dee«      Ze G d„ d	«      «       Z G d
„ dee«      Ze G d„ d«      «       Zy)é    N)ÚasdictÚ	dataclassÚfield)ÚEnum)ÚOptionalÚUnion)ÚEventSourceÚEventÚ	NodeStateÚ	RdzvEventc                   ó   — e Zd ZdZdZdZy)r	   z)Known identifiers of the event producers.ÚAGENTÚWORKERN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   © ó    úb/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/distributed/elastic/events/api.pyr	   r	      s   „ Ù3à€EØ�Fr   r	   c                   ó�   — e Zd ZU dZeed<   eed<   dZeed<    e	e
¬«      Ze
eef   ed<   d„ Zed	eed f   d
d fd„«       Zd
efd„Zy)r
   a}  
    The class represents the generic event that occurs during the torchelastic job execution.

    The event can be any kind of meaningful action.

    Args:
        name: event name.
        source: the event producer, e.g. agent or worker
        timestamp: timestamp in milliseconds when event occurred.
        metadata: additional data that is associated with the event.
    ÚnameÚsourcer   Ú	timestamp)Údefault_factoryÚmetadatac                 ó"   — | j                  «       S ©N©Ú	serialize©Úselfs    r   Ú__str__zEvent.__str__/   ó   € Ø�~‰~ÓÐr   ÚdataÚreturnc                 ó¤   — t        | t        «      r| S t        | t        «      rt        j                  | «      }t
        d      |d<   t        di |¤ŽS )Nr   r   )Ú
isinstancer
   ÚstrÚjsonÚloadsr	   ©r%   Ú	data_dicts     r   ÚdeserializezEvent.deserialize2   sK   € ä�dœEÔ"ØˆKÜ�dœCÔ ÜŸ
™
 4Ó(ˆIÜ)¨)°HÑ*=Ñ>ˆ	�(ÑÜÑ!�yÑ!Ð!r   c                 ó>   — t        j                  t        | «      «      S r   ©r*   Údumpsr   r!   s    r   r    zEvent.serialize;   ó   € Ü�z‰zœ& ›,Ó'Ð'r   N)r   r   r   r   r)   Ú__annotations__r	   r   Úintr   Údictr   ÚEventMetadataValuer#   Ústaticmethodr   r.   r    r   r   r   r
   r
      st   … ñ
ð ƒIØÓØ€IˆsÓÙ.3ÀDÔ.I€Hˆd�3Ð*Ð*Ñ+ÓIò ð ð"˜%  W Ñ-ð "°'ò "ó ð"ð(˜3ô (r   r
   c                   ó    — e Zd ZdZdZdZdZdZy)r   z,The states that a node can be in rendezvous.ÚINITÚRUNNINGÚ	SUCCEEDEDÚFAILEDN)r   r   r   r   r9   r:   r;   r<   r   r   r   r   r   ?   s   „ Ù6à€DØ€GØ€IØ�Fr   r   c                   óÈ   — e Zd ZU dZeed<   eed<   eed<   eed<   eed<   eed<   dZeed	<   d
Z	e
e   ed<   d
Ze
e   ed<   dZeed<   d„ Zedeed f   dd fd„«       Zdefd„Zy
)r   aŒ  
    Dataclass to represent any rendezvous event.

    Args:
        name: Event name. (E.g. Current action being performed)
        run_id: The run id of the rendezvous
        message: The message describing the event
        hostname: Hostname of the node
        pid: The process id of the node
        node_state: The state of the node (INIT, RUNNING, SUCCEEDED, FAILED)
        master_endpoint: The master endpoint for the rendezvous store, if known
        rank: The rank of the node, if known
        local_id: The local_id of the node, if defined in dynamic_rendezvous.py
        error_trace: Error stack trace, if this is an error event.
    r   Úrun_idÚmessageÚhostnameÚpidÚ
node_stateÚ Úmaster_endpointNÚrankÚlocal_idÚerror_tracec                 ó"   — | j                  «       S r   r   r!   s    r   r#   zRdzvEvent.__str__e   r$   r   r%   r&   c                 ó¤   — t        | t        «      r| S t        | t        «      rt        j                  | «      }t
        d      |d<   t        di |¤ŽS )NrB   r   )r(   r   r)   r*   r+   r   r,   s     r   r.   zRdzvEvent.deserializeh   sK   € ä�dœIÔ&ØˆKÜ�dœCÔ ÜŸ
™
 4Ó(ˆIÜ"+¨I°lÑ,CÑ"Dˆ	�,ÑÜÑ%˜9Ñ%Ð%r   c                 ó>   — t        j                  t        | «      «      S r   r0   r!   s    r   r    zRdzvEvent.serializeq   r2   r   )r   r   r   r   r)   r3   r4   r   rD   rE   r   rF   rG   r#   r7   r   r.   r    r   r   r   r   r   H   s•   … ñð  ƒIØƒKØƒLØƒMØ	ƒHØÓØ€O�SÓØ€Dˆ(�3‰-ÓØ"€Hˆh�s‰mÓ"Ø€K�Óò ð ð&˜%  [Ð 0Ñ1ð &°kò &ó ð&ð(˜3ô (r   r   )r*   Údataclassesr   r   r   Úenumr   Útypingr   r   Ú__all__r)   r4   ÚfloatÚboolr6   r	   r
   r   r   r   r   r   ú<module>rQ      s‚   ðó ß 0Ñ 0Ý ß "ò =€à˜3  U¨D°$Ð6Ñ7Ð ô�#�tô ð ÷(ð (ó ð(ôD��Tô ð ÷)(ð )(ó ñ)(r   