+
    &j                       a  R t0 t R t^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
t
^ RIHtHtHtHtHt ^ RIHt / t] ^ k . ROt ! R	 R]	4      tR
 R ltR R ltR R lt]! R]4       ]! R]4       R R ltR R lt]R R l4       tR# )z
This is an experimental new API for PyTorch Distributed. This is actively in development and subject to change or deletion entirely.

This is intended as a proving ground for more flexible and object oriented distributed APIs.
)	Generator)contextmanager)	timedelta)ProtocolN)_current_process_group_set_process_groupProcessGroupReduceOpStore)
rendezvousProcessGroupFactoryc                   6   a  ] tR t^$t o RtV 3R lR ltRtV tR# )r   z%Protocol for process group factories.c                X   < V ^8  d   QhRS[ RS[RS[RS[RS[P                  RS[RS[/#    storerank
world_sizetimeoutdevicekwargsreturnr
   intr   torchr   objectr   )format__classdict__s   "p/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/distributed/_dist2.py__annotate__ ProcessGroupFactory.__annotate__'   sU        	
    
    c                    R # )N )selfr   r   r   r   r   r   s   &&&&&&,r   __call__ProcessGroupFactory.__call__'   s     r!   r#   N)__name__
__module____qualname____firstlineno____doc__r%   __static_attributes____classdictcell__)r   s   @r   r   r   $   s     / r!   c                4    V ^8  d   QhR\         R\        RR/# )r   namefuncr   N)strr   )r   s   "r   r   r   2   s"      3 &9 d r!   c                L    V \         9   d   \        RV  R24      hV\         V &   R# )z
Register a new process group backend.

Args:
    name: The name of the backend.
    func: The function to create the process group.
Backend z already registeredN)	_BACKENDS
ValueError)r/   r0   s   &&r   register_backendr6   2   s*     y8D6)<=>>IdOr!   c                    V ^8  d   QhR\         R\        R\        R\        R\        P                  R\
        R\        /# r   r   )r   s   "r   r   r   @   sR      
  	
 LL  r!   c                 ~   ^ RI Hp \        V4      ^ 8w  d   \        R4      hV! WW#4      pVP	                  4        \        WV4      pVP                  \
        P                  P                  4       VP                  V\
        P                  P                  V4       VP                  \        P                  ! R4      \
        P                  P                  V4       \        P                  P                  4       '       d@   VP                  \        P                  ! R4      \
        P                  P                  V4       V# )    )ProcessGroupGlooz'Gloo backend received unexpected kwargscpucuda)torch.distributedr:   lenAssertionError_set_sequence_number_for_groupr   _set_default_backendBackendTypeGLOO_register_backendr   r   r<   is_available)	r   r   r   r   r   r   r:   backend_classpgs	   &&&&&,   r   _gloo_factoryrH   @   s     3
6{aFGG$U*FM002	e:	.BL4499: !9!9!>!>NU\55::M zz  
LL ,":":"?"?	
 Ir!   c                    V ^8  d   QhR\         R\        R\        R\        R\        P                  R\
        R\        /# r   r   )r   s   "r   r   r   _   sR      
  	
 LL  r!   c                    ^ RI Hp VP                  4       pW7n        VP	                  4        F0  w  r\        Wx4      '       g   \        RV 24      h\        WxV	4       K2  	  V! WW'4      p
V
P                  4        V
P                  V4       \        WV4      pVP                  \        P                  P                  4       VP                  V\        P                  P                  V
4       V# )r9   )ProcessGroupNCCLzUnknown option )r=   rK   Options_timeoutitemshasattrKeyErrorsetattrr@   eager_connect_single_devicer   rA   rB   NCCLrD   )r   r   r   r   r   r   rK   optskvrF   rG   s   &&&&&,      r   _nccl_factoryrW   _   s     3##%DMt_QC011 
 %U*CM002--f5	e:	.BL4499:!9!9!>!>NIr!   glooncclc          
      ~    V ^8  d   QhR\         R\        R\         \        P                  ,          R\        R\
        /# )r   backendr   r   r   r   )r1   r   r   r   r   r   )r   s   "r   r   r      sJ     R RRR %,,R 	R
 Rr!   c                    V \         9  d   \        RV  R24      h\        P                  ! V4      p\	        \        \        R4      4      4      w  rEpVP                  V4       \         V ,          ! WEWaV3/ VB # )a  
Create a new process group with the given backend and options. This group is
independent and will not be globally registered and thus not usable via the
standard torch.distributed.* APIs.

Args:
    backend: The backend to use for the process group.
    timeout: The timeout for collective operations.
    device: The device to use for the process group.
    **kwargs: All remaining arguments are passed to the backend constructor.
              See the backend specific documentation for details.

Returns:
    A new process group.
r3   z not registeredzenv://)r4   r5   r   r   nextiterr   set_timeout)r[   r   r   r   r   r   r   s   &&&,   r   	new_groupr`      sn    * i8G9O<==\\&!F"4
8(<#=>E	gWe:Q&QQr!   c                $    V ^8  d   QhR\         /# )r   r   )r   )r   s   "r   r   r      s     $ $| $r!   c                     \        4       # )z^
Get the current process group. Thread local method.

Returns:
    The current process group.
)r   r#   r!   r   current_process_grouprc      s     "##r!   c                >    V ^8  d   QhR\         R\        R,          /# )r   rG   r   )NNN)r   r   )r   s   "r   r   r      s      $ $l $y1A'B $r!   c              #  x   "   \        4       p\        V 4        Rx  \        V4       R#   \        T4       i ; i5i)zc
Context manager for process groups. Thread local method.

Args:
    pg: The process group to use.
N)rc   r   )rG   prev_pgs   & r   process_grouprg      s0      $%Gr$7#7#s   :* :7:c                Z    V ^8  d   Qh/ ^ \         9   d   \        \        R3,          ;R&   # )r   r   r4   )__conditional_annotations__dictr1   )r   s   "r   r   r      s)      , 1 04**+ 0-r!   )r   r	   r   r6   r`   rc   rg   )ri   r+   collections.abcr   
contextlibr   datetimer   typingr   r   torch._C._distributed_c10dr   r   r   r	   r
   torch.distributed.rendezvousr   r4   __all__r   r6   rH   rW   r`   rc   rg   r   )ri   s   @r   <module>rr      s    & %     4 /1	 0( >8  '  'R@$ $ $r!   