
    N jb	                     P   S SK r S SK Jr  SSKJr  \ R                  R                  SS\ R                  R                  S9  \ R                  R                  S5      S\ R                  S	\
S
\4S j5       r\ R                  R                  SS5      S\ R                  S	\
S
\
4S j5       rg)    N)SymInt   )
DeviceMeshz/device_mesh::_runtime_compute_coordinate_on_dimz'(Tensor full_mesh, int index) -> SymInt)tags	full_meshindexreturnc                    SSK Jn  [        R                  R                  R                  5       nUR                  nUR                  5       nU R                  US-   5      nU" US[        U[        5      (       a  US-
  OS S9   [        R                  R                  R                  R                  5       nU(       a/  UR                   R#                  UR$                  R&                  5        U$ ! [         a    Sn NFf = f)Nr   )_constrain_range_for_size   )minmaxF)%torch.fx.experimental.symbolic_shapesr   torch
_custom_opimplget_ctx
_shape_envcreate_unbacked_symintsize
isinstanceint_dynamosymbolic_convertInstructionTranslator
current_txAttributeError ignorable_fresh_unbacked_symbolsappendnode_expr)r   r   r   ctx	shape_envsz	mesh_size	in_dynamos           s/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/torch/distributed/_ops/device_mesh.py'_runtime_compute_coordinate_on_dim_faker(      s     P





'
'
)CI 
	)	)	+B
 uqy)I

9c(B(By1}MM22HHSSU	  	2299"''--HI  	s   2C, ,C;:C;CompositeExplicitAutogradc                     [         R                  R                  5       n[        R                  " U 5      n[        R
                  " X25      nUc   eXA   $ )N)r   distributedget_rankr   _get_mesh_tensor_from_full_mesh_compute_coordinates_from_mesh)r   r   rankmeshmesh_coordss        r'   '_runtime_compute_coordinate_on_dim_implr2   7   sM     %%'D55i@D;;DGK"""    )r   r   device_meshr   librarydefineTagpt2_compliant_tagregister_fakeTensorr   r(   r   r2    r3   r'   <module>r<      s      $   5-		$	$   NO"||"$'"" P"J 57Ru|| C TW r3   