
    ȅi|                     2    S SK r S SKJr  S/r " S S5      rg)    N)dtype	GPULimitsc                       \ rS rSrSrS\R                  4S jrS\S\	4S jr
S\S\	4S jr SS\S	\S\4S
 jjrS\	4S jrS\	4S jrSrg)r      a  Utility class that provides the theoretical limits of Nvidia GPU devices. The
limits don't take into account thermal throttling (assume that the GPU run at its
peak rated frequency). This is because user hardware configuration may influence
power behavior.
target_devicec                     [         R                  R                  U5      U l        [	        U R                  R
                   U R                  R                   35      U l        g )N)torchcudaget_device_propertiesdevice_propertiesintmajorminorcompute_capability)selfr   s     S/home/james-whalen/.local/lib/python3.13/site-packages/torch/cuda/_device_limits.py__init__GPULimits.__init__   sP     "'!A!A-!P #&%%++,T-C-C-I-I,JK#
    	data_typereturnc           
      >   SSSSSSSSSS.	nSnU[         R                  L a  SU R                   3nOHU[         R                  L a  SU R                   3nO%U[         R                  L a  S	U R                   3nOS
nX2;  a  [        SU R                   SU S35      eX#   $ )N   @          )	fp16_80fp32_80fp64_80fp16_90fp32_90fp64_90fp16_100fp32_100fp64_100 fp16_fp32_fp64_unknownNo data for sm_ and .)r	   float16r   float32float64RuntimeErrorr   r   hardcoded_device_valuesdict_keys       r   #get_fma_per_cycle_per_sm_cuda_cores-GPULimits.get_fma_per_cycle_per_sm_cuda_cores   s     #
 %t6678H%--'t6678H%--'t6678H H2!$"9"9!:%	{!L  '00r   c                    SSSSSSSSSSSSSS.nS	nU[         R                  L a  S
U R                   3nOU[         R                  L a  S
U R                   3nOkU[         R                  L a  SU R                   3nOHU[         R
                  L a  SU R                   3nO%U[         R                  L a  SU R                   3nOSnX2;  a  [        SU R                   SU S35      eX#   $ )Ni   i   i   r   i   r   i    )int8_80r   r   r   int8_90fp8_90r    r!   r"   int8_100fp8_100r#   r$   r&   r'   r(   int8_r)   r*   r+   r,   r-   )r	   r.   r   bfloat16r/   int8r0   r1   r2   s       r   %get_fma_per_cycle_per_sm_tensor_cores/GPULimits.get_fma_per_cycle_per_sm_tensor_coresA   s    !#
$ %t6678H%..(t6678H%--'t6678H%**$t6678H%--'t6678H H2!$"9"9!:%	{!L  '00r   use_tensor_coresc                     U R                   R                  nU R                   R                  nSnU(       a  U R                  U5      nOU R	                  U5      nX5-  S-  U-  S-  nU$ )Nr      g    eA)r   multi_processor_count
clock_rater@   r5   )r   r   rB   num_smsrF   fma_per_cycletflops_per_seconds          r   get_tflops_per_secondGPULimits.get_tflops_per_secondj   sn     ((>>++66
 FFyQM DDYOM $3a7*DsJ  r   c                     [        SU R                  R                  -  S-  5      nU R                  R                  S-  nX-  S-  nU$ )NrD   r     )r   r   memory_bus_widthmemory_clock_rate)r   bus_bytes_per_cyclemem_clock_rate_Hzbytes_per_seconds       r   get_memory_bandwidth_Bps"GPULimits.get_memory_bandwidth_Bps{   sQ     "!d&<&<&M&M"MPQ"QR 22DDtK.BQFr   c                 t    U R                   R                  nSnX-  nX0R                   R                  -  S-  nU$ )Nr   rM   )r   rE   rF   )r   rG   bytes_per_cycle_per_smbytes_per_cycle_per_devicerR   s        r   get_shared_memory_bandwidth_Bps)GPULimits.get_shared_memory_bandwidth_Bps   sH     ((>>!$%,%E"&)?)?)J)JJTQ 	  r   )r   r   N)T)__name__
__module____qualname____firstlineno____doc__r	   devicer   r   r   r5   r@   boolfloatrJ   rS   rX   __static_attributes__ r   r   r   r      sy    	
ell 	
 1U 1s 1D'1u '1 '1T :>!!26!	!" #  	  	 r   )r	   torch._Cr   __all__r   rc   r   r   <module>rf      s       -D  D r   