ó
    Eñi¹
 ã                   óÂ  • % S r SSKrSSKrSSKrSSKrSSKrSSKJr  SSKJ	r	  SSK
JrJrJrJrJrJr  SSKrSSKrSSKJrJrJr  SSKJr  SS	KJrJr  SS
KJr  SSKJrJ r J!r!J"r"J#r#  SSK$J%r%  SSK&J'r'J(r(J)r)   SSKJ*r*  Sq,\RZ                  " 5       r.\R^                  " 5       r0/ q1\2\3\/ S4   \2\4   4      \5S'   \6" \Rn                  SS 5      r8Sr9Sr: SSKJ;r<   \<Rz                  (       d  SSK>r>O(SSK?r?SSK@JArA   " S S5      rB\B" 5          SSKCrCSSS5        Sr9C<\" 5       qF\G" \Rn                  S5      (       a  \Rn                  R�                  rHO\" S5      rH\G" \Rn                  S5      (       a  \Rn                  R’                  rJO	S\KS\K4S jrJ\G" \Rn                  S5      (       a  \Rn                  R˜                  rMO	S\KS\K4S jrMSrN\O\5S'   \Rn                  R                   rQ\O\5S '   S!rR\3\Rn                  R¦                     \5S"'   S\O4S# jrTS\O4S$ jrUS\O4S% jrVSÐS&\O4S' jjrW\	" S(S)9S\4S* j5       rXS\O4S+ jrYS, rZS-\4S\K4S. jr[ " S/ S05      r\ " S1 S25      r]0 S3\\" S3S41S59_S6\\" S6S41S59_S4\]" S415      _S7\\" S7S81S59_S9\\" S9S81S59_S8\]" S815      _S:\\" S:S;1S59_S;\]" S;15      _S<\\" S<S=9_S>\\" S>S?1S59_S@\\" S@S?1S59_S?\]" S?15      _SA\\" SAS=9_SB\\" SBS=9_SC\\" SCSD1S59_SD\]" SDSE15      _SF\\" SFS=9_\\" SES=9\\" SGS=9\\" SHS=9SI.Er^\_\K\\]\\4   4   \5SJ'   1 SKk1 SLk1 SMkSN.r`\_\4\a\K   4   \5SO'   SP\KSQ\K4SR jrbSS\KSP\KST\2\K   4SU jrcSV rdSW reSX rfSY rg\g" \d5        \g" \e5         " SZ S[\h5      ri\Rn                  RÔ                  rj\Rn                  RÖ                  rkS\ rlS] rmS^ rn " S_ S`5      ro " Sa Sb\p5      rqSc\KSS4Sd jrr " Se Sf5      rs " Sg S5      rt " Sh Si\t5      ruS\SS4Sj jrvSÑS\S\44Sk jjrwSÑS\S\3\K\K4   4Sl jjrxSÑS\S\H4Sm jjryS\Sn\S\O4So jrz " Sp Sq5      r{Sr\Ss   S\{4St jr|Su r}Sr\)4Sv jr~S\2\K   \2\4   -  4Sw jrS\K4Sx jr€S\K4Sy jr�S\2\4   S-  4Sz jr‚S\2\4   S-  4S{ jrƒS|\2\4   S}\2\4   S\2\K   4S~ jr„S\K4S jr…S\K4S€ jr†S\S\K4S� jr‡Sqˆ\KS-  \5S‚'   S\K4Sƒ jr‰S\2\4   4S„ jrŠS\44S… jr‹S\K4S† jrŒSÑS\SS4S‡ jjr�Sˆ rŽSÑS\S\)4S‰ jjr�SÑS\S\)4SŠ jjr�SÑS‹\KS\S\)4SŒ jjr‘S� r’SŽ\K\4-  SS4S� jr“S\K4S� jr”SÑS\4S‘ jjr•SÑS\4S’ jjr–S\S\K4S“ jr—SÑS\S\K4S” jjr˜SÑS\S\K4S• jjr™SÑS\S\K4S– jjršSÑS\S\K4S— jjr›SÑS\S\K4S˜ jjrœSÑS\S\K4S™ jjr�SÑS\S\K4Sš jjržSÑS\S\K4S› jjrŸSÑS\S\K4Sœ jjr SÑS\S\K4S� jjr¡SÑS\S\K4Sž jjr¢SÑS\S\K4SŸ jjr£S\K\4-  \Rè                  -  S\Rè                  4S  jr¤S\Rè                  S\Rn                  R¦                  4S¡ jr¥ SÒS¢\KS\K\4-  \Rè                  -  SS4S£ jjr¦SÒS\K\4-  \Rè                  -  S\K4S¤ jjr§SS¥K¨7  SS¥K©7  \ªS¦ 5       r« " S§ S¨5      r¬SS©K­J®r®J¯r¯   " Sª S«\®5      r° " S¬ S­\°5      r± " S® S¯\°5      r² " S° S±\°5      r³ " S² S³\°5      r´ " S´ Sµ\°5      rµ " S¶ S·\°5      r¶ " S¸ S¹\°5      r· " Sº S»\°5      r¸ " S¼ S½\°5      r¹ " S¾ S¿\°5      rº " SÀ SÁ\°5      r» " SÂ SÃ\°5      r¼C®C°\GRz                  GR}                  \²5        \GRz                  GR}                  \³5        \GRz                  GR}                  \µ5        \GRz                  GR}                  \¶5        \GRz                  GR}                  \·5        \GRz                  GR}                  \¸5        \GRz                  GR}                  \±5        \GRz                  GR}                  \´5        \GRz                  GR}                  \¹5        \GRz                  GR}                  \º5        \GRz                  GR}                  \»5        \GRz                  GR}                  \¼5         " SÄ SÅ5      r¿SÆ rÀ\g" \À5           SÓSÇ\4SÈ\4SÉ\4S-  SÊ\2S-  SË\2S-  4
SÌ jjrÁSSÍKJÂrÂJÃrÃJÄrÄJÅrÅJÆrÆJÇrÇ  \" SÎ\3\K\K4   5      rÈ/ SÏQrÉg! \+ a    Sr* GN#f = f! , (       d  f       GNœ= f! \D a     GN¦f = f! C<f = f! \+ a  rE\Er: SrECEGN½SrECEff = f)ÔaM  
This package adds support for CUDA tensor types.

It implements the same function as CPU tensors, but they utilize
GPUs for computation.

It is lazily initialized, so you can always import it, and use
:func:`is_available()` to determine if your system supports CUDA.

:ref:`cuda-semantics` has more details about working with CUDA.
é    N)ÚCallable)Ú	lru_cache)ÚAnyÚcastÚNewTypeÚOptionalÚTYPE_CHECKINGÚUnion)Ú_dummy_typeÚ_LazySeedTrackerÚclassproperty)ÚDeviceé   )Ú_device_limitsÚgds)Ú_get_device_index)Ú	CUDAGraphÚgraphÚgraph_pool_handleÚis_current_stream_capturingÚmake_graphed_callables)ÚGreenContext)ÚEventÚExternalStreamÚStream)Ú_cudartFÚ_queued_callsÚ_cuda_isInBadForkc                  ó   • g©NF© r!   ó    ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/cuda/__init__.pyÚ<lambda>r$   4   s   € Àr"   )Úversion)ÚPathc                   ó|   • \ rS rSrSS jrS\\-  S-  S\S\S\R                  4S jr
SS	 jrS
\S\S\SS4S jrSrg)Ú_amdsmi_cdll_hookéR   ÚreturnNc                 óì   • [         R                  U l        S/n[        R                  " S[        R                  " S5      5      =n(       a$  [        R
                  R                  US5      /U-   nXl        g )Núlibamd_smi.soÚ	ROCM_HOMEÚ	ROCM_PATHzlib/libamd_smi.so)ÚctypesÚCDLLÚoriginal_CDLLÚosÚgetenvÚpathÚjoinÚpaths)Úselfr6   Ú	rocm_homes      r#   Ú__init__Ú_amdsmi_cdll_hook.__init__S   sX   € Ü)/¯©�DÔ&Ø,Ð-�EÜ$&§I¢I¨k¼2¿9º9À[Ó;QÓ$RÐR�yÕRÜ!#§¡§¡¨iÐ9LÓ!MÐ NÐQVÑ V˜Ø,1•Jr"   ÚnameÚargsÚkwargsc                 óä   • U(       aC  [        U5      R                  S:X  a*  U R                   H  n U R                  " U/UQ70 UD6s  $    U R                  " U/UQ70 UD6$ ! [         a     MA  f = f)Nr,   )r&   r;   r6   r1   ÚOSError)r7   r;   r<   r=   r4   s        r#   Úhooked_CDLLÚ_amdsmi_cdll_hook.hooked_CDLLZ   su   € ö ¤ T£
§¡°?Ó BØ$(§J¤J˜Dð%Ø'+×'9Ò'9¸$Ð'PÀÒ'PÈÑ'PÒ Pñ %/ð
  ×-Ò-¨dÐD°TÒD¸VÑDÐDøô $+ó %Ú $ð%ús   ±A!Á!
A/Á.A/c                 ó.   • U R                   [        l        g ©N)r@   r/   r0   ©r7   s    r#   Ú	__enter__Ú_amdsmi_cdll_hook.__enter__e   s   € Ø"&×"2Ñ"2”F•Kr"   ÚtypeÚvalueÚ	tracebackc                 ó.   • U R                   [        l        g rC   )r1   r/   r0   ©r7   rG   rH   rI   s       r#   Ú__exit__Ú_amdsmi_cdll_hook.__exit__h   s   € Ø"&×"4Ñ"4”F•Kr"   )r1   r6   )r*   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r9   Ústrr&   r   r/   r0   r@   rE   rL   Ú__static_attributes__r!   r"   r#   r(   r(   R   sd   † ô2ð	EØ # d¡
¨TÑ 1ð	EØ:=ð	EØILð	Eà—[‘[ô	Eô3ð5¨ð 5°Sð 5ÀSð 5ÈT÷ 5r"   r(   TÚ_CudaDevicePropertiesÚ_cuda_exchangeDeviceÚdevicer*   c                 ó&   • U S:  a  g[        S5      e©Nr   éÿÿÿÿz)PyTorch was compiled without CUDA support©ÚRuntimeError©rV   s    r#   Ú_exchange_devicer]   ‚   ó   € Ø�A‹:ØÜÐFÓGÐGr"   Ú_cuda_maybeExchangeDevicec                 ó&   • U S:  a  g[        S5      erX   rZ   r\   s    r#   Ú_maybe_exchange_devicera   Œ   r^   r"   Úhas_halfÚ	has_magmar!   Údefault_generatorsc                  ó6   • [        [        R                  S5      $ )z)Return true if compile with CUDA support.Ú_cuda_getDeviceCount)ÚhasattrÚtorchÚ_Cr!   r"   r#   Ú_is_compiledrj   ˜   s   € ä”5—8‘8Ð3Ó4Ð4r"   c                  ó4   • [         R                  " S5      S:H  $ )NÚPYTORCH_NVML_BASED_CUDA_CHECKÚ1)r2   r3   r!   r"   r#   Ú_nvml_based_availrn   �   s   € Ü�9Š9Ð4Ó5¸Ñ<Ð<r"   c                  óœ   • [        5       (       d  g[        5       (       a  [        5       S:„  $ [        R                  R                  5       S:„  $ )z÷
Return a bool indicating if CUDA is currently available.

.. note:: This function will NOT poison fork if the environment variable
    ``PYTORCH_NVML_BASED_CUDA_CHECK=1`` is set. For more details, see
    :ref:`multiprocessing-poison-fork-note`.
Fr   )rj   rn   Údevice_countrh   ri   rf   r!   r"   r#   Úis_availablerq   ¡   s@   € ô �>‰>ØÜ×Ñô ‹~ Ñ!Ð!ô
 �x‰x×,Ñ,Ó.°Ñ2Ð2r"   Úincluding_emulationc                 ó   • [         R                  R                  (       a  g[        5       (       d  g[         R                  R                  5       n[         R                  R                  U5      R                  S:¼  a  gU (       d  g[        U5      $ )zQReturn a bool indicating if the current CUDA/ROCm device supports dtype bfloat16.TFé   )	rh   r%   Úhiprq   ÚcudaÚcurrent_deviceÚget_device_propertiesÚmajorÚ_check_bf16_tensor_supported)rr   rV   s     r#   Úis_bf16_supportedr{   ·   se   € ô ‡}�}××Øô �>‰>Øä�Z‰Z×&Ñ&Ó(€Fä‡z�z×'Ñ'¨Ó/×5Ñ5¸Ó:ØæØô (¨Ó/Ð/r"   é   )Úmaxsizec                 óp   •  [         R                  " S/[         R                  U S9  g! [         a     gf = f)Ng      ð?)ÚdtyperV   TF)rh   ÚtensorÚbfloat16Ú	Exceptionr\   s    r#   rz   rz   Î   s2   € ðÜ�Š�c�U¤%§.¡.¸Ò@ØøÜó Ùðús   ‚%( ¨
5´5c                  óÈ   • [         R                  R                  (       a;  [         R                  R	                  5       R
                  n SnU H
  nX ;   d  M
    g   g[        SS9$ )zMReturn a bool indicating if the current CUDA/ROCm device supports dtype tf32.)Úgfx94Úgfx95TF)rr   )rh   r%   ru   rv   rx   ÚgcnArchNamer{   )Ú	prop_nameÚarchsÚarchs      r#   Úis_tf32_supportedrŠ   ×   sQ   € ä‡}�}××Ü—J‘J×4Ñ4Ó6×BÑBˆ	Ø"ˆÛˆDØÕ Ùñ ð ô °Ñ7Ð7r"   c                 óB   • [         R                  R                  U 5        g rC   )rh   ri   Ú_cuda_sleep)Úcycless    r#   Ú_sleeprŽ   æ   s   € Ü	‡H�H×Ñ˜Õ r"   Úarch_stringc                 ó~   • U R                  SSS9S   nUR                  S5      R                  S5      n[        U5      $ )z4Extracts the architecture string from a CUDA versionÚ_é   )Úmaxsplitr   ÚaÚf)ÚsplitÚremovesuffixÚint)r�   Úbases     r#   Ú_extract_arch_versionrš   ê   sA   € à×Ñ˜S¨1ÐÐ-¨aÑ0€DØ×Ñ˜SÓ!×.Ñ.¨sÓ3€DÜˆt‹9Ðr"   c                   óB   • \ rS rSrSrS	S\\\      4S jjrS r	S r
Srg)
Ú_CompatIntervaléñ   z±
Defines a range of compute capabilities starting at a given
version and going up to the end of that major version. This
also allows excluding specific versions from the range.
NÚexcludec                 ób   • US-  US-  sU l         U l        Uc  [        5       U l        g UU l        g )Né
   )ry   ÚminorÚsetrž   )r7   Ústartrž   s      r#   r9   Ú_CompatInterval.__init__ø   s-   € Ø!&¨"¡¨e°b©jÐˆŒ
�D”JØ '¡”s“uˆ�°Wˆ�r"   c                 óz   • XR                   ;   a  gUS-  US-  p2X R                  :H  =(       a    X0R                  :¬  $ )NFr    ©rž   ry   r¡   )r7   ÚxÚx_majorÚx_minors       r#   Ú__contains__Ú_CompatInterval.__contains__ü   s7   € Ø—‘ÓØØ ™7 A¨¡F�ØŸ*™*Ñ$×>¨·J±JÑ)>Ð>r"   c                 óè   • SU R                    SU R                   SU R                   S-    S3n[        U R                  5      S:”  a+  SR	                  S U R                   5       5      nUS	U S
3-  nU$ )Nz>=Ú.z,<r   z.0r   ú, c              3   ó:   #   • U  H  oS -   SUS -   3v •  M     g7f©r    r­   Nr!   )Ú.0r§   s     r#   Ú	<genexpr>Ú*_CompatInterval.__str__.<locals>.<genexpr>  s!   é € Ð"OÂ,¸Q¨2¡g Y¨a°°B±¨xÕ#8Â,ùó   ‚z	 except {Ú})ry   r¡   Úlenrž   r5   )r7   ÚresultÚ
exceptionss      r#   Ú__str__Ú_CompatInterval.__str__  sn   € Ø�d—j‘j�\  4§:¡: ,¨b°·±¸a±Ð0@ÀÐCˆÜˆt�|‰|Ó˜qÓ ØŸ™Ñ"OÀ$Ç,Â,Ó"OÓOˆJØ˜
 : ,¨bÐ1Ñ1ˆFØˆr"   r¦   rC   )rN   rO   rP   rQ   Ú__doc__r   r¢   r˜   r9   rª   r¹   rS   r!   r"   r#   rœ   rœ   ñ   s&   † ññ= x°°C±Ñ'9õ =ò?õr"   rœ   c                   ó8   • \ rS rSrSrS\\   4S jrS rS r	Sr
g)	Ú
_CompatSeti
  zŠ
A set of compute capabilities. It exists primarily to support custom
printing logic and is otherwise equivalent to a plain python set().
Úvaluesc                 ó   • Xl         g rC   ©r¾   )r7   r¾   s     r#   r9   Ú_CompatSet.__init__  s   € Ø�r"   c                 ó   • XR                   ;   $ rC   rÀ   )r7   r§   s     r#   rª   Ú_CompatSet.__contains__  s   € Ø—K‘KÑÐr"   c                 óR   • SSR                  S U R                   5       5      -   S-   $ )NÚ{r®   c              3   ó:   #   • U  H  oS -   SUS -   3v •  M     g7fr°   r!   )r±   Úvs     r#   r²   Ú%_CompatSet.__str__.<locals>.<genexpr>  s!   é € ÐJºk¸ r¡' ¨!¨A°©F¨8Õ4ºkùr´   rµ   )r5   r¾   rD   s    r#   r¹   Ú_CompatSet.__str__  s%   € Ø�T—Y‘YÑJ¸d¿kºkÓJÓJÑJÈSÑPÐPr"   rÀ   N)rN   rO   rP   rQ   r»   r¢   r˜   r9   rª   r¹   rS   r!   r"   r#   r½   r½   
  s"   † ñð
˜s 3™xô ò õQr"   r½   é2   é5   )r£   rž   é4   é<   é>   é=   éF   éH   éK   ©r£   éP   éW   éV   éY   éZ   éd   ée   én   ég   éx   éy   )rÛ   rÝ   rÞ   ÚDEVICE_REQUIREMENT>   rÊ   rÍ   rÐ   rÔ   rÖ   rØ   >   rÐ   rÔ   rÖ   rØ   rÙ   rÝ   >   rÒ   rÔ   rÖ   rØ   rÙ   rÛ   rÝ   )z12.6z12.8z13.0ÚPYTORCH_RELEASES_CODE_CCÚ	device_ccÚcode_ccc                 ó�   • U[         ;  a1  [        R                  " SUS-   SUS-   S3S-   SS9  U [        US9;   $ U [         U   ;   $ )	Nz8PyTorch was compiled with an unknown compute capability r    r­   z. zH Please create an issue on Github if this is a valid compute capability.r’   ©Ú
stacklevelrÓ   )rß   ÚwarningsÚwarnrœ   )rá   râ   s     r#   Ú_code_compatible_with_devicerè   C  sg   € ØÔ(Ó(Ü�ŠØFÀwÐRTÁ}ÀoÐUVÐW^ÐacÑWcÐVdÐdfÐgØXñYàò	
ð
 œO°'Ñ:Ñ:Ð:ØÔ*¨7Ñ3Ñ3Ð3r"   Údevice_indexÚcode_ccsc                 óö  ^• [        U 5      n/ n[        R                  5        H2  u  pV[        U4S jU 5       5      (       d  M!  UR	                  U5        M4     SU  SU STS-   STS-   S3	S/U Vs/ s H  nSUS-   SUS-   S	[
        U    3PM     sn-   n[        U5      S
:”  a(  SR                  U5      n	UR	                  SSU	 3-   5        [        R                  " SR                  U5      SS9  g s  snf )Nc              3   ó<   >#   • U  H  n[        TU5      v •  M     g 7frC   ©rè   )r±   Úccrá   s     €r#   r²   Ú)_warn_unsupported_code.<locals>.<genexpr>S  s   øé € ÐOÂY¸rÔ+¨I°r×:Ð:ÂYùó   ƒz	Found GPUÚ z% which is of compute capability (CC) r    r­   zhThe following list shows the CCs this version of PyTorch was built for and the hardware CCs it supports:z- z which supports hardware CC r   r®   zNPlease follow the instructions at https://pytorch.org/get-started/locally/ to zDinstall a PyTorch release that supports one of these CUDA versions: Ú
r’   rä   )
Úget_device_namerà   ÚitemsÚanyÚappendrß   r¶   r5   ræ   rç   )
ré   rá   rê   r;   Úcompatible_releasesrv   Ú	build_ccsrî   ÚlinesÚreleases_strs
    `        r#   Ú_warn_unsupported_coderû   N  s&  ø€ Ü˜<Ó(€Dà%'ÐÜ3×9Ñ9Ö;‰ˆÜÔOÁYÓO×OÓOØ×&Ñ& tÖ,ñ <ð
 �L�>  4 &Ð(MÈiÐ[]ÉoÐM^Ð^_Ð`iÐlnÑ`nÐ_oÐopÐqØrðñ
 ó	âˆBð ˆR�2‰XˆJ�a˜˜R™�yÐ <Ô=OÐPRÑ=SÐ<TÓUÙñ	ñ€Eô ÐÓ !Ó#Ø—y‘yÐ!4Ó5ˆØ�‰Ø\ØTÐUaÐTbÐcñdô	
ô
 ‡M‚M�$—)‘)˜EÓ"¨qÓ1ùò	s   Á3"C6c                  ó>  ^• [         R                  R                  c  g [        5        V s/ s H  n [	        U 5      PM     nn [        [        5       5       HA  n[        U5      u  p4SU-  U-   m[        U4S jU 5       5      (       a  M4  [        UTU5        MC     g s  sn f )Nr    c              3   ó<   >#   • U  H  n[        TU5      v •  M     g 7frC   rí   )r±   râ   rá   s     €r#   r²   Ú$_check_capability.<locals>.<genexpr>p  s   øé € ð 
ÚLTÀÔ(¨°G×<Ð<ÊHùrð   )
rh   r%   rv   Úget_arch_listrš   Úrangerp   Úget_device_capabilityrõ   rû   )rî   rê   Údry   r¡   rá   s        @r#   Ú_check_capabilityr  h  s‹   ø€ Ü‡}�}×ÑÑ!Øä4A´OÓD²O¨bÔ% bÖ)±O€HÐDÜ”<“>Ö"ˆÜ,¨QÓ/‰ˆØ˜‘J Ñ&ˆ	Üô 
ÙLTó
÷ 
ó 
ô # 1 i°Ö:ò #ùò Es   ªBc            
      óâ  ^	• Sn [         R                  R                  c  g [        5       n[	        U5      S:X  a  g U Vs/ s H  nSU;   d  M  [        U5      PM     nn[        [        5       5       Hw  n[        U5      u  m	n[        U	4S jU 5       5      nU(       a  M/  [        U5      nT	S-  U-   n[        R                  " U R                  XxSR                  U5      U5      SS9  My     g s  snf )	Na	  
{} with CUDA capability sm_{} is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities {}.
If you want to use the {} GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
r   Úsm_c              3   ó2   >#   • U  H  oS -  T:H  v •  M     g7f)r    Nr!   )r±   ÚsmÚ	cap_majors     €r#   r²   Ú _check_cubins.<locals>.<genexpr>…  s   øé € ÐEº°"˜b™ IÖ-ºùs   ƒr    rñ   r’   rä   )rh   r%   rv   rÿ   r¶   rš   r   rp   r  rõ   ró   ræ   rç   Úformatr5   )
Úincompatible_device_warnÚ	arch_listr‰   Úsupported_smÚidxÚ	cap_minorÚ	supportedÚdevice_nameÚ
capabilityr  s
            @r#   Ú_check_cubinsr  v  sÜ   ø€ ð Ðô
 ‡}�}×ÑÑ!ØÜ“€IÜ
ˆ9ƒ~˜ÓØÙ<EÓWºI°DÈÐRVÉÓ/Ô)¨$Ö/¹I€LÐWÜ”\“^Ö$ˆÜ4°SÓ9Ñˆ	�9äÔE¹ÓEÓEˆ	ßˆyÜ)¨#Ó.ˆKØ" R™¨)Ñ3ˆJÜ�MŠMØ(×/Ñ/Ø¨S¯X©X°iÓ-@À+óð ô	ò %ùò Xs   ¾
C,ÁC,c                  ó:   • [         =(       a    [        5       (       + $ )z9Return whether PyTorch's CUDA state has been initialized.)Ú_initializedÚ_is_in_bad_forkr!   r"   r#   Úis_initializedr  ‘  s   € ä×1¤Ó 1Ô1Ð1r"   c                 óÊ  • [            [        5       (       a  U " 5         O¬UR                  SS5      (       a*  [        R	                  U [
        R                  " 5       5        OkUR                  SS5      (       a*  [        R                  U [
        R                  " 5       5        O*[        R                  U [
        R                  " 5       45        S S S 5        g ! , (       d  f       g = f)NÚseed_allFÚseed)
Ú_initialization_lockr  ÚgetÚ_lazy_seed_trackerÚqueue_seed_allrI   Úformat_stackÚ
queue_seedr   rö   )Úcallabler=   s     r#   Ú
_lazy_callr"  –  s“   € Þ	Ü×ÑÙ�Jð �z‰z˜* e×,Ñ,Ü"×1Ñ1°(¼I×<RÒ<RÓ<TÕUØ—‘˜F E×*Ñ*Ü"×-Ñ-¨h¼	×8NÒ8NÓ8PÕQô ×$Ñ$ h´	×0FÒ0FÓ0HÐ%IÔJ÷ 
×	Ö	ús   ‡CCÃ
C"c                   ó   • \ rS rSrSrg)ÚDeferredCudaCallErrori¬  r!   N)rN   rO   rP   rQ   rS   r!   r"   r#   r$  r$  ¬  s   † Úr"   r$  c                  ó   • [        5         g)aŽ  Initialize PyTorch's CUDA state.

You may need to call this explicitly if you are interacting with
PyTorch via its C API, as Python bindings for CUDA functionality
will not be available until this initialization takes place.
Ordinary users should not need this, as all of PyTorch's CUDA methods
automatically initialize CUDA state on-demand.

Does nothing if the CUDA state is already initialized.
N)Ú
_lazy_initr!   r"   r#   Úinitr'  ´  s	   € ô …Lr"   c            	      ó  • [        5       (       d  [        [        S5      (       a  g [           [        5       (       a
   S S S 5        g [	        5       (       a  [        S5      e[        [        R                  S5      (       d  [        S5      e[        c  [        S5      e[        R                  R                  5         S[        l        [        R                  S [        R                  5        5       5         [         H  u  p U " 5         M     [)        [        S5        SqS S S 5        g ! [          a1  nS[#        U5       S	S
R%                  U5       3n['        U5      UeS nAff = f! [)        [        S5        f = f! , (       d  f       g = f)NÚis_initializingzwCannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start methodrf   z$Torch not compiled with CUDA enabledzGlibcudart functions unavailable. It looks like you have a broken build?Tc              3   ó6   #   • U  H  o(       d  M  Uv •  M     g 7frC   r!   )r±   Úcallss     r#   r²   Ú_lazy_init.<locals>.<genexpr>ä  s   é € ÐXÒ0N uÓRWŸU™UÒ0Nùs   ‚
�	z6CUDA call failed lazily at initialization with error: z(

CUDA call was originally invoked at:

Ú )r  rg   Ú_tlsr  r  r[   rh   ri   ÚAssertionErrorr   Ú
_cuda_initr)  r   Úextendr  Ú	get_callsr‚   rR   r5   r$  Údelattrr  )Úqueued_callÚorig_tracebackÚeÚmsgs       r#   r&  r&  Â  sb  € ä×Ñœ7¤4Ð):×;Ñ;ØÞ	ô ×ÑØ÷ 
Ð	ô ×ÑÜðIóð ô ”u—x‘xÐ!7×8Ñ8Ü Ð!GÓHÐHÜ‰?Ü ØYóð ô
 	�‰×ÑÔð  $ŒÔä×ÑÑXÔ0B×0LÑ0LÔ0NÓXÔXð	-ß/<Ñ+�ð<Ù–Mñ 0=ô ”DÐ+Ô,Øˆ÷Y 
Ð	øôH !ó <àPÔQTÐUVÓQWÐPXð YCØCEÇ7Á7È>ÓCZÐB[ð]ð ô 0°Ó4¸!Ð;ûð<ûô ”DÐ+Õ,ú÷W 
Õ	úsN   ¬E9ÁB-E9Ã4E$Ä D&ÄE$ÄE9Ä&
E!Ä0,EÅE!Å!E$Å$E6Å6E9Å9
Fc                  ó"   • [        5         [        $ )aP  Retrieves the CUDA runtime API module.


This function initializes the CUDA runtime environment if it is not already
initialized and returns the CUDA runtime API module (_cudart). The CUDA
runtime API module provides access to various CUDA runtime functions.

Args:
    ``None``

Returns:
    module: The CUDA runtime API module (_cudart).

Raises:
    RuntimeError: If CUDA cannot be re-initialized in a forked subprocess.
    AssertionError: If PyTorch is not compiled with CUDA support or if libcudart functions are unavailable.

Example of CUDA operations with profiling:
    >>> import torch
    >>> from torch.cuda import cudart, check_error
    >>> import os
    >>>
    >>> os.environ["CUDA_PROFILE"] = "1"
    >>>
    >>> def perform_cuda_operations_with_streams():
    >>>     stream = torch.cuda.Stream()
    >>>     with torch.cuda.stream(stream):
    >>>         x = torch.randn(100, 100, device='cuda')
    >>>         y = torch.randn(100, 100, device='cuda')
    >>>         z = torch.mul(x, y)
    >>>     return z
    >>>
    >>> torch.cuda.synchronize()
    >>> print("====== Start nsys profiling ======")
    >>> check_error(cudart().cudaProfilerStart())
    >>> with torch.autograd.profiler.emit_nvtx():
    >>>     result = perform_cuda_operations_with_streams()
    >>>     print("CUDA operations completed.")
    >>> check_error(torch.cuda.cudart().cudaProfilerStop())
    >>> print("====== End nsys profiling ======")

To run this example and save the profiling information, execute:
    >>> $ nvprof --profile-from-start off --csv --print-summary -o trace_name.prof -f -- python cudart_test.py

This command profiles the CUDA operations in the provided script and saves
the profiling information to a file named `trace_name.prof`.
The `--profile-from-start off` option ensures that profiling starts only
after the `cudaProfilerStart` call in the script.
The `--csv` and `--print-summary` options format the profiling output as a
CSV file and print a summary, respectively.
The `-o` option specifies the output file name, and the `-f` option forces the
overwrite of the output file if it already exists.
)r&  r   r!   r"   r#   Úcudartr9  õ  s   € ôl „LÜ€Nr"   c                   ó2   • \ rS rSr% Sr\\S'   Sr\\S'   Srg)Ú
cudaStatusi/  r   ÚSUCCESSé"   ÚERROR_NOT_READYr!   N)	rN   rO   rP   rQ   r<  r˜   Ú__annotations__r>  rS   r!   r"   r#   r;  r;  /  s   ‡ Ø€GˆSÓØ€O�SÖr"   r;  c                   ó4   ^ • \ rS rSrS\SS4U 4S jjrSrU =r$ )Ú	CudaErrori4  Úcoder*   Nc                 ó„   >• [         R                  " [         R                  " U5      5      n[        TU ]  U SU S35        g )Nz (Ú))r   ÚcudaGetErrorStringÚ	cudaErrorÚsuperr9   )r7   rB  r7  Ú	__class__s      €r#   r9   ÚCudaError.__init__5  s8   ø€ ä×(Ò(¬×):Ò):¸4Ó)@ÓAˆÜ‰Ñ˜C˜5  4 &¨Ð*Õ+r"   r!   )rN   rO   rP   rQ   r˜   r9   rS   Ú__classcell__©rH  s   @r#   rA  rA  4  s   ø† ð,˜Sð , T÷ ,õ ,r"   rA  Úresc                 óV   • U [         R                  R                  :w  a  [        U 5      eg)zGRaise an error if the result of a CUDA runtime API call is not success.N)r   rF  ÚsuccessrA  )rL  s    r#   Úcheck_errorrO  ;  s'   € ð Œg×Ñ×'Ñ'Ó'Ü˜‹nÐð (r"   c                   ó>   • \ rS rSrS\4S jrS rS\S\S\4S jrS	r	g
)Ú_DeviceGuardiB  Úindexc                 ó   • Xl         SU l        g ©NrY   ©r  Úprev_idx)r7   rR  s     r#   r9   Ú_DeviceGuard.__init__C  s   € ØŒØˆ�r"   c                 ó`   • [         R                  R                  U R                  5      U l        g rC   ©rh   rv   r]   r  rV  rD   s    r#   rE   Ú_DeviceGuard.__enter__G  ó   € ÜŸ
™
×3Ñ3°D·H±HÓ=ˆ�r"   rG   rH   rI   c                 ó`   • [         R                  R                  U R                  5      U l        gr    ©rh   rv   ra   rV  r  rK   s       r#   rL   Ú_DeviceGuard.__exit__J  ó   € Ü—:‘:×4Ñ4°T·]±]ÓCˆŒØr"   rU  N)
rN   rO   rP   rQ   r˜   r9   rE   r   rL   rS   r!   r"   r#   rQ  rQ  B  s-   † ð˜cô ò>ð˜Sð ¨ð ¸÷ r"   rQ  c                   óB   • \ rS rSrSrS \4S jrS rS\S\S\4S jrS	r	g
)rV   iO  z¼Context-manager that changes the selected device.

Args:
    device (torch.device or int): device index to select. It's a no-op if
        this argument is a negative integer or ``None``.
c                 ó0   • [        USS9U l        SU l        g )NT©ÚoptionalrY   )r   r  rV  )r7   rV   s     r#   r9   Údevice.__init__W  s   € Ü$ V°dÑ;ˆŒØˆ�r"   c                 ó`   • [         R                  R                  U R                  5      U l        g rC   rY  rD   s    r#   rE   Údevice.__enter__[  r[  r"   rG   rH   rI   c                 ó`   • [         R                  R                  U R                  5      U l        gr    r]  rK   s       r#   rL   Údevice.__exit__^  r_  r"   rU  N)
rN   rO   rP   rQ   r»   r   r9   rE   rL   rS   r!   r"   r#   rV   rV   O  s2   † ñð˜sô ò>ð˜Sð ¨ð ¸÷ r"   c                   ó,   ^ • \ rS rSrSrU 4S jrSrU =r$ )Ú	device_ofic  a	  Context-manager that changes the current device to that of given object.

You can use both tensors and storages as arguments. If a given object is
not allocated on a GPU, this is a no-op.

Args:
    obj (Tensor or Storage): object allocated on the selected device.
c                 ój   >• UR                   (       a  UR                  5       OSn[        TU ]  U5        g rT  )Úis_cudaÚ
get_devicerG  r9   )r7   Úobjr  rH  s      €r#   r9   Údevice_of.__init__m  s$   ø€ Ø"%§+§+ˆc�n‰nÔ°2ˆÜ‰Ñ˜Õr"   r!   )rN   rO   rP   rQ   r»   r9   rS   rJ  rK  s   @r#   rj  rj  c  s   ø† ñ÷ó r"   rj  c                 óf   • [        U 5      n U S:¼  a   [        R                  R                  U 5        gg)a%  Set the current device.

Usage of this function is discouraged in favor of :any:`device`. In most
cases it's better to use ``CUDA_VISIBLE_DEVICES`` environmental variable.

Args:
    device (torch.device or int): selected device. This function is a no-op
        if this argument is negative.
r   N)r   rh   ri   Ú_cuda_setDevicer\   s    r#   Ú
set_devicerr  r  s,   € ô ˜vÓ&€FØ�ƒ{Ü�‰× Ñ  Õ(ð r"   c                 ó,   • [        U 5      R                  $ )an  Get the name of a device.

Args:
    device (torch.device or int or str, optional): device for which to return the
        name. This function is a no-op if this argument is a negative
        integer. It uses the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).

Returns:
    str: the name of the device
)rx   r;   r\   s    r#   ró   ró   �  s   € ô ! Ó(×-Ñ-Ð-r"   c                 óH   • [        U 5      nUR                  UR                  4$ )aµ  Get the cuda capability of a device.

Args:
    device (torch.device or int or str, optional): device for which to return the
        device capability. This function is a no-op if this argument is
        a negative integer. It uses the current device, given by
        :func:`~torch.cuda.current_device`, if :attr:`device` is ``None``
        (default).

Returns:
    tuple(int, int): the major and minor cuda capability of the device
)rx   ry   r¡   )rV   Úprops     r#   r  r  �  s!   € ô ! Ó(€DØ�:‰:�t—z‘zÐ!Ð!r"   c                 ó~   • [        5         [        U SS9n U S:  d  U [        5       :¼  a  [        S5      e[	        U 5      $ )a`  Get the properties of a device.

Args:
    device (torch.device or int or str, optional): device for which to return the
        properties of the device.  It uses the current device, given by
        :func:`~torch.cuda.current_device`, if :attr:`device` is ``None``
        (default).

Returns:
    _CudaDeviceProperties: the properties of the device
Trb  r   úInvalid device id)r&  r   rp   r/  Ú_get_device_propertiesr\   s    r#   rx   rx   ¢  s<   € ô „LÜ˜v°Ñ5€FØ�ƒz�Vœ|›~Ó-ÜÐ0Ó1Ð1Ü! &Ó)Ð)r"   Úpeer_devicec                 óú   • [        5         [        U SS9n [        U5      nU S:  d  U [        5       :¼  a  [        S5      eUS:  d  U[        5       :¼  a  [        S5      e[        R
                  R                  X5      $ )z5Check if peer access between two devices is possible.Trb  r   rw  zInvalid peer device id)r&  r   rp   r/  rh   ri   Ú_cuda_canDeviceAccessPeer)rV   ry  s     r#   Úcan_device_access_peerr|  µ  sj   € ä„LÜ˜v°Ñ5€FÜ# KÓ0€KØ�ƒz�Vœ|›~Ó-ÜÐ0Ó1Ð1Ø�Qƒ˜+¬«Ó7ÜÐ5Ó6Ð6Ü�8‰8×-Ñ-¨fÓBÐBr"   c                   óZ   • \ rS rSr% Sr\S   \S'   S\S   4S jrS rS\	S	\	S
\	4S jr
Srg)ÚStreamContextiÁ  a  Context-manager that selects a given stream.

All CUDA kernels queued within its context will be enqueued on a selected
stream.

Args:
    Stream (Stream): selected stream. This manager is a no-op if it's
        ``None``.
.. note:: Streams are per-device.
útorch.cuda.StreamÚ
cur_streamÚstreamc                 óÐ  • Xl         [        S S5      U l        [        R                  R                  5       (       d  U R                  c  SU l        [        R                  R                  5       (       d  S O[        R                  R                  S 5      U l        [        R                  R                  5       (       d  S U l	        g [        R                  R                  S 5      U l	        g )NTrY   )
r�  r   r  rh   ÚjitÚis_scriptingrv   Údefault_streamÚsrc_prev_streamÚdst_prev_stream)r7   r�  s     r#   r9   ÚStreamContext.__init__Ï  s¤   € ØŒÜ$ T¨4Ó0ˆŒÜ�y‰y×%Ñ%×'Ñ'Ø�x‰xÑà�”ô Ÿ	™	×.Ñ.×0Ñ0‰D´e·j±j×6OÑ6OÐPTÓ6Uð 	Ôô Ÿ	™	×.Ñ.×0Ñ0ˆDð 	ÕÜ6;·j±j×6OÑ6OÐPTÓ6Uð 	Õr"   c                 óÌ  • U R                   nUb  U R                  S:X  a  g [        R                  R	                  S 5      U l        U R
                  R                  UR                  :w  aL  [        UR                  5         [        R                  R	                  UR                  5      U l        S S S 5        [        R                  R                  U5        g ! , (       d  f       N.= frT  )	r�  r  rh   rv   Úcurrent_streamr†  rV   r‡  Ú
set_stream)r7   r€  s     r#   rE   ÚStreamContext.__enter__Þ  sœ   € à—[‘[ˆ
àÑ §¡¨R£ØÜ$Ÿz™z×8Ñ8¸Ó>ˆÔð ×Ñ×&Ñ&¨*×*;Ñ*;Ó;Ü˜
×)Ñ)Õ*Ü',§z¡z×'@Ñ'@À×ARÑARÓ'S�Ô$÷ +ä�
‰
×Ñ˜jÕ)÷ +Õ*ús   Á>/CÃ
C#rG   rH   rI   c                 ó0  • U R                   nUb  U R                  S:X  a  g U R                  R                  UR                  :w  a)  [        R
                  R                  U R                  5        [        R
                  R                  U R                  5        g rT  )r�  r  r†  rV   rh   rv   r‹  r‡  )r7   rG   rH   rI   r€  s        r#   rL   ÚStreamContext.__exit__í  sj   € à—[‘[ˆ
àÑ §¡¨R£Øð ×Ñ×&Ñ&¨*×*;Ñ*;Ó;Ü�J‰J×!Ñ! $×"6Ñ"6Ô7Ü�
‰
×Ñ˜d×2Ñ2Õ3r"   )r‡  r  r†  r�  N)rN   rO   rP   rQ   r»   r   r?  r9   rE   r   rL   rS   r!   r"   r#   r~  r~  Á  sF   ‡ ñ	ð Ð,Ñ-Ó-ð
˜xÐ(;Ñ<ô 
ò*ð4˜Sð 4¨ð 4¸÷ 4r"   r~  r�  r  c                 ó   • [        U 5      $ )a>  Wrap around the Context-manager StreamContext that selects a given stream.

Arguments:
    stream (Stream): selected stream. This manager is a no-op if it's
        ``None``.
.. note::
    In eager mode stream is of type Stream class while in JIT it is
    an object of the custom class ``torch.classes.cuda.Stream``.
)r~  ©r�  s    r#   r�  r�  û  s   € ô ˜Ó Ð r"   c                 óB   • [         R                  R                  U UUS9  g)zÒset stream specified by the stream id, device index and
    device type

Args: stream_id (int): stream id in stream pool
      device_index (int): device index in topo
      device_type (int): enum device type
©Ú	stream_idré   Údevice_typeN)rh   ri   Ú_cuda_setStreamr’  s      r#   Ú_set_stream_by_idr–    s$   € ô 
‡H�H×ÑØØ!Øð ò r"   c                 ó^   • U c  g[        U R                  U R                  U R                  S9  g)a  Set the current stream. This is a wrapper API to set the stream.
    Usage of this function is discouraged in favor of the ``stream``
    context manager.

Args:
    stream (Stream): selected stream. This function is a no-op
        if this argument is ``None``.
Nr’  )r–  r“  ré   r”  r�  s    r#   r‹  r‹    s/   € ð �~ØÜØ×"Ñ"Ø×(Ñ(Ø×&Ñ&ór"   c                  ój  • [         R                  " S5      n [        R                  R                  (       a‘  [         R                  " S5      n[         R                  " S5      nUb]  [        UR                  S5      5      nUb,  [        UR                  S5      5      U:”  a  [        S5      eUn O[        [        U5      5      $ Ub  Un U c  [        [        S5      5      $ S[        S[        4S	 jnS
[        S[        S[        [           4S jnU R                  S5      (       a	  U" U S5      $ U R                  S5      (       a	  U" U S5      $ / nU R                  S5       HQ  nU" UR                  5       5      nX†;   a  [        [        [           / 5      s  $ US:  a    U$ UR                  U5        MS     U$ )z0Parse CUDA_VISIBLE_DEVICES environment variable.ÚCUDA_VISIBLE_DEVICESÚHIP_VISIBLE_DEVICESÚROCR_VISIBLE_DEVICESÚ,zCHIP_VISIBLE_DEVICES contains more devices than ROCR_VISIBLE_DEVICESé@   Úsr*   c                 óÞ   • U (       d  g[        U 5       HA  u  pUR                  5       (       d  US:X  a  US;   d    OUS-   [        U 5      :X  d  M<  US-  nMC     WS:”  a  [        U SU 5      $ S$ )z:Return -1 or positive integer sequence string starts with.rY   r   z+-r   N)Ú	enumerateÚisdigitr¶   r˜   )rž  r  Úcs      r#   Ú_strtoulÚ(_parse_visible_devices.<locals>._strtoulG  sh   € æØÜ –l‰FˆCØ—I‘I—K‘K C¨1£H°°d³ÙØ�Q‰wœ#˜a›&Õ Ø�q‘’ñ	 #ð
  # Q›wŒs�1�T�c�7‹|Ð.¨BÐ.r"   ÚlstÚprefixc                 óÊ   • / nU R                  S5       HK  nX2;   a  [        [        [           / 5      s  $ UR	                  U5      (       d    U$ UR                  U5        MM     U$ )Nrœ  )r–   r   ÚlistrR   Ú
startswithrö   )r¥  r¦  ÚrcsÚelems       r#   Úparse_list_with_prefixÚ6_parse_visible_devices.<locals>.parse_list_with_prefixR  s[   € ØˆØ—I‘I˜c–NˆDà‹{ÜœD¤™I rÓ*Ò*à—?‘? 6×*Ñ*Øàˆ
ð �J‰J�tÖñ #ð ˆ
r"   úGPU-úMIG-r   )r2   r3   rh   r%   ru   r¶   r–   r[   r¨  r   rR   r˜   r©  Ústripr   rö   )	ÚvarÚhip_devicesÚrocr_devicesÚ
rocr_countr£  r¬  Úrcr«  r§   s	            r#   Ú_parse_visible_devicesr¶  )  s‰  € ä
�)Š)Ð*Ó
+€Cä‡}�}××Ü—i’iÐ 5Ó6ˆÜ—y’yÐ!7Ó8ˆð Ñ#Ü˜\×/Ñ/°Ó4Ó5ˆJØÑ&ä�{×(Ñ(¨Ó-Ó.°Ó;Ü&Ø]óð ð "‘äœE *Ó-Ó.Ð.ØÑ$ØˆCà
�{Ü”E˜"“I‹Ðð	/”Cð 	/œCô 	/ð
¤Cð 
´ð 
¼¼c¹ô 
ð ‡~�~�f×ÑÙ% c¨6Ó2Ð2Ø
‡~�~�f×ÑÙ% c¨6Ó2Ð2ð €BØ—	‘	˜#–ˆÙ�T—Z‘Z“\Ó"ˆà‹7ÜœœS™	 2Ó&Ò&àˆq‹5Øà€Ið 	�	‰	�!Žñ ð €Ir"   c                  ó  • [         (       d  g [        R                  " 5         [        R                  " 5       n[        U5      $ ! [        R                   a,  n [        R
                  " SU R                   3SS9   S n A gS n A ff = f)NrY   z&Can't initialize amdsmi - Error code: r’   rä   )	Ú_HAS_PYNVMLÚamdsmiÚamdsmi_initÚAmdSmiExceptionræ   rç   Úerr_codeÚamdsmi_get_processor_handlesr¶   )r6  Úsocket_handless     r#   Ú_raw_device_count_amdsmir¿  q  so   € ßŠ;ØðÜ×ÒÔô ×8Ò8Ó:€NÜˆ~ÓÐøô ×!Ñ!ó Ü�ŠØ4°Q·Z±Z°LÐAÈaò	
ô ûð	ús   ŽA ÁBÁ"A>Á>Bc                  ó  • SSK Jn JnJn  U" S5      nUR	                  5       nUS:w  a  [
        R                  " SSS9  gU" S5      nUR                  U " U5      5      nUS:w  a  [
        R                  " SSS9  gAUR                  $ )	zgReturn number of devices as reported by NVML or negative value if NVML discovery/initialization failed.r   )ÚbyrefÚc_intr0   úlibnvidia-ml.so.1úCan't initialize NVMLr’   rä   rY   úCan't get nvml device count)	r/   rÁ  rÂ  r0   ÚnvmlInitræ   rç   ÚnvmlDeviceGetCount_v2rH   )rÁ  rÂ  r0   Únvml_hrµ  Ú	dev_counts         r#   Ú_raw_device_count_nvmlrÊ    s|   € ç)Ñ)áÐ%Ó&€FØ	�‰Ó	€BØ	ˆQƒwÜ�ŠÐ-¸!Ò<ØÙ�b“	€IØ	×	%Ñ	%¡e¨IÓ&6Ó	7€BØ	ˆQƒwÜ�ŠÐ3ÀÒBØØØ�?‰?Ðr"   c                  ó  • SSK Jn JnJnJnJn  [        (       d  g  [        R                  " 5          [        R                  " 5       n[        U5      n/ n[        U5       Ha  n [        R                  " 5       U   n	 [        R                  " U	5      S   SS  n
UR!                  [#        U
5      R%                  5       5        Mc     U$ ! [        R                   a    [        R                  " SSS9   g f = f! [        R                   a    [        R                  " SSS9   g f = f! [        R                   a    [        R                  " SSS9     g f = f! [        R                   a    [        R                  " S	SS9     g f = f)
Nr   ©rÁ  rÂ  Úc_void_pr0   Úcreate_string_bufferzCan't initialize amdsmir’   rä   zCan't get amdsmi device countzCannot get amd device handlerÚasic_serialzCannot get uuid for amd device)r/   rÁ  rÂ  rÍ  r0   rÎ  r¸  r¹  rº  r»  ræ   rç   r½  r¶   r   Úamdsmi_get_gpu_asic_inforö   rR   Úlower)rÁ  rÂ  rÍ  r0   rÎ  r¾  rÉ  Úuuidsr  ÚhandlerÚuuids              r#   Ú_raw_device_uuid_amdsmirÕ  ‘  sT  € ßIÕIçŠ;ØðÜ×ÒÔðÜ×<Ò<Ó>ˆÜ˜Ó'ˆ	ð €EÜ�YÖˆð	Ü×9Ò9Ó;¸CÑ@ˆGð	Ü×2Ò2°7Ó;¸MÑJØ�ðˆDð 	�‰Ü�‹I�O‰OÓö	
ñ  ð  €Løô5 ×!Ñ!ó Ü�ŠÐ/¸AÒ>Ùðûô ×!Ñ!ó Ü�ŠÐ5À!ÒDÙðûô ×%Ñ%ó 	Ü�MŠMÐ9ÀaÒHÚð	ûô ×%Ñ%ó 	Ü�MŠMÐ:ÀqÒIÚð	úsF   œC ² C5 Á#D$Á<EÃ)C2Ã1C2Ã5)D!Ä D!Ä$)EÅEÅ)FÆ Fc                  ó˜  • SSK Jn JnJnJnJn  U" S5      nUR                  5       nUS:w  a  [        R                  " SSS9  gU" S5      nUR                  U " U5      5      nUS:w  a  [        R                  " S	SS9  g/ n[        UR                  5       H°  n	U" 5       n
UR                  X�" U
5      5      nUS:w  a  [        R                  " S
SS9    gSnU" U5      nUR                  X¬U5      nUS:w  a  [        R                  " SSS9    gUR                  UR                  R!                  S5      R#                  S5      5        M²     AU$ )z^Return list of device UUID as reported by NVML or None if NVM discovery/initialization failed.r   rÌ  rÃ  rÄ  r’   rä   NrY   rÅ  zCan't get device handleé`   zCan't get device UUIDÚasciiÚ )r/   rÁ  rÂ  rÍ  r0   rÎ  rÆ  ræ   rç   rÇ  r   rH   ÚnvmlDeviceGetHandleByIndex_v2ÚnvmlDeviceGetUUIDrö   ÚrawÚdecoder°  )rÁ  rÂ  rÍ  r0   rÎ  rÈ  rµ  rÉ  rÒ  r  Údev_idÚbuf_lenÚbufs                r#   Ú_raw_device_uuid_nvmlrá  µ  s%  € çIÕIáÐ%Ó&€FØ	�‰Ó	€BØ	ˆQƒwÜ�ŠÐ-¸!Ò<ØÙ�b“	€IØ	×	%Ñ	%¡e¨IÓ&6Ó	7€BØ	ˆQƒwÜ�ŠÐ3ÀÒBØØ€EÜ�Y—_‘_Ö%ˆÙ“ˆØ×1Ñ1°#°u¸V³}ÓEˆØ�‹7Ü�MŠMÐ3ÀÒBÙØˆÙ" 7Ó+ˆØ×%Ñ% f°7Ó;ˆØ�‹7Ü�MŠMÐ1¸aÒ@ÙØ�‰�S—W‘W—^‘^ GÓ,×2Ñ2°4Ó8Ö9ñ &ð 	Ø€Lr"   Ú
candidatesrÒ  c                 ó<  • S[         S[        [            S[        4S jn/ nU  Hu  n[        R                  R
                  (       a  UR                  SSS5      nU" XA5      nUS:  a    U$ XS;   a  [        [        [           / 5      s  $ UR                  U5        Mw     U$ )	zqGiven the set of partial uuids and list of known uuids builds a set of ordinals excluding ambiguous partials IDs.Ú	candidaterÒ  r*   c                 óv   • Sn[        U5       H'  u  p4UR                  U 5      (       d  M  US:w  a    gUnM)     U$ rT  )r   r©  )rä  rÒ  Ú
best_matchr  rÔ  s        r#   Úuuid_to_ordinalÚ4_transform_uuid_to_ordinals.<locals>.uuid_to_ordinalØ  sB   € Øˆ
Ü" 5Ö)‰IˆCØ—?‘? 9×-Ñ-Ùà˜RÓÙØŠJñ *ð Ðr"   r®  r-  r   r   )	rR   r¨  r˜   rh   r%   ru   Úreplacer   rö   )râ  rÒ  rç  rµ  rä  r  s         r#   Ú_transform_uuid_to_ordinalsrê  Õ  sœ   € ð	¤3ð 	¬t´C©yð 	¼Sô 	ð €BÛˆ	Ü�=‰=××Ø!×)Ñ)Ø˜˜AóˆIñ ˜iÓ/ˆà�‹7Øð
 €Ið ‹9ÜœœS™	 2Ó&Ò&Ø
�	‰	�#Žñ  ð €Ir"   c                  ó~  • [        5       n U (       d  g [        U S   5      [        L a1  [        5       nUc  g[	        [
        [           U 5      n[        X!5      n O?[        5       nUS::  a  U$ [        U 5       H  u  pE[	        [        U5      U:¼  d  M  Us  $     [        U 5      $ ! [         a     g[         a     gf = f)Nr   rY   )r¶  rG   rR   rÕ  r   r¨  rê  r¿  r   r˜   r?   ÚAttributeErrorr¶   )Úvisible_devicesrÒ  Úvisible_device_strÚraw_cntr  Úvals         r#   Ú_device_count_amdsmirñ  ô  s¹   € Ü,Ó.€OÞØðÜ� Ñ"Ó#¤sÒ*Ü+Ó-ˆEØ‰}Øä!%¤d¬3¡i°Ó!AÐÜ9Ð:LÓT‰Oä.Ó0ˆGØ˜!‹|Ø�ô & oÖ6‘�äœ˜S“> WÕ,Ø’Jò 7ô ˆÓÐøô	 ó ÙÜó Ùðús4   ”"B$ ·"B$ ÁB$ Á,"B$ ÂB$ ÂB$ Â$
B<Â0	B<Â;B<c                  ó°  • [        5       n U (       d  g [        U S   5      [        L aJ  U S   R                  S5      (       a  g[	        5       nUc  g[        [        [        [           U 5      U5      n O?[        5       nUS::  a  U$ [        U 5       H  u  p4[        [        U5      U:¼  d  M  Us  $     [        U 5      $ ! [         a     g[         a     gf = f)z£Return number of devices as reported by NVML taking CUDA_VISIBLE_DEVICES into account.

Negative value is returned if NVML discovery or initialization has failed.
r   r¯  rY   )r¶  rG   rR   r©  rá  rê  r   r¨  rÊ  r   r˜   r?   rì  r¶   )rí  rÒ  rï  r  rð  s        r#   Ú_device_count_nvmlró    sÔ   € ô
 -Ó.€OÞØðÜ� Ñ"Ó#¤sÒ*à˜qÑ!×,Ñ,¨V×4Ñ4ØÜ)Ó+ˆEØ‰}ØÜ9Ü”Tœ#‘Y Ó0°%ó‰Oô -Ó.ˆGØ˜!‹|Ø�ô & oÖ6‘�äœ˜S“> WÕ,Ø’Jò 7ô ˆÓÐøô	 ó ÙÜó Ùðús;   ”.B= ÁB= Á!B= Á3B= Â"B= Â+B= Â/B= Â=
CÃ		CÃCc                 óJ  • [        U SS9n[        5       n[        US   5      [        L a9  [	        5       nUc  [        S5      e[        [        [        [           U5      U5      n[        [        [           U5      nUS:  d  U[        U5      :¼  a  [        SU SU S35      eX!   $ )zNReturn the NVML index of the device, taking CUDA_VISIBLE_DEVICES into account.Trb  r   úCan't get device UUIDsúdevice z& is not visible (CUDA_VISIBLE_DEVICES=rD  )r   r¶  rG   rR   rá  r[   rê  r   r¨  r˜   r¶   )rV   r  rí  rÒ  s       r#   Ú_get_nvml_device_indexr÷  5  s­   € ä
˜F¨TÑ
2€CÜ,Ó.€OÜˆO˜AÑÓ¤3Ò&Ü%Ó'ˆØ‰=ÜÐ7Ó8Ð8Ü5Ü””c‘˜OÓ,¨eó
ˆô œ4¤™9 oÓ6€OØ
ˆQƒw�#œ˜_Ó-Ó-ÜØ�c�UÐ@ÀÐ@QÐQRÐSó
ð 	
ð ÑÐr"   Ú_cached_device_countc                  ó  • [        5       (       d  g[        b  [        $ [        R                  R                  (       a
  [        5       O	[        5       n U S:  a  [        R                  R                  5       OU n[        (       a  UqU$ )z­
Return the number of GPUs available.

.. note:: This API will NOT poison fork if NVML discovery succeeds.
    See :ref:`multiprocessing-poison-fork-note` for more details.
r   )
rj   rø  rh   r%   ru   rñ  ró  ri   rf   r  )Ú
nvml_countÚrs     r#   rp   rp   K  sa   € ô �>‰>ØÜÑ'Ü#Ð#ä+0¯=©=×+<×+<Ô%Ô'ÔBTÓBV€JØ+5¸«>Œ�‰×%Ñ%Ô'¸z€A÷ ‚|Ø ÐØ€Hr"   c                  óŠ   • [        5       (       d  / $ [        R                  R                  5       n U c  / $ U R	                  5       $ )z=Return list CUDA architectures this library was compiled for.)rq   rh   ri   Ú_cuda_getArchFlagsr–   )Ú
arch_flagss    r#   rÿ   rÿ   b  s:   € ä�>‰>Øˆ	Ü—‘×,Ñ,Ó.€JØÑØˆ	Ø×ÑÓÐr"   c                  óê   • [        5       n [        U 5      S:X  a  gU  Vs/ s H  oR                  S5      PM     nnSR                  U VVs/ s H  u  p1SU SU SU 3PM     snn5      $ s  snf s  snnf )z9Return NVCC gencode flags this library was compiled with.r   r-  r‘   rñ   z-gencode compute=compute_z,code=)rÿ   r¶   r–   r5   )r  r‰   Ú
arch_list_Úkinds       r#   Úget_gencode_flagsr  l  s   € ä“€IÜ
ˆ9ƒ~˜ÓØÙ.7Ó8ªi d—*‘*˜S–/©i€JÐ8Ø�8‰8ñ !+ô	
â *‘�ð (¨ v¨V°D°6¸¸4¸&ÓAÙ *ò	
óð ùò 9ùó	
s   ŸA*ÁA/
c                  óR   • [        5         [        R                  R                  5       $ )z0Return the index of a currently selected device.)r&  rh   ri   Ú_cuda_getDevicer!   r"   r#   rw   rw   z  s   € ä„LÜ�8‰8×#Ñ#Ó%Ð%r"   c                 óÆ   • [        5         [        R                  R                  U 5         [        R                  R                  5       sSSS5        $ ! , (       d  f       g= f)a  Wait for all kernels in all streams on a CUDA device to complete.

Args:
    device (torch.device or int, optional): device for which to synchronize.
        It uses the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).
N)r&  rh   rv   rV   ri   Ú_cuda_synchronizer\   s    r#   Úsynchronizer  €  s7   € ô „LÜ	�‰×	Ñ	˜6Õ	"Ü�x‰x×)Ñ)Ó+÷ 
#×	"×	"ús   ªAÁ
A c                  óR   • [        5         [        R                  R                  5       $ )a`  Force collects GPU memory after it has been released by CUDA IPC.

.. note::
    Checks if any sent CUDA tensors could be cleaned from the memory. Force
    closes shared memory file used for reference counting if there is no
    active counters. Useful when the producer process stopped actively sending
    tensors and want to release unused memory.
)r&  rh   ri   Ú_cuda_ipc_collectr!   r"   r#   Úipc_collectr
  �  s   € ô „LÜ�8‰8×%Ñ%Ó'Ð'r"   c                 óŒ   • [        5         [        R                  R                  [	        U SS95      n[        US   US   US   S9$ )a;  Return the currently selected :class:`Stream` for a given device.

Args:
    device (torch.device or int, optional): selected device. Returns
        the currently selected :class:`Stream` for the current device, given
        by :func:`~torch.cuda.current_device`, if :attr:`device` is ``None``
        (default).
Trb  r   r   r’   r’  )r&  rh   ri   Ú_cuda_getCurrentStreamr   r   ©rV   Ú
streamdatas     r#   rŠ  rŠ  š  óJ   € ô „LÜ—‘×0Ñ0Ü˜&¨4Ñ0ó€Jô Ø˜Q‘-¨j¸©mÈÐTUÉñð r"   c                 óŒ   • [        5         [        R                  R                  [	        U SS95      n[        US   US   US   S9$ )a%  Return the default :class:`Stream` for a given device.

Args:
    device (torch.device or int, optional): selected device. Returns
        the default :class:`Stream` for the current device, given by
        :func:`~torch.cuda.current_device`, if :attr:`device` is ``None``
        (default).
Trb  r   r   r’   r’  )r&  rh   ri   Ú_cuda_getDefaultStreamr   r   r  s     r#   r…  r…  ¬  r  r"   Údata_ptrc                 óŽ   • [        5         [        R                  R                  U [	        USS95      n[        US   US   US   S9$ )aµ  Return a :class:`Stream` from an externally allocated CUDA stream.

This function is used to wrap streams allocated in other libraries in order
to facilitate data exchange and multi-library interactions.

.. note:: This function doesn't manage the stream life-cycle, it is the user
   responsibility to keep the referenced stream alive while this returned
   stream is being used.

Args:
    data_ptr(int): Integer representation of the `cudaStream_t` value that
        is allocated externally.
    device(torch.device or int, optional): the device where the stream
        was originally allocated. If device is specified incorrectly,
        subsequent launches using this stream may fail.
Trb  r   r   r’   r’  )r&  rh   ri   Ú_cuda_getStreamFromExternalr   r   )r  rV   r  s      r#   Úget_stream_from_externalr  ¾  sM   € ô" „LÜ—‘×5Ñ5ØÔ# F°TÑ:ó€Jô Ø˜Q‘-¨j¸©mÈÐTUÉñð r"   c                  óR   • [        5         [        R                  R                  5       $ )z6Return cublasHandle_t pointer to current cuBLAS handle)r&  rh   ri   Ú_cuda_getCurrentBlasHandler!   r"   r#   Úcurrent_blas_handler  Ø  s   € ä„LÜ�8‰8×.Ñ.Ó0Ð0r"   Ú
debug_modec                 óÌ   • [        5         [        U [        5      (       a&  U S:X  a  Sn OU S:X  a  Sn OU S:X  a  Sn O[        S5      e[        R
                  R                  U 5        g)	aã  Set the debug mode for cuda synchronizing operations.

Args:
    debug_mode(str or int): if "default" or 0, don't error or warn on synchronizing operations,
        if "warn" or 1, warn on synchronizing operations, if "error" or 2, error out synchronizing operations.

Warning:
    This is an experimental feature, and not all synchronizing operations will trigger warning or error. In
    particular, operations in torch.distributed and torch.sparse namespaces are not covered yet.
Údefaultr   rç   r   Úerrorr’   zGinvalid value of debug_mode, expected one of `default`, `warn`, `error`N)r&  Ú
isinstancerR   r[   rh   ri   Ú_cuda_set_sync_debug_mode)r  s    r#   Úset_sync_debug_moder  Þ  sa   € ô „LÜ�*œc×"Ñ"Ø˜Ó"Ø‰JØ˜6Ó!Ø‰JØ˜7Ó"Ø‰JäØYóð ô 
‡H�H×&Ñ& zÕ2r"   c                  óR   • [        5         [        R                  R                  5       $ )zEReturn current value of debug mode for cuda synchronizing operations.)r&  rh   ri   Ú_cuda_get_sync_debug_moder!   r"   r#   Úget_sync_debug_moder"  ù  s   € ä„LÜ�8‰8×-Ñ-Ó/Ð/r"   c                 óê   • [         (       d  [        S5      [        eSSKJn   [        R
                  " 5         [        U 5      n [        R                  " U 5      nU$ ! U a  n[        S5      UeS nAff = f)NzCnvidia-ml-py does not seem to be installed or it can't be imported.r   )ÚNVMLError_DriverNotLoadedz-cuda driver can't be loaded, is cuda enabled?)	r¸  ÚModuleNotFoundErrorÚ_PYNVML_ERRÚpynvmlr$  rÆ  r[   r÷  ÚnvmlDeviceGetHandleByIndex)rV   r$  r6  Úhandles       r#   Ú_get_pynvml_handlerr*  ÿ  su   € ßŠ;Ü!ØQó
ô ð	õ
 1ðSÜ�ŠÔô $ FÓ+€FÜ×.Ò.¨vÓ6€FØ€Møð %ó SÜÐJÓKÐQRÐRûðSús   £A ÁA2Á!A-Á-A2c                 óþ   • [         (       d  [        S5      [        e [        R                  " 5         [        U 5      n [        R                  " 5       U    nU$ ! [        R
                   a  n[        S5      UeS nAff = f)Nz=amdsmi does not seem to be installed or it can't be imported.z>amdsmi driver can't be loaded, requires >=ROCm6.0 installation)	r¸  r%  r&  r¹  rº  r»  r[   Ú_get_amdsmi_device_indexr½  )rV   r6  r)  s      r#   Ú_get_amdsmi_handlerr-    s|   € ßŠ;Ü!ØKó
ô ð	ðÜ×ÒÔô
 & fÓ-€FÜ×0Ò0Ó2°6Ñ:€FØ€Møô ×!Ñ!ó ÜØLó
àð	ûðús   �A ÁA<Á+A7Á7A<c                 óP  • [        U SS9n[        5       n[        US   5      [        L a:  [	        5       nUc  [        S5      e[        [        [           U5      n[        XC5      n[        [        [        [        [           U5      5      5      nX;  a  [        SU SU S35      eXQ   $ )zKReturn the amdsmi index of the device, taking visible_devices into account.Trb  r   rõ  rö  z% is not visible (HIP_VISIBLE_DEVICES=rD  )r   r¶  rG   rR   rÕ  r[   r   r¨  rê  Údictr   r˜   )rV   r  rí  rÒ  Úvisible_devices_strÚidx_maps         r#   r,  r,  #  s®   € ä
˜F¨TÑ
2€CÜ,Ó.€OÜˆO˜AÑÓ¤3Ò&Ü'Ó)ˆØ‰=ÜÐ7Ó8Ð8Ü"Ü”‰I�ó
Ðô 6Ð6IÓQˆÜ”9œT¤$¤s¡)¨_Ó=Ó>Ó?€GØ
ÓÜØ�c�UÐ?ÀÐ?PÐPQÐRó
ð 	
ð ‰<Ðr"   c                 ó^   • [        U 5      n[        R                  " U5      S   nUS-  S-  nU$ )NÚ	vram_usedi   )r-  r¹  Úamdsmi_get_gpu_vram_usage)rV   r)  Úmem_mega_bytesÚ	mem_bytess       r#   Ú_get_amdsmi_device_memory_usedr7  7  s6   € Ü  Ó(€Fä×5Ò5°fÓ=¸kÑJ€NØ Ñ%¨Ñ,€IØÐr"   c                 óJ   • [        U 5      n[        R                  " U5      S   $ )NÚumc_activity©r-  r¹  Úamdsmi_get_gpu_activity©rV   r)  s     r#   Ú_get_amdsmi_memory_usager=  ?  ó"   € Ü  Ó(€FÜ×)Ò)¨&Ó1°.ÑAÐAr"   c                 óJ   • [        U 5      n[        R                  " U5      S   $ )NÚgfx_activityr:  r<  s     r#   Ú_get_amdsmi_utilizationrA  D  r>  r"   c                 ó¨   • [        U 5      n[        R                  " U[        R                  R                  [        R
                  R                  5      $ rC   )r-  r¹  Úamdsmi_get_temp_metricÚAmdSmiTemperatureTypeÚJUNCTIONÚAmdSmiTemperatureMetricÚCURRENTr<  s     r#   Ú_get_amdsmi_temperaturerH  I  s@   € Ü  Ó(€FÜ×(Ò(ØÜ×$Ñ$×-Ñ-Ü×&Ñ&×.Ñ.óð r"   c                 óž   • [        U 5      n[        R                  " U5      S   nUS:w  a  U$ [        R                  " U5      S   nUS:w  a  U$ g)NÚaverage_socket_powerúN/AÚcurrent_socket_powerr   )r-  r¹  Úamdsmi_get_power_info)rV   r)  Úsocket_powers      r#   Ú_get_amdsmi_power_drawrO  R  sW   € Ü  Ó(€FÜ×/Ò/°Ó7Ð8NÑO€LØ�uÓØÐä×3Ò3°FÓ;Ð<RÑSˆØ˜5Ó ØÐàr"   c                 óª   • [        U 5      n[        R                  " U[        R                  R                  5      nSU;   a  US   nOUS   nUS:w  a  U$ g)NÚcur_clkÚclkrK  r   )r-  r¹  Úamdsmi_get_clock_infoÚAmdSmiClkTypeÚGFX)rV   r)  Ú
clock_infoÚ
clock_rates       r#   Ú_get_amdsmi_clock_raterX  _  sW   € Ü  Ó(€FÜ×-Ò-¨f´f×6JÑ6J×6NÑ6NÓO€JØ�JÓØ 	Ñ*‰
à Ñ&ˆ
Ø�UÓØÐàr"   c                 óì   • [         R                  R                  (       dK  [        5       n[	        U 5      n [
        R                  " U 5      n[
        R                  " U5      R                  $ [        U 5      $ )a(  Return used global (device) memory in bytes as given by `nvidia-smi` or `amd-smi`.

Args:
    device (torch.device or int, optional): selected device. Returns
        statistic for the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).

)
rh   r%   ru   r*  r÷  r'  r(  ÚnvmlDeviceGetMemoryInfoÚusedr7  r<  s     r#   Údevice_memory_usedr\  l  sU   € ô �=‰=××Ü$Ó&ˆÜ'¨Ó/ˆÜ×2Ò2°6Ó:ˆÜ×-Ò-¨fÓ5×:Ñ:Ð:ä-¨fÓ5Ð5r"   c                 óì   • [         R                  R                  (       dK  [        5       n[	        U 5      n [
        R                  " U 5      n[
        R                  " U5      R                  $ [        U 5      $ )aÐ  Return the percent of time over the past sample period during which global (device)
memory was being read or written as given by `nvidia-smi`.

Args:
    device (torch.device or int, optional): selected device. Returns
        statistic for the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).

Warning: Each sample period may be between 1 second and 1/6 second,
depending on the product being queried.
)
rh   r%   ru   r*  r÷  r'  r(  ÚnvmlDeviceGetUtilizationRatesÚmemoryr=  r<  s     r#   Úmemory_usager`  ~  sU   € ô �=‰=××Ü$Ó&ˆÜ'¨Ó/ˆÜ×2Ò2°6Ó:ˆÜ×3Ò3°FÓ;×BÑBÐBä'¨Ó/Ð/r"   c                 óî   • [         R                  R                  (       dL  [        U 5      n[	        U 5      n [
        R                  " U 5      n[
        R                  " U5      R                  $ [        U 5      $ )aÌ  Return the percent of time over the past sample period during which one or
more kernels was executing on the GPU as given by `nvidia-smi`.

Args:
    device (torch.device or int, optional): selected device. Returns
        statistic for the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).

Warning: Each sample period may be between 1 second and 1/6 second,
depending on the product being queried.
)
rh   r%   ru   r*  r÷  r'  r(  r^  ÚgpurA  r<  s     r#   Úutilizationrc  “  sW   € ô �=‰=××Ü$ VÓ,ˆÜ'¨Ó/ˆÜ×2Ò2°6Ó:ˆÜ×3Ò3°FÓ;×?Ñ?Ð?ä& vÓ.Ð.r"   c                 óš   • [         R                  R                  (       d"  [        U 5      n[        R
                  " US5      $ [        U 5      $ )aé  Return the average temperature of the GPU sensor in Degrees C (Centigrades).

The average temperature is computed based on past sample period as given by `nvidia-smi`.

Args:
    device (torch.device or int, optional): selected device. Returns
        statistic for the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).

Warning: Each sample period may be between 1 second and 1/6 second,
depending on the product being queried.
r   )rh   r%   ru   r*  r'  ÚnvmlDeviceGetTemperaturerH  r<  s     r#   Útemperaturerf  ¨  s9   € ô �=‰=××Ü$ VÓ,ˆä×.Ò.¨v°qÓ9Ð9ä& vÓ.Ð.r"   c                 ó˜   • [         R                  R                  (       d!  [        U 5      n[        R
                  " U5      $ [        U 5      $ )aé  Return the average power draw of the GPU sensor in mW (MilliWatts)
    over the past sample period as given by `nvidia-smi` for Fermi or newer fully supported devices.

Args:
    device (torch.device or int, optional): selected device. Returns
        statistic for the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).

Warning: Each sample period may be between 1 second and 1/6 second,
depending on the product being queried.
)rh   r%   ru   r*  r'  ÚnvmlDeviceGetPowerUsagerO  r<  s     r#   Ú
power_drawri  ½  s7   € ô �=‰=××Ü$ VÓ,ˆÜ×-Ò-¨fÓ5Ð5ä% fÓ-Ð-r"   c                 óš   • [         R                  R                  (       d"  [        U 5      n[        R
                  " US5      $ [        U 5      $ )a¯  Return the clock speed of the GPU SM in MHz (megahertz) over the past sample period as given by `nvidia-smi`.

Args:
    device (torch.device or int, optional): selected device. Returns
        statistic for the current device, given by :func:`~torch.cuda.current_device`,
        if :attr:`device` is ``None`` (default).

Warning: Each sample period may be between 1 second and 1/6 second,
depending on the product being queried.
r   )rh   r%   ru   r*  r'  ÚnvmlDeviceGetClockInforX  r<  s     r#   rW  rW  Ð  s9   € ô �=‰=××Ü$ VÓ,ˆÜ×,Ò,¨V°QÓ7Ð7ä% fÓ-Ð-r"   c                 ó¸   • [        U [        5      (       a  [        R                  " U 5      n U $ [        U [        5      (       a  [        R                  " SU 5      n U $ )zyReturn the torch.device type object from the passed in device.

Args:
    device (torch.device or int): selected device.
rv   )r  rR   rh   rV   r˜   r\   s    r#   Ú_get_devicerm  â  sJ   € ô �&œ#×ÑÜ—’˜fÓ%ˆð €Mô 
�FœC×	 Ñ	 Ü—’˜f fÓ-ˆØ€Mr"   c                 ón   • U R                   nUc
  [        5       n[        R                  R                  U   $ )zjReturn the CUDA Generator object for the given device.

Args:
    device (torch.device): selected device.
)rR  rw   rh   rv   rd   )rV   r  s     r#   Ú_get_generatorro  ï  s/   € ð �,‰,€CØ
�{ÜÓˆÜ�:‰:×(Ñ(¨Ñ-Ð-r"   Úoffsetc                 óB   ^ ^• [        U5      mUU 4S jn[        U5        g)a  Set the random number generator state offset of the specified GPU.

Args:
    offset (int): The desired offset
    device (torch.device or int, optional): The device to set the RNG state.
        Default: ``'cuda'`` (i.e., ``torch.device('cuda')``, the current CUDA device).
c                  ó>   >• [        T5      n U R                  T5        g rC   )ro  Ú
set_offset)Údefault_generatorÚfinal_devicerp  s    €€r#   ÚcbÚ!_set_rng_state_offset.<locals>.cb  s   ø€ Ü*¨<Ó8ÐØ×$Ñ$ VÕ,r"   N)rm  r"  )rp  rV   rv  ru  s   `  @r#   Ú_set_rng_state_offsetrx  û  s   ù€ ô ˜vÓ&€Lö-ô ˆr…Nr"   c                 ób   • [        5         [        U 5      n[        U5      nUR                  5       $ )a8  Return the random number generator state offset of the specified GPU.

Args:
    device (torch.device or int, optional): The device to return the RNG state offset of.
        Default: ``'cuda'`` (i.e., ``torch.device('cuda')``, the current CUDA device).

.. warning::
    This function eagerly initializes CUDA.
)r&  rm  ro  Ú
get_offset)rV   ru  rt  s      r#   Ú_get_rng_state_offsetr{    s-   € ô „LÜ˜vÓ&€LÜ& |Ó4ÐØ×'Ñ'Ó)Ð)r"   )Ú*c                 óF   • [        5         [        [        U ]  " U /UQ70 UD6$ rC   )r&  rG  Ú	_CudaBaseÚ__new__©Úclsr<   r=   s      r#   Ú	_lazy_newr‚  (  s%   € ä„Lô ”˜CÒ(¨Ð>¨tÒ>°vÑ>Ð>r"   c                   ó4   ^ • \ rS rSrSrSrU 4S jr\rSr	U =r
$ )r~  i0  TFc                 óŒ   >• [        U R                  5       5         [        TU ]  " U0 UD6sS S S 5        $ ! , (       d  f       g = frC   )rV   rm  rG  rG   )r7   r<   r=   rH  s      €r#   rG   Ú_CudaBase.type4  s1   ø€ ô �D—O‘OÓ%Õ&Ü‘7’< Ð0¨Ñ0÷ '×&×&ús	   ›5µ
Ar!   )rN   rO   rP   rQ   rl  Ú	is_sparserG   r‚  r  rS   rJ  rK  s   @r#   r~  r~  0  s   ø† Ø€GØ€Iõ1ð †Gr"   r~  )Ú_LegacyStorageÚ_warn_typed_storage_removalc                   óN   • \ rS rSr\S 5       r\S 5       r\SSS.S j5       rSrg)Ú_CudaLegacyStorageiA  c                 ó,   • [        5         [        S5      e)Nz+from_buffer: Not available for CUDA storage)rˆ  r[   r€  s      r#   Úfrom_bufferÚ_CudaLegacyStorage.from_bufferB  s   € ä#Ô%ÜÐHÓIÐIr"   c                 ó   • [        S5      e)Nz2_new_with_weak_ptr: Not available for CUDA storagerZ   r€  s      r#   Ú_new_with_weak_ptrÚ%_CudaLegacyStorage._new_with_weak_ptrG  s   € äÐOÓPÐPr"   N)rV   r   c                ó   • [        S5      e)Nz4_new_shared_filename: Not available for CUDA storagerZ   )r�  Úmanagerrn  ÚsizerV   r   s         r#   Ú_new_shared_filenameÚ'_CudaLegacyStorage._new_shared_filenameK  s   € äÐQÓRÐRr"   r!   )	rN   rO   rP   rQ   ÚclassmethodrŒ  r�  r”  rS   r!   r"   r#   rŠ  rŠ  A  sG   † ØñJó ðJð ñQó ðQð Ø@DÈDô Só óSr"   rŠ  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚByteStorageiP  c                 ó.   • [        5         U R                  $ rC   ©rˆ  Ú_dtyperD   s    r#   r   ÚByteStorage.dtypeQ  ó   € ä#Ô%Ø�{‰{Ðr"   c                 ó"   • [         R                  $ rC   )rh   Úuint8rD   s    r#   r›  ÚByteStorage._dtypeV  ó   € ä�{‰{Ðr"   r!   N©rN   rO   rP   rQ   r   r   r›  rS   r!   r"   r#   r˜  r˜  P  ó(   † Øñó ðð ñó ór"   r˜  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚDoubleStoragei[  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚDoubleStorage.dtype\  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚdoublerD   s    r#   r›  ÚDoubleStorage._dtypea  ó   € ä�|‰|Ðr"   r!   Nr¢  r!   r"   r#   r¥  r¥  [  ó(   † Øñó ðð ñó ór"   r¥  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚFloatStorageif  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚFloatStorage.dtypeg  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚfloatrD   s    r#   r›  ÚFloatStorage._dtypel  r¡  r"   r!   Nr¢  r!   r"   r#   r®  r®  f  r£  r"   r®  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚHalfStorageiq  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚHalfStorage.dtyper  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚhalfrD   s    r#   r›  ÚHalfStorage._dtypew  ó   € ä�z‰zÐr"   r!   Nr¢  r!   r"   r#   rµ  rµ  q  ó(   † Øñó ðð ñó ór"   rµ  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚLongStoragei|  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚLongStorage.dtype}  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚlongrD   s    r#   r›  ÚLongStorage._dtype‚  r»  r"   r!   Nr¢  r!   r"   r#   r¾  r¾  |  r¼  r"   r¾  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)Ú
IntStoragei‡  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚIntStorage.dtypeˆ  r�  r"   c                 ó"   • [         R                  $ rC   )rh   r˜   rD   s    r#   r›  ÚIntStorage._dtype�  s   € ä�y‰yÐr"   r!   Nr¢  r!   r"   r#   rÅ  rÅ  ‡  s(   † Øñó ðð ñó ór"   rÅ  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚShortStoragei’  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚShortStorage.dtype“  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚshortrD   s    r#   r›  ÚShortStorage._dtype˜  r¡  r"   r!   Nr¢  r!   r"   r#   rË  rË  ’  r£  r"   rË  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚCharStoragei�  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚCharStorage.dtypež  r�  r"   c                 ó"   • [         R                  $ rC   )rh   Úint8rD   s    r#   r›  ÚCharStorage._dtype£  r»  r"   r!   Nr¢  r!   r"   r#   rÒ  rÒ  �  r¼  r"   rÒ  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚBoolStoragei¨  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚBoolStorage.dtype©  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚboolrD   s    r#   r›  ÚBoolStorage._dtype®  r»  r"   r!   Nr¢  r!   r"   r#   rÙ  rÙ  ¨  r¼  r"   rÙ  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚBFloat16Storagei³  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚBFloat16Storage.dtype´  r�  r"   c                 ó"   • [         R                  $ rC   )rh   r�   rD   s    r#   r›  ÚBFloat16Storage._dtype¹  s   € ä�~‰~Ðr"   r!   Nr¢  r!   r"   r#   rà  rà  ³  s(   † Øñó ðð ñó ór"   rà  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚComplexDoubleStoragei¾  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚComplexDoubleStorage.dtype¿  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚcdoublerD   s    r#   r›  ÚComplexDoubleStorage._dtypeÄ  s   € ä�}‰}Ðr"   r!   Nr¢  r!   r"   r#   ræ  ræ  ¾  s(   † Øñó ðð ñó ór"   ræ  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚComplexFloatStorageiÉ  c                 ó.   • [        5         U R                  $ rC   rš  rD   s    r#   r   ÚComplexFloatStorage.dtypeÊ  r�  r"   c                 ó"   • [         R                  $ rC   )rh   ÚcfloatrD   s    r#   r›  ÚComplexFloatStorage._dtypeÏ  r«  r"   r!   Nr¢  r!   r"   r#   rí  rí  É  r¬  r"   rí  c                   ó$   • \ rS rSrSrS rS rSrg)Ú_WrappedTritonKerneliå  zBJust a simple wrapper to store some metadata for testing purposes.c                 ó   • Xl         SU l        g r    ©ÚkernelÚkernel_invoked)r7   r÷  s     r#   r9   Ú_WrappedTritonKernel.__init__è  s   € ØŒØ#ˆÕr"   c                 ó8   • U R                   " U0 UD6nSU l        U$ )NTrö  )r7   r<   r=   rL  s       r#   Ú__call__Ú_WrappedTritonKernel.__call__ì  s"   € Ø�kŠk˜4Ð* 6Ñ*ˆØ"ˆÔØˆ
r"   rö  N)rN   rO   rP   rQ   r»   r9   rû  rS   r!   r"   r#   rô  rô  å  s   † ÙLò$õr"   rô  c                  ó  • [         S 5       n [         S 5       n[        R                  R                  S5      S LnU(       aE  [        R
                  R                  SSU S5        [        R
                  R                  SSUS5        g g )	Nc                  ó"   • SSK Jn  U" U SS0UD6$ )Nr   )Úbsr_dense_mmÚskip_checksT)Útorch.sparse._triton_opsrÿ  )r<   r=   rÿ  s      r#   Úkernel_implÚ-_register_triton_kernels.<locals>.kernel_impló  s   € å9ñ ˜TÐ>¨tÐ>°vÑ>Ð>r"   c                  ó"   • SSK Jn  U" U SS0UD6$ )Nr   )Úbsr_dense_addmmr   T)r  r  )r<   r=   r  s      r#   Úaddmm_kernel_implÚ3_register_triton_kernels.<locals>.addmm_kernel_implú  s   € å<á ÐA°$ÐA¸&ÑAÐAr"   ÚtritonÚ_triton_bsr_dense_mm_outzS_triton_bsr_dense_mm_out(Tensor bsr, Tensor dense, *, Tensor(a!) out) -> Tensor(a!)ÚSparseCsrCUDAÚ_triton_bsr_dense_addmm_outz_triton_bsr_dense_addmm_out(Tensor input, Tensor bsr, Tensor dense, *, Scalar beta, Scalar alpha, Tensor(a!) out) -> Tensor(a!))rô  Ú	importlibÚutilÚ	find_specrh   Ú_TritonLibraryÚ
registerOp)r  r  Ú
has_tritons      r#   Ú_register_triton_kernelsr  ò  s”   € Üñ?ó ð?ô ñBó ðBô
 —‘×)Ñ)¨(Ó3¸4Ð?€JÞÜ×Ñ×'Ñ'Ø&ØaØØô		
ô 	×Ñ×'Ñ'Ø)ðOð Øõ	
ð r"   Úkernel_sourceÚkernel_nameÚcompute_capabilityÚcuda_include_dirsÚnvcc_optionsc                 óˆ   • SSK JnJn  U" U UUUU5      u  pxU" Xx/5      n	[        U	[        5      (       a  X˜   $ [        X˜5      $ )aê  
Compiles a CUDA kernel using NVRTC and returns a callable function.

This function is a wrapper for NVRTC that enables runtime compilation of CUDA kernels.
Note that this returns a raw CUDA kernel that operates on raw memory pointers.
To use this kernel as a proper PyTorch operator, you should wrap it following the guide at:
pytorch.org/tutorials/advanced/python_custom_ops.html

Args:
    kernel_source (str): The CUDA kernel source code as a string
    kernel_name (str): The name of the kernel function to compile
    compute_capability (str, optional): The compute capability to target (e.g., "86").
                                       If None, will detect from current device.
    cuda_include_dirs (list, optional): List of directories containing CUDA headers
    nvcc_options (list, optional): Additional options to pass to NVRTC

Returns:
    callable: A Python function that can be called with PyTorch tensor arguments to execute the kernel

Example:
    >>> # xdoctest: +SKIP
    >>> kernel_code = '''
    extern "C"
    __global__ void add_tensors(const float* a, const float* b, float* c, int n) {
        int i = threadIdx.x + blockIdx.x * blockDim.x;
        if (i < n)
            c[i] = a[i] + b[i];
    }
    '''
    >>> add_kernel = torch.cuda.compile_kernel(kernel_code, "add_tensors")
    >>> a = torch.randn(1024, device="cuda")
    >>> b = torch.randn(1024, device="cuda")
    >>> c = torch.empty_like(a)
    >>> add_kernel(grid=(4, 1, 1), block=(256, 1, 1), args=[a, b, c, a.numel()])
r   )Ú_cuda_load_moduleÚ_nvrtc_compile)Útorch.cuda._utilsr  r  r  r/  Úgetattr)
r  r  r  r  r  r  r  ÚptxÚmangled_namer·   s
             r#   Ú_compile_kernelr    sX   € ÷T Dñ 'ØØØØØóÑ€Cñ ˜s NÓ3€Fä�&œ$×ÑØÑ#Ð#ô �vÓ,Ð,r"   )ÚampÚ	jiteratorÚnvtxÚprofilerÚsparseÚtunableÚ_POOL_HANDLE){rà  ÚBFloat16TensorrÙ  Ú
BoolTensorr˜  Ú
ByteTensorrÒ  Ú
CharTensorræ  rí  r¥  ÚDoubleTensorr®  ÚFloatTensorrµ  Ú
HalfTensorrÅ  Ú	IntTensorr¾  Ú
LongTensorrË  ÚShortTensorr   rA  r$  r   r   r   r~  r   r   Úcaching_allocator_allocÚcaching_allocator_deleteÚcaching_allocator_enabler|  rO  r;  r9  r  rw   rŠ  rd   r…  rV   rp   r\  rj  Úempty_cacheÚget_allocator_backendÚCUDAPluggableAllocatorÚchange_current_allocatorrÿ   r  ró   rx   r  Úget_per_process_memory_fractionÚget_rng_stateÚget_rng_state_allr  r"  r   r   Úgraphsrb   rc   Úhost_memory_statsÚ host_memory_stats_as_nested_dictr'  Úinitial_seedr
  rq   r{   r   r  rŠ   r!  Úlist_gpu_processesr   Úmanual_seedÚmanual_seed_allÚmax_memory_allocatedÚmax_memory_cachedÚmax_memory_reservedÚmem_get_infor_  Úmemory_allocatedÚmemory_cachedÚmemory_reservedÚmemory_snapshotÚmemory_statsÚmemory_stats_as_nested_dictÚmemory_summaryr`  ÚMemPoolÚuse_mem_poolrf  ri  rW  Úncclr"  r#  ÚrandomÚ#reset_accumulated_host_memory_statsÚreset_accumulated_memory_statsÚreset_max_memory_allocatedÚreset_max_memory_cachedÚreset_peak_host_memory_statsÚreset_peak_memory_statsr  r  rr  Úset_per_process_memory_fractionÚset_rng_stateÚset_rng_state_allr‹  r  r$  r�  Ústreamsr  r%  rc  )TrC   )rv   )NNN)Êr»   r  r2   Ú	threadingrI   ræ   Úcollections.abcr   Ú	functoolsr   Útypingr   r   r   r   r	   r
   rh   Útorch._CÚtorch._utilsr   r   r   Útorch.typesr   r-  r   r   Ú_utilsr   r;  r   r   r   r   r   Úgreen_contextsr   rZ  r   r   r   r   ÚImportErrorr  Úlocalr.  ÚLockr  r   r¨  ÚtuplerR   r?  r  ri   r  r¸  r&  r%   Ú_versionru   r'  r/   Úpathlibr&   r(   r¹  r%  Úerrr  rg   rT   rU   r]   r˜   r_   ra   rb   rÝ  Ú
_has_magmarc   rd   Ú	Generatorrj   rn   rq   r{   rz   rŠ   rŽ   rš   rœ   r½   rß   r/  rà   r¢   rè   rû   r  r  r  r"  r‚   r$  ÚAcceleratorErrorÚOutOfMemoryErrorr'  r&  r9  r;  r[   rA  rO  rQ  rV   rj  rr  ró   r  rx   r|  r~  r�  r–  r‹  r¶  r¿  rÊ  rÕ  rá  rê  rñ  ró  r÷  rø  rp   rÿ   r  rw   r  r
  rŠ  r…  r  r  r  r"  r*  r-  r,  r7  r=  rA  rH  rO  rX  r\  r`  rc  rf  ri  rW  rm  ro  rx  r{  r_  rP  Ústaticmethodr‚  r~  Útorch.storager‡  rˆ  rŠ  r˜  r¥  r®  rµ  r¾  rÅ  rË  rÒ  rÙ  rà  ræ  rí  Ú_storage_classesÚaddrô  r  r  r   r!  r"  r#  r$  r%  r&  Ú__all__r!   r"   r#   Ú<module>rt     s•  ðò
ó Û 	Û Û Û Ý $Ý ß E× Eã Û ß EÑ EÝ ç !Ý %÷õ õ )ß 2Ñ 2ðÝ ð €Ø‡‚Ó€Ø —~’~Ó'Ð ð ð ˆtØ	ˆ(�2�t�8Ñ
˜d 3™iÐ
'Ñ(ñó ñ ˜%Ÿ(™(Ð$7¹ÓG€à€Ø€ð<Ý)ð7Ø�|�|ÜãÝ$÷$5ñ 5ñ2 #Õ$Û÷ %ð ˆð ñ &Ó'Ð ñ ˆ5�8‰8Ð,×-Ñ-Ø!ŸH™H×:Ñ:Ñá'Ð(?Ó@Ðá
ˆ5�8‰8Ð+×,Ñ,Ø—x‘x×4Ñ4ÑðH ð H¨ô Hñ ˆ5�8‰8Ð0×1Ñ1Ø"ŸX™X×?Ñ?ÑðH sð H¨sô Hð €ˆ$Ó Ø—(‘(×%Ñ%€	ˆ4Ó %à02Ð �E˜%Ÿ(™(×,Ñ,Ñ-Ó 2ð5�dô 5ð
=˜4ô =ð3�dô 3ñ,0¨4õ 0ñ. �2Ñð¨ó ó ðð8˜4ô 8ò!ð sð ¨sô ÷ñ ÷2Qñ Qð2EØ‰˜b¨2¨$Ñ/ðEà‰˜b¨2¨$Ñ/ðEð ‰
�B�4ÓðEð ‰˜b¨2¨$Ñ/ð	Eð
 ‰˜b¨2¨$Ñ/ðEð ‰
�B�4ÓðEð ‰˜b¨2¨$Ñ/ðEð ‰
�B�4ÓðEð ‰˜bÑ!ðEð ‰˜b¨2¨$Ñ/ðEð ‰˜b¨2¨$Ñ/ðEð ‰
�B�4ÓðEð ‰˜bÑ!ðEð ‰˜bÑ!ðEð ‰˜s¨S¨EÑ	2ðEð  ‰�S˜#�JÓ	ð!Eð" ‰˜sÑ	#ð#Eñ$ 
˜sÑ	#Ù	˜sÑ	#Ù	˜sÑ	#ò)EÐ �D˜˜e J°Ð$?Ñ@Ð@ÑAó ò4 %Ú&Ú+ñ1Ð ˜$˜s C¨¡H˜}Ñ-ó ð4¨Cð 4¸#ô 4ð2¨ð 2¸ð 2ÈÈSÉ	ô 2ò4;òò62ò
Kñ$ ÐÔ Ù 
ˆ=Ô ô	˜Iô 	ð —8‘8×,Ñ,Ð Ø—8‘8×,Ñ,Ð òò0òf7÷tñ ô
,�ô ,ð�Sð ˜Tô ÷
ñ 
÷ñ ô(�ô ð)�vð ) $ô )ñ.˜Fð .¨cõ .ñ" &ð "°E¸#¸s¸(±Oõ "ñ$* &ð *Ð4Iõ *ð&	C 6ð 	C¸ð 	CÀ4ô 	C÷74ñ 74ðt
!�8Ð/Ñ0ð 
!°]ô 
!òð�vô ð$E  S¡	¨D°©IÑ 5ô EðP #ô ð ô ð$!  c¡¨TÑ!1ô !ðH˜t C™y¨4Ñ/ô ð@¨D°©Ið ¸dÀ3¹ið ÈDÐQTÉIô ð> ˜cô  ð:! ˜Cô ! ðH  6ð  ¨cô  ð& $(Ð �c˜D‘jÓ 'ð�cô ð.�t˜C‘yô ð˜3ô ð&˜ô &ñ
,˜ð 
,¨$õ 
,ò
(ñ˜6ð ¨Võ ñ$˜6ð ¨Võ ñ$ sð °Fð Àfõ ò41ð3 C¨#¡Ið 3°$ô 3ð60˜Sô 0ñ õ ñ& õ ð" Vð °ô ñ(¨6ð ¸Sõ ñB Vð B°sõ Bñ
B Fð B°cõ Bñ
 Fð °cõ ñ
 6ð 
°Sõ 
ñ
 6ð 
°Sõ 
ñ6˜vð 6°õ 6ñ$0˜ð 0¨3õ 0ñ*/˜ð /¨#õ /ñ*/˜ð /¨#õ /ñ*.�vð .¨õ .ñ&.�vð .¨õ .ð$
˜˜c™	 E§L¡LÑ0ð 
°U·\±\ô 
ð	.˜5Ÿ<™<ð 	.¨E¯H©H×,>Ñ,>ô 	.ð 5;ñØðØ˜s™ U§\¡\Ñ1ðà	õñ&* #¨¡)¨e¯l©lÑ":ð *Èõ *ô" Ü ð ñ?ó ð?÷ñ ÷ FôS˜ô SôÐ$ô ôÐ&ô ôÐ%ô ôÐ$ô ôÐ$ô ôÐ#ô ôÐ%ô ôÐ$ô ôÐ$ô ôÐ(ô ôÐ-ô ôÐ,ô ð Øà × Ò × Ò ˜=Ô )Ø × Ò × Ò ˜<Ô (Ø × Ò × Ò ˜;Ô 'Ø × Ò × Ò ˜:Ô &Ø × Ò × Ò ˜<Ô (Ø × Ò × Ò ˜;Ô 'Ø × Ò × Ò ˜;Ô 'Ø × Ò × Ò ˜;Ô 'Ø × Ò × Ò ˜;Ô 'Ø × Ò × Ò ˜?Ô +Ø × Ò × Ò Ð/Ô 0Ø × Ò × Ò Ð.Ô /÷
ñ 
ò
ñD Ð#Ô $ð &*Ø%)Ø $ñ=-Øð=-àð=-ð ˜d™
ð=-ð ˜d‘{ð	=-ð
 ˜‘+õ=-÷@ >× =ñ �~ u¨S°#¨X¡Ó7€òG�øðe9 ó ØƒGðú÷@ %Ö$ûð ó Úðûñ ûØó Ø†Kûðúsr   Á9b Ãc Ã1b8 Äb&Ä
b8 Äc âb#â"b#â&
b5â0b8 â8câ>c ãcãc ãcãc ãcãcãc