ó
    "EñiM  ã                   óö  • S SK r S SKJrJr  S SKJrJrJr  S SKJ	r	  SSK
Jr  \ R                  R                  r\	" \ R                  \ R                  \ R                   \ R"                  /5      r\	" / \R&                  P\R(                  P\R*                  P\R,                  P\R.                  P\R0                  P\R2                  P\R4                  P\R6                  P\R8                  P\R:                  P\R<                  P\R>                  P\R@                  P\RB                  P\RD                  P\RF                  P\RH                  P\RJ                  P\RL                  P\RN                  P\RP                  P\RR                  P\RT                  P\RV                  P\RX                  P\RZ                  P\R\                  P\R^                  P\R`                  P\Rb                  P5      r2\	" \Rf                  \Rh                  \Rj                  \Rl                  \Rn                  \Rp                  \Rr                  \Rt                  \Rv                  /	5      r<\2\<-  r=S\>4S jr?S	\ R€                  S\A4S
 jrBS\>4S jrCg)é    N)Úget_device_tflopsÚget_gpu_dram_gbps)Úhas_hintÚ	size_hintÚstatically_known_true)Ú
OrderedSeté   )Úflop_registryÚreturnc                 óâ   • U [         ;   ae  [        U5      S:w  a  [        SU SU  35      eUR                  5       n[	        U5      S-  nSnXv-  n[         U    n	U	" U0 UDSU0D6S-  n
X¨-  S-  nU$ g	)
aO  
Estimates the compute time of an aten operator.

Args:
    func_packet: The operator overload packet.
    args: The arguments to the operator.
    kwargs: The keyword arguments to the operator.
    out: The output of the operator.
    out_dtypes: The output data types.

Returns:
    float: The estimated compute time in nanoseconds.
r	   z"Only support single out dtype got z for g  4&õkCg      è?Úout_valé   g    eÍÍAg        )r
   ÚlenÚAssertionErrorÚpopr   )Úfunc_packetÚargsÚkwargsÚoutÚ
out_dtypesÚdtypeÚpeak_gpu_flopsÚfactorÚpeak_empirical_flopsÚflop_count_funcÚ
flop_countÚcompute_times               Ú\/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/utils/_runtime_estimation.pyÚget_compute_timer   N   s™   € ð ”mÓ#Üˆz‹?˜aÓÜ Ø4°Z°LÀÀkÀ]ÐSóð ð —‘Ó ˆä*¨5Ó1°DÑ8ˆàˆØ%Ñ6ÐÜ'¨Ñ4ˆá$ dÐB¨fÑB¸cÒBÀQÑFˆ
à"Ñ9¸SÑ@ˆØÐØó    Útc                 ó  • Sn[        U R                  U R                  5       5       HJ  u  p#[        U5      (       a  [        U5      (       d    g[	        US:H  5      (       a  M<  U[        U5      -  nML     XR                  5       -  $ )z¡
Calculates the memory consumption of a tensor.

Args:
    t (torch.Tensor): The input tensor.

Returns:
    int: The memory consumption of the tensor in bytes.
r	   r   )ÚzipÚshapeÚstrider   r   r   Úelement_size)r!   Ú
real_numelÚsizer%   s       r   Úget_num_bytesr)   p   sm   € ð €JÜ˜AŸG™G Q§X¡X£ZÖ0‰ˆÜ˜�~‰~¤X¨f×%5Ñ%5Ùô % V¨q¡[×1Ó1Øœ) D›/Ñ)ŠJñ 1ð Ÿ™Ó(Ñ(Ð(r    c                 ór   • [        5       n[        S U  5       5      n[        S U 5       5      nX4-   nXR-  nU$ )a+  
Estimates the memory transfer time of input and output tensors.

Args:
    flat_args_kwargs (List[torch.Tensor]): The flat list of arguments and keyword arguments.
    flat_outs (List[torch.Tensor]): The flat list of outputs.

Returns:
    float: The estimated memory transfer time in nanoseconds.
c              3   óz   #   • U  H1  n[        U[        R                  5      (       d  M$  [        U5      v •  M3     g 7f©N©Ú
isinstanceÚtorchÚTensorr)   ©Ú.0r!   s     r   Ú	<genexpr>Ú$get_transfer_time.<locals>.<genexpr>’   s,   é € ð Ú"2˜Q´jÀÄEÇLÁL×6QÓŒ�a×ÐÒ"2ùó   ‚#;©;c              3   óz   #   • U  H1  n[        U[        R                  5      (       d  M$  [        U5      v •  M3     g 7fr,   r-   r1   s     r   r3   r4   •   s+   é € ð Ú"+˜Q¬z¸!¼U¿\¹\×/JÓŒ�a×Ð¢)ùr5   )r   Úsum)Úflat_args_kwargsÚ	flat_outsÚgpu_memory_bandwidthÚ
read_bytesÚwrite_bytesÚcounted_bytesÚtransfer_times          r   Úget_transfer_timer?   †   sU   € ô -Ó.ÐÜñ Ù"2óó €Jô ñ Ù"+óó €Kð Ñ,€Mà!Ñ8€MØÐr    )Dr/   Útorch._inductor.utilsr   r   Ú%torch.fx.experimental.symbolic_shapesr   r   r   Útorch.utils._ordered_setr   Úflop_counterr
   ÚopsÚatenÚfloat16Úbfloat16Úfloat32Úfloat64Ú_FLOAT_TYPESÚ
lift_freshr!   Ú	transposeÚviewÚdetachÚ_unsafe_viewÚsplitÚadjointÚ
as_stridedÚdiagonalÚexpandÚ	expand_asÚmovedimÚpermuteÚselectÚsqueezeÚmTÚmHÚrealÚimagÚview_asÚ	unflattenÚunfoldÚunbindÚ	unsqueezeÚvsplitÚhsplitÚsplit_with_sizesÚswapaxesÚswapdimsÚchunkÚ	_VIEW_OPSÚrandintÚrandnÚrandÚ
randn_likeÚ	rand_likeÚrandint_likeÚarangeÚ	ones_likeÚ
zeros_likeÚ_CREATE_OPSÚ_IGNORE_OPSÚfloatr   r0   Úintr)   r?   © r    r   Ú<module>rx      s©  ðÛ ß F÷ñ õ
 0å 'ð ‡y�y‡~�~€áà�‰Ø�‰Ø�‰Ø�‰ð	ó€ñ ð Ø�‰ð à�‰ð ð 	�‰ð ð 	�	‰	ð	 ð
 	�‰ð ð 	×Ñð ð 	�
‰
ð ð 	�‰ð ð 	�‰ð ð 	�‰ð ð 	�‰ð ð 	�‰ð ð 	�‰ð ð 	�‰ð ð 	�‰ð ð  	�‰ð! ð" 	�‰ð# ð$ 	�‰ð% ð& 	�	‰	ð' ð( 	�	‰	ð) ð* 	�‰ð+ ð, 	�‰ð- ð. 	�‰ð/ ð0 	�‰ð1 ð2 	�‰ð3 ð4 	�‰ð5 ð6 	�‰ð7 ð8 	×Ñð9 ð: 	�‰ð; ð< 	�‰ð= ð> 	�
‰
ð? ó"€	ñH à�‰Ø�
‰
Ø�	‰	Ø�‰Ø�‰Ø×ÑØ�‰Ø�‰Ø�‰ð
ó€ð ˜+Ñ%€ðÀEô ðD)�U—\‘\ð ) cô )ð,°eõ r    