
    Vpf\                        d dl mZ d dlZd dlmZ d dlmZ d dlZd dlm	Z	 d dl
mZ d dl
mZ d dlmZ ej        Z G d	 d
          ZdddZ	 d d!dZddd"dZdS )#    )annotationsN)Sequence)Optional)
mesh_utils)
xla_client)xla_extension)
xla_bridgec                      e Zd ZddZdS )TopologyDescriptiondeviceslist[Device]c                    || _         d S N)r   )selfr   s     [/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/jax/experimental/topologies.py__init__zTopologyDescription.__init__   s    !(DLLL    N)r   r   )__name__
__module____qualname__r    r   r   r   r      s(        ) ) ) ) ) )r   r   returnc                F    t          t          j        |                     S )N)backend)r   jaxr   )platforms    r   get_attached_topologyr   #   s    	S[:::	;	;;r    topology_namestrr   
str | Nonec                j   |dk    s|1t          t          j        | fi |                                          S 	 t          j        || fi |}t          |                                          S # t
          j        $ r4}|j        ^}}|                    d          rt          |          | d }~ww xY w)NtpuUNIMPLEMENTED)
r   xbmake_pjrt_tpu_topology_make_compile_only_devicesmake_pjrt_topologyr   XlaRuntimeErrorargs
startswithNotImplementedError)r   r   kwargstopologyemsg_s          r   get_topology_descr2   '   s     (*
!	
 	
#	
 	

$
$
&
&  
$X}GGGGHxBBDDEEE		&   fGC!
~~o&& $$!+s   3A/ /B2>/B--B2Fcontiguous_submeshestopo
mesh_shapeSequence[int]
axis_namestuple[str, ...]r4   booljax.sharding.Meshc                   t          j        |t          | j                  |          }t          j                            ||          S )Nr3   )r   create_device_meshlistr   r   shardingMesh)r5   r6   r8   r4   r   s        r   	make_meshrA   >   sH     )$t|$$;OQ Q Q'			7J	/	//r   r   )r   r   )r   N)r   r    r   r!   r   r   )
r5   r   r6   r7   r8   r9   r4   r:   r   r;   )
__future__r   abccollections.abcr   typingr   r   jax.experimentalr   jax._src.libr   xcr   jax._srcr	   r%   Devicer   r   r2   rA   r   r   r   <module>rK      s*   # " " " " " 



 $ $ $ $ $ $       



 ' ' ' ' ' ' ) ) ) ) ) ) & & & & & & % % % % % %	) ) ) ) ) ) ) )
< < < < <
 59    8 "'	0 	0 	0 	0 	0 	0 	0 	0r   