
    -`i>                     n    d dl mZ d dlmZ d dlmZ  e            s
J d             G d de          ZdS )    N)CommBackend)has_flashinfer_all2allz+Flashinfer alltoallv module cannot be foundc                   L    e Zd Zd ZdefdZdefdZdefdZdededd fd	Zd
S )CustomCommunicatorc                     || _         d S N)_group)selfgroups     /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/distributed/device_communicators/mnnvl_compat.py__init__zCustomCommunicator.__init__   s        returnc                 4    | j                                         S r   )r	   rankr
   s    r   Get_rankzCustomCommunicator.Get_rank       {!!!r   c                 4    | j                                         S r   )r	   sizer   s    r   Get_sizezCustomCommunicator.Get_size   r   r   datac                 n    d g|                                  z  }t          j        ||| j                   |S )N)r   )r   distall_gather_objectr	   )r
   r   gathereds      r   	allgatherzCustomCommunicator.allgather   s5    6DMMOO+xT[AAAAr   colorkeyc                     | S r    )r
   r   r   s      r   SplitzCustomCommunicator.Split   s    r   N)	__name__
__module____qualname__r   intr   r   r   r"   r!   r   r   r   r      s          "# " " " ""# " " " "c    
3 S -A      r   r   )torch.distributeddistributedr   flashinfer.comm.mnnvlr   vllm.utils.flashinferr   r   r!   r   r   <module>r+      s    !           < < < < < < 8 8 8 8 8 8 N N!N N N         r   