
    Wh5                        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 )"    )annotations)SequenceN)
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     a/var/www/html/movieo_spanner_bot/venv/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_descr1   %   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, ...]r3   booljax.sharding.Meshc                   t          j        |t          | j                  |          }t          j                            ||          S )Nr2   )r   create_device_meshlistr   r   shardingMesh)r4   r5   r7   r3   r   s        r   	make_meshr@   <   sH     )$t|$$;OQ Q Q'			7J	/	//r   r   )r   r
   )r   N)r   r   r   r    r   r
   )
r4   r
   r5   r6   r7   r8   r3   r9   r   r:   )
__future__r   collections.abcr   r   jax.experimentalr   jax._src.libr   xcr   jax._srcr   r$   Devicer
   r   r1   r@   r   r   r   <module>rH      s   # " " " " " $ $ $ $ $ $ 



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