§
    -`ƒiX  ã                   ó:   — d dl mZmZ d dlZ G d„ de¦  «        ZdS )é    )ÚABCÚabstractmethodNc                   ó    — e Zd Zee	 d
dej        dededededej        dz  deej        ej        ej        f         fd	„¦   «         ¦   «         Z	dS )ÚAbstractEplbPolicyNÚweightÚnum_replicasÚ
num_groupsÚ	num_nodesÚ	num_ranksÚold_global_expert_indicesÚreturnc                 ó   — t           ‚)a   
        Entry point for expert-parallelism load balancer.

        Parameters:
            weight: [layers, num_logical_experts], the load statistics
                for all logical experts
            num_replicas: number of physical experts, must be a multiple of
                `num_ranks`
            num_groups: number of expert groups
            num_nodes: number of server nodes
            num_ranks: number of ranks, must be a multiple of `num_nodes`
            old_global_expert_indices: [layers, num_logical_experts], the old global
                expert indices. Used to avoid unnecessary weight copying
                for experts moving within one rank.
        Returns:
            physical_to_logical_map: [layers, num_replicas], the expert
                index of each replica
            logical_to_physical_map: [layers, num_logical_experts, X],
                the replica indices for each expert
            expert_count: [layers, num_logical_experts], number of
                physical replicas for each logical expert
        )ÚNotImplementedError)Úclsr   r   r	   r
   r   r   s          úy/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/distributed/eplb/policy/abstract.pyÚrebalance_expertsz$AbstractEplbPolicy.rebalance_experts
   s   € õB "Ð!ó    )N)
Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   ÚtorchÚTensorÚintÚtupler   © r   r   r   r   	   s¥   € € € € € ØØð :>ð"ð "à”ð"ð ð"ð ð	"ð
 ð"ð ð"ð $)¤<°$Ñ#6ð"ð 
ˆuŒ|˜Uœ\¨5¬<Ð7Ô	8ð"ð "ð "ñ „^ñ „[ð"ð "ð "r   r   )Úabcr   r   r   r   r   r   r   ú<module>r      s\   ðð $Ð #Ð #Ð #Ð #Ð #Ð #Ð #à €€€ð""ð ""ð ""ð ""ð ""˜ñ ""ô ""ð ""ð ""ð ""r   