+
    –°³j  ã                   ó*   € ^ RI t ^ RIt ! R R4      tR# )é    Nc                   ól   a € ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltR
t	V t
R# )Ú_FreeEventQueuezÒ
This tracks all pending frees corresponding to inflight all-gathers. The
queueing pattern is iterative enqueues with a single dequeue per iteration
once the limit ``_max_num_inflight_all_gathers`` is reached.
c                ó   <€ V ^8„  d   QhRR/# ©é   ÚreturnN© )ÚformatÚ__classdict__s   "€Úf/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributed/fsdp/_limiter_utils.pyÚ__annotate__Ú_FreeEventQueue.__annotate__   s   ø€ ÷ /ñ /˜$ñ /ó    c                óH   € \         P                  ! 4       V n        ^V n        R# )r   N)ÚcollectionsÚdequeÚ_queueÚ_max_num_inflight_all_gathers©Úselfs   &r   Ú__init__Ú_FreeEventQueue.__init__   s   € Ü6A×6GÒ6GÓ6IˆŒØ-.ˆÖ*r   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r   Ú
free_eventr   N©ÚtorchÚEvent)r
   r   s   "€r   r   r      s   ø€ ÷ 'ñ '¡%§+¡+ð '°$ñ 'r   c                ó<   € V P                   P                  V4       R# )zEnqueues a free event.N)r   Úappend)r   r   s   &&r   ÚenqueueÚ_FreeEventQueue.enqueue   s   € à�‰×Ñ˜:Ö&r   c                óB   <€ V ^8„  d   QhRS[ P                  R,          /# r   r   )r
   r   s   "€r   r   r      s   ø€ ÷ ñ ¡5§;¡;°Õ#5ñ r   c                ón   € \        V P                  4      V P                  8¼  d   V P                  4       # R# )z0Dequeues a single event if the limit is reached.N)Úlenr   r   Ú_dequeuer   s   &r   Údequeue_if_neededÚ!_FreeEventQueue.dequeue_if_needed   s(   € äˆt�{‰{Ó˜t×AÑAÔAØ—=‘=“?Ð"Ùr   c                óB   <€ V ^8„  d   QhRS[ P                  R,          /# r   r   )r
   r   s   "€r   r   r      s   ø€ ÷ ñ ™%Ÿ+™+¨Õ,ñ r   c                ób   € V P                   '       d   V P                   P                  4       pV# R# )z"Dequeues a free event if possible.N)r   Úpopleft)r   Úevents   & r   r%   Ú_FreeEventQueue._dequeue   s%   € à�;�;ˆ;Ø—K‘K×'Ñ'Ó)ˆEØˆLÙr   )r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r    r&   r%   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s2   ø‡ € ñ÷/ð /÷'ð '÷ð ÷ö r   r   )r   r   r   r	   r   r   Ú<module>r4      s   ðÛ ã ÷ó r   