+
    –°³j`  ã                   ó¢  a € R% t-0 t R t^ RIt^ RIt^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHtHt ^ RIt^ RIHt ] ^ k ]P"                  P%                  4       '       d   ^ RIHt MRt/ t] ^k / t] ^k  ! R R	4      t ! R
 R4      t ! R R]4      t] ^k ]P6                  P%                  4       '       d   ^ RIHt MRt ! R R]4      t] ^k ]P>                  P%                  4       '       d   ^ RIH t! MRt! ! R R]4      t"]
 ! R R4      4       t# ! R R]4      t$ ! R R]4      t% ! R R]4      t&/ t'] ^k Rs(R R lt)R R  lt*R! R" lt+R# R$ lt,R# )&a  
Device abstraction layer for TorchDynamo and Inductor backends.

This module provides a unified interface for different hardware backends (CUDA, XPU,
CPU, MPS, MTIA) through a common device interface. Key components include:

- DeviceInterface: Base class defining the common API for all device types
- Device-specific implementations: CudaInterface, XpuInterface, CpuInterface, MpsInterface, MtiaInterface
- Device registration system for managing available backends
- Worker APIs for multi-processing scenarios
- Stream and event management across different devices
- Device property caching for worker processes

The abstraction layer enables device-agnostic code in TorchDynamo while allowing
specialized implementations for each hardware backend's unique features.
N©Ú
namedtuple)ÚCallableÚIterable)Ú	dataclass©ÚAnyÚLiteral©Úhas_torch_tpu)Ú_cuda_getCurrentRawStreamc                   ó¨  a € ] tR t^(t o Rt ! R R4      t ! R R4      t ! R R4      t ! R R	4      t]	V 3R
 lR l4       t
]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	R2V 3R! lR" ll4       t]R2V 3R# lR$ ll4       t]	R2V 3R% lR& ll4       t]	R3V 3R' lR( ll4       t]R3V 3R) lR* ll4       t]	R2V 3R+ lR, ll4       t]	R2V 3R- lR. ll4       t]R2V 3R/ lR0 ll4       tR1tV tR # )4ÚDeviceInterfacez’
This is a simple device runtime interface for Inductor. It enables custom
backends to be integrated with Inductor in a device-agnostic semantic.
c                   ó2   a € ] tR t^.t o V 3R lR ltRtV tR# )ÚDeviceInterface.devicec                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# ©é   ÚdeviceÚreturn©ÚtorchÚtypesÚDevicer   )ÚformatÚ__classdict__s   "€Ú_/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/_dynamo/device_interface.pyÚ__annotate__Ú#DeviceInterface.device.__annotate__/   s%   ø€ ÷ 	&ñ 	&¡§¡×!3Ñ!3ð 	&¹ñ 	&ó    c                ó   € \         h©N©ÚNotImplementedError©Úclsr   s   &&r   Ú__new__ÚDeviceInterface.device.__new__/   s   € Ü%Ð%r   © N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r&   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r   .   s   ø‡ € ÷	&ö 	&r   r   c                   ó2   a € ] tR t^2t o V 3R lR ltRtV tR# )ÚDeviceInterface.Eventc                ó,   <€ V ^8„  d   QhRS[ RS[ RS[ /# ©r   ÚargsÚkwargsr   ©r   )r   r   s   "€r   r   Ú"DeviceInterface.Event.__annotate__3   ó"   ø€ ÷ 	ñ 	¡ð 	©sð 	±sñ 	r   c                ó   € \        R 4      h)zYEvent should be inherited from torch.Event, otherwise, it couldn't be captured by dynamo.r"   ©r%   r5   r6   s   &*,r   r&   ÚDeviceInterface.Event.__new__3   s   € Ü%Økóð r   r(   Nr)   r0   s   @r   ÚEventr2   2   ó   ø‡ € ÷	ö 	r   r=   c                   ó2   a € ] tR t^8t o V 3R lR ltRtV tR# )ÚDeviceInterface.Streamc                ó,   <€ V ^8„  d   QhRS[ RS[ RS[ /# r4   r7   )r   r   s   "€r   r   Ú#DeviceInterface.Stream.__annotate__9   r9   r   c                ó   € \        R 4      h)z[Stream should be inherited from torch.Stream, otherwise, it couldn't be captured by dynamo.r"   r;   s   &*,r   r&   ÚDeviceInterface.Stream.__new__9   s   € Ü%Ømóð r   r(   Nr)   r0   s   @r   ÚStreamr@   8   r>   r   rE   c                   ó|   a € ] tR t^>t o Rt]V 3R lR l4       t]V 3R lR l4       t]R
V 3R lR ll4       tR	t	V t
R# )ÚDeviceInterface.Workerzò
Worker API to query device properties that will work in multi processing
workers that cannot use the GPU APIs (due to processing fork() and
initialization time issues). Properties are recorded in the main process
before we fork the workers.
c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r   r   r   N©Úint)r   r   s   "€r   r   Ú#DeviceInterface.Worker.__annotate__G   s   ø€ ÷ 	&ñ 	&™sð 	& tñ 	&r   c                ó   € \         hr!   r"   ©r   s   &r   Ú
set_deviceÚ!DeviceInterface.Worker.set_deviceF   ó   € ä%Ð%r   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   rJ   )r   r   s   "€r   r   rL   K   s   ø€ ÷ 	&ñ 	&¡ñ 	&r   c                 ó   € \         hr!   r"   r(   r   r   Úcurrent_deviceÚ%DeviceInterface.Worker.current_deviceJ   rQ   r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   rL   O   s%   ø€ ÷ 	&ñ 	&©%¯+©+×*<Ñ*<ð 	&Éñ 	&r   c                ó   € \         hr!   r"   rN   s   &r   Úget_device_propertiesÚ,DeviceInterface.Worker.get_device_propertiesN   rQ   r   r(   r!   )r*   r+   r,   r-   Ú__doc__ÚstaticmethodrO   rU   rY   r.   r/   r0   s   @r   ÚWorkerrG   >   sK   ø‡ € ñ	ð 
÷	&ó 
ð	&ð 
÷	&ó 
ð	&ð 
÷	&ñ 	&ó 
ö	&r   r]   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   ÚDeviceInterface.__annotate__S   s   ø€ ÷ "ñ "™Cñ "r   c                 ó   € \         hr!   r"   r(   r   r   rU   ÚDeviceInterface.current_deviceR   ó   € ä!Ð!r   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   ©r   r   r   )r   r   s   "€r   r   r_   W   s%   ø€ ÷ "ñ "™5Ÿ;™;×-Ñ-ð "°$ñ "r   c                ó   € \         hr!   r"   rN   s   &r   rO   ÚDeviceInterface.set_deviceV   rb   r   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r   rJ   )r   r   s   "€r   r   r_   [   s   ø€ ÷ "ñ "¡cð "©cñ "r   c                ó   € \         hr!   r"   rN   s   &r   Úmaybe_exchange_deviceÚ%DeviceInterface.maybe_exchange_deviceZ   rb   r   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r   rJ   )r   r   s   "€r   r   r_   _   s   ø€ ÷ "ñ "¡ð "©ñ "r   c                ó   € \         hr!   r"   rN   s   &r   Úexchange_deviceÚDeviceInterface.exchange_device^   rb   r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   r_   c   s   ø€ ÷ "ñ "™#ñ "r   c                 ó   € \         hr!   r"   r(   r   r   Údevice_countÚDeviceInterface.device_countb   rb   r   c                ó    <€ V ^8„  d   QhRS[ /# rS   ©Úbool)r   r   s   "€r   r   r_   g   s   ø€ ÷ "ñ "™$ñ "r   c                 ó   € \         hr!   r"   r(   r   r   Úis_availableÚDeviceInterface.is_availablef   rb   r   c                ó:   <€ V ^8„  d   QhRS[ P                  RS[/# )r   Ústreamr   )r   rE   r   )r   r   s   "€r   r   r_   k   s   ø€ ÷ "ñ "‘u—|‘|ð "©ñ "r   c                ó   € \         hr!   r"   ©rz   s   &r   rz   ÚDeviceInterface.streamj   rb   r   c                ó4   <€ V ^8„  d   QhRS[ P                  /# rS   ©r   rE   )r   r   s   "€r   r   r_   o   s   ø€ ÷ "ñ "™EŸL™Lñ "r   c                 ó   € \         hr!   r"   r(   r   r   Úcurrent_streamÚDeviceInterface.current_streamn   rb   r   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# ©r   rz   r   Nr   )r   r   s   "€r   r   r_   s   s   ø€ ÷ "ñ "™5Ÿ<™<ð "¨Dñ "r   c                ó   € \         hr!   r"   r|   s   &r   Ú
set_streamÚDeviceInterface.set_streamr   rb   r   c                ó0   <€ V ^8„  d   QhRS[ RS[ RS[ RR/# )r   Ú	stream_idÚdevice_indexÚdevice_typer   NrJ   )r   r   s   "€r   r   r_   w   s*   ø€ ÷ "ñ "¡Sð "¹ð "É#ð "ÐRVñ "r   c                ó   € \         hr!   r"   )r‰   rŠ   r‹   s   &&&r   Ú_set_stream_by_idÚ!DeviceInterface._set_stream_by_idv   rb   r   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# ©r   Ú
device_idxr   rJ   )r   r   s   "€r   r   r_   {   s   ø€ ÷ "ñ "¡3ð "©3ñ "r   c                ó   € \         hr!   r"   ©r‘   s   &r   Úget_raw_streamÚDeviceInterface.get_raw_streamz   rb   r   Nc                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r_      s%   ø€ ÷ "ñ "™EŸK™K×.Ñ.ð "¸$ñ "r   c                ó   € \         hr!   r"   rN   s   &r   ÚsynchronizeÚDeviceInterface.synchronize~   rb   r   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   r_   ƒ   s%   ø€ ÷ 8ñ 8©5¯;©;×+=Ñ+=ð 8Éñ 8r   c                ó8   € V P                   P                  V4      # r!   )r]   rY   r$   s   &&r   rY   Ú%DeviceInterface.get_device_properties‚   s   € à�z‰z×/Ñ/°Ó7Ð7r   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   r_   ‡   s%   ø€ ÷ "ñ "¡u§{¡{×'9Ñ'9ð "ÁSñ "r   c                ó   € \         hr!   r"   rN   s   &r   Úget_compute_capabilityÚ&DeviceInterface.get_compute_capability†   rb   r   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# ©r   Úincluding_emulationr   rt   )r   r   s   "€r   r   r_   ‹   s   ø€ ÷ "ñ "©tð "Áñ "r   c                ó   € \         hr!   r"   ©r£   s   &r   Úis_bf16_supportedÚ!DeviceInterface.is_bf16_supportedŠ   rb   r   c                ó@   <€ V ^8„  d   QhRS[ P                  RS[RS[/# ©r   Údtyper£   r   ©r   rª   ru   )r   r   s   "€r   r   r_   �   s.   ø€ ÷ Uñ UÙ—K‘KðUÙ6:ðUá	ñUr   c                óZ   € V\         P                  8g  ;'       g    V P                  V4      # r!   )r   Úbfloat16r¦   ©r%   rª   r£   s   &&&r   Úis_dtype_supportedÚ"DeviceInterface.is_dtype_supportedŽ   s'   € ð œŸ™Ñ&×TÐT¨#×*?Ñ*?Ð@SÓ*TÐTr   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   )r   r   r   rK   )r   r   s   "€r   r   r_   •   s%   ø€ ÷ "ñ "¡§¡×!3Ñ!3ð "¹sñ "r   c                ó   € \         hr!   r"   rN   s   &r   Úmemory_allocatedÚ DeviceInterface.memory_allocated”   rb   r   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   ©r   r   r   ru   )r   r   s   "€r   r   r_   ™   s%   ø€ ÷ ñ ¡%§+¡+×"4Ñ"4ð Áñ r   c                ó   € R# )zz
Returns True if the device has Triton support, False otherwise, even if
the appropriate Triton backend is not available.
Fr(   rN   s   &r   Úis_triton_capableÚ!DeviceInterface.is_triton_capable˜   s   € ñ r   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r_   ¡   s%   ø€ ÷ ñ ±·±×1CÑ1Cð Ètñ r   c                óN   € ^ RI Hp V P                  4       '       g	   V! R4      hR# )aò  
Raises a `TritonUnavailableError` with human-readable instructions if
the Triton backend for the given device (or the default device if
`device` is `None`) is not built. Implementations may raise a
different, more specific error when the device itself is not
Triton-capable (e.g. CUDA raises `GPUTooOldForTriton`), so callers
that only want an availability answer should check
`is_triton_capable()` first.

The caller should ensure the presence of the 'triton' package before
calling this method.
©ÚTritonUnavailableErrorz/This device is not capable of supporting TritonN)Útorch._dynamo.excr½   r¸   )r%   r   r½   s   && r   Úraise_if_triton_unavailableÚ+DeviceInterface.raise_if_triton_unavailable    s+   € õ 	=à×$Ñ$×&Ò&Ù(ØAóð ñ 'r   r(   r!   ©F) r*   r+   r,   r-   r[   r   r=   rE   r]   r\   rU   rO   ri   rm   rq   rw   rz   r�   r†   r�   r”   r˜   ÚclassmethodrY   rŸ   r¦   r¯   r³   r¸   r¿   r.   r/   r0   s   @r   r   r   (   sÙ  ø‡ € ñ÷
&ñ &÷ñ ÷ñ ÷&ñ &ð( ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ó ð"ð ÷"ñ "ó ð"ð ÷8ñ 8ó ð8ð ÷"ñ "ó ð"ð ÷"ñ "ó ð"ð ÷Uñ Uó ðUð
 ÷"ñ "ó ð"ð ÷ñ ó ðð ÷ñ ó ör   r   c                   óZ   a € ] tR t^¶t o RtV 3R lR ltV 3R lR ltV 3R lR ltRtV t	R	# )
ÚDeviceGuardaG  
This class provides a context manager for device switching. This is a stripped
down version of torch.{device_name}.device.

The context manager changes the current device to the given device index
on entering the context and restores the original device on exiting.
The device is switched using the provided device interface.
c                óH   <€ V ^8„  d   QhRS[ S[,          RS[R,          RR/# )r   Údevice_interfaceÚindexNr   )Útyper   rK   )r   r   s   "€r   r   ÚDeviceGuard.__annotate__À   s.   ø€ ÷ ñ Ù $¡_Õ 5ðÙ>AÀD½jðà	ñr   c                ó,   € Wn         W n        RV n        R# )é   Néÿÿÿÿ©rÆ   ÚidxÚprev_idx)ÚselfrÆ   rÇ   s   &&&r   Ú__init__ÚDeviceGuard.__init__À   s   € ð !1ÔØŒØˆŽr   c                ó   <€ V ^8„  d   QhRR/# ©r   r   Nr(   )r   r   s   "€r   r   rÉ   Ç   s   ø€ ÷ Lñ L˜4ñ Lr   c                óz   € V P                   e-   V P                  P                  V P                   4      V n        R # R # r!   )rÎ   rÆ   rm   rÏ   )rÐ   s   &r   Ú	__enter__ÚDeviceGuard.__enter__Ç   s-   € Ø�8‰8ÒØ ×1Ñ1×AÑAÀ$Ç(Á(ÓKˆDŽMñ  r   c          	      ó@   <€ V ^8„  d   QhRS[ RS[ RS[ RS[R,          /# )r   rÈ   ÚvalueÚ	tracebackr   Fr   )r   r   s   "€r   r   rÉ   Ë   s-   ø€ ÷ ñ ™Sð ©ð ¹ð ÁÈÅñ r   c                óv   € V P                   e+   V P                  P                  V P                  4      V n         R# )NF)rÎ   rÆ   ri   rÏ   )rÐ   rÈ   rÙ   rÚ   s   &&&&r   Ú__exit__ÚDeviceGuard.__exit__Ë   s+   € Ø�8‰8ÒØ×,Ñ,×BÑBÀ4Ç=Á=ÓQˆDŒHÙr   rÍ   N)
r*   r+   r,   r-   r[   rÑ   rÖ   rÜ   r.   r/   r0   s   @r   rÄ   rÄ   ¶   s*   ø‡ € ñ÷ð ÷Lð L÷ö r   rÄ   c                   ó  a € ] tR t^Ñt o ]P
                  P                  t]P
                  P                  t]P
                  P                  t ! R R4      t	]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                   4      t]
! ]P
                  P"                  4      t]
! ]P
                  P$                  4      t]
! ]P
                  P&                  4      t]
! ]4      t]
! ]P
                  P,                  4      t]
! ]P
                  P0                  4      t]
! ]P
                  P4                  4      t]
! ]P
                  P6                  4      t]
V 3R lR l4       t]
RV 3R lR ll4       t]
RV 3R lR	 ll4       t]
RV 3R
 lR ll4       tRt V t!R# )ÚCudaInterfacec                   óx   a € ] tR t^Út o ]V 3R lR l4       t]V 3R lR l4       t]R	V 3R lR ll4       tRtV t	R# )
ÚCudaInterface.Workerc                ó$   <€ V ^8„  d   QhRS[ RR/# rI   rJ   )r   r   s   "€r   r   Ú!CudaInterface.Worker.__annotate__Ü   ó   ø€ ÷ 	<ñ 	<™sð 	< tñ 	<r   c                ó   € V \         R &   R# )ÚcudaN©Úcaching_worker_current_devicesrN   s   &r   rO   ÚCudaInterface.Worker.set_deviceÛ   ó   € à5;Ô*¨6Ó2r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   rã   à   ó   ø€ ÷ 	/ñ 	/¡ñ 	/r   c                 ón   € R \         9   d   \         R ,          # \        P                  P                  4       # )ræ   )rè   r   ræ   rU   r(   r   r   rU   Ú#CudaInterface.Worker.current_deviceß   ó)   € àÔ7Ô7Ü5°fÕ=Ð=Ü—:‘:×,Ñ,Ó.Ð.r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   rã   æ   ó)   ø€ ÷ 	Dñ 	D©%¯+©+×*<Ñ*<ð 	DÉñ 	Dr   c                óR  € V eƒ   \        V \        4      '       dA   \        P                  ! V 4      p V P                  R8w  d   \        RV P                   R24      h\        V \        P                  4      '       d   V P                  p V f   \        P                  P                  4       p R\        9  d]   \        \        P                  P                  4       4       Uu. uF"  p\        P                  P                  V4      NK$  	  ppV\        R&   \        R,          V ,          # u upi )Nræ   z"Expected device type 'cuda', got 'Ú')Ú
isinstanceÚstrr   r   rÈ   ÚAssertionErrorrÇ   rß   r]   rU   Ú caching_worker_device_propertiesÚrangeræ   rq   rY   ©r   ÚiÚdevice_props   &  r   rY   Ú*CudaInterface.Worker.get_device_propertieså   óð   € àÒ!Ü˜f¤c×*Ò*Ü"Ÿ\š\¨&Ó1�FØ—{‘{ fÔ,Ü,Ø@ÀÇÁÀÈQÐOóð ô ˜f¤e§l¡l×3Ò3Ø#Ÿ\™\�FØŠ~Ü&×-Ñ-×<Ñ<Ó>�àÔ=Ô=ô #¤5§:¡:×#:Ñ#:Ó#<Ô=óá=˜ô —J‘J×4Ñ4°QÖ7Ù=ð ð ð <GÔ0°Ñ8ä3°FÕ;¸FÕCÐCùòó   Ã(D$r(   r!   ©
r*   r+   r,   r-   r\   rO   rU   rY   r.   r/   r0   s   @r   r]   rá   Ú   óG   ø‡ € Ø	÷	<ó 
ð	<ð 
÷	/ó 
ð	/ð
 
÷	Dñ 	Dó 
ö	Dr   r]   c                ó    <€ V ^8„  d   QhRS[ /# rS   rt   )r   r   s   "€r   r   ÚCudaInterface.__annotate__  s   ø€ ÷ )ñ )™$ñ )r   c                 ó>   € \         P                  P                  4       # r!   )r   ræ   rw   r(   r   r   rw   ÚCudaInterface.is_available  s   € ä�z‰z×&Ñ&Ó(Ð(r   Nc                ó^   <€ V ^8„  d   QhRS[ P                  P                  RS[S[,          /# r   )r   r   r   rK   rõ   )r   r   s   "€r   r   r    s-   ø€ ÷ Yñ Y¡u§{¡{×'9Ñ'9ð YÁSÉ3ÅYñ Yr   c                ó  € \         P                  P                  f2   \         P                  P	                  V 4      w  rV^
,          V,           # \         P                  P                  V 4      P                  P                  R^4      ^ ,          # )NÚ:)r   ÚversionÚhipræ   Úget_device_capabilityrY   ÚgcnArchNameÚsplit)r   ÚmajorÚmins   &  r   rŸ   Ú$CudaInterface.get_compute_capability  sf   € ä�=‰=×ÑÒ$ÜŸ™×9Ñ9¸&ÓA‰JˆEØ˜2•: Õ#Ð#ä—:‘:×3Ñ3°FÓ;×GÑG×MÑMÈcÐSTÓUÐVWÕXÐXr   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r¶   )r   r   s   "€r   r   r    s%   ø€ ÷ 
ñ 
¡%§+¡+×"4Ñ"4ð 
Áñ 
r   c                ó¢   € \         P                  P                  R J;'       g-    \        P                  P                  V 4      P                  ^8¬  # r!   )r   r  r	  rß   r]   rY   r  rN   s   &r   r¸   ÚCudaInterface.is_triton_capable  sF   € ô �M‰M×Ñ TÐ)÷ Mð MÜ×#Ñ#×9Ñ9¸&ÓA×GÑGÈ1ÑLð	
r   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r  $  s)   ø€ ÷ Wñ W©E¯K©K×,>Ñ,>ð WÈ$ñ Wr   c                óš  € ^ RI Hp ^ RIHp \        P                  V 4      '       g<   \        P                  P                  V 4      pV! V\        P                  ! 4       4      h^ RIp\        P                  P                  e&   RVP                  P                  9  d	   V! R4      hR# RVP                  P                  9  d	   V! R4      hR# )é    r¼   )ÚGPUTooOldForTritonNÚamdz'triton not built with the 'amd' backendÚnvidiaz*triton not built with the 'nvidia' backend)r¾   r½   Útorch._inductor.excr  rß   r¸   r   ræ   rY   ÚinspectÚcurrentframeÚtriton.backendsr  r	  Úbackends)r   r½   r  Údevice_propsÚtritons   &    r   r¿   Ú)CudaInterface.raise_if_triton_unavailable#  sœ   € å<Ý:ä×.Ñ.¨v×6Ò6Ü Ÿ:™:×;Ñ;¸FÓCˆLÙ$ \´7×3GÒ3GÓ3IÓJÐJãä�=‰=×ÑÒ(Ø˜FŸO™O×4Ñ4Ô4Ù,Ð-VÓWÐWñ 5à˜VŸ_™_×5Ñ5Ô5Ù(Ð)UÓVÐVñ 6r   r(   r!   )"r*   r+   r,   r-   r   ræ   r   r=   rE   r]   r\   rU   rO   rq   rz   r�   r†   r�   r˜   rY   Úget_cuda_streamr”   Ú_exchange_devicerm   Ú_maybe_exchange_deviceri   r³   r¦   rw   rŸ   r¸   r¿   r.   r/   r0   s   @r   rß   rß   Ñ   s»  ø‡ € Ø�Z‰Z×Ñ€Fð �J‰J×Ñ€EØ�Z‰Z×Ñ€F÷ Dñ  DñD " %§*¡*×";Ñ";Ó<€NÙ˜eŸj™j×3Ñ3Ó4€JÙ §
¡
× 7Ñ 7Ó8€LÙ˜%Ÿ*™*×+Ñ+Ó,€FÙ! %§*¡*×";Ñ";Ó<€NÙ˜eŸj™j×3Ñ3Ó4€JÙ$ U§Z¡Z×%AÑ%AÓBÐÙ˜uŸz™z×5Ñ5Ó6€KÙ(¨¯©×)IÑ)IÓJÐÙ! /Ó2€NÙ" 5§:¡:×#>Ñ#>Ó?€OÙ(¨¯©×)JÑ)JÓKÐÙ# E§J¡J×$?Ñ$?Ó@ÐÙ$ U§Z¡Z×%AÑ%AÓBÐð ÷)ó ð)ð ÷Yñ Yó ðYð ÷
ñ 
ó ð
ð ÷Wñ Wó öWr   rß   )Ú_mtia_getCurrentRawStreamc                   ó  a € ] tR tRt o ]P
                  P                  t]P
                  P                  t]P
                  P                  t ! R R4      t	]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                   4      t]
! ]P
                  P"                  4      t]
! ]P
                  P$                  4      t]
! ]P
                  P&                  4      t]
! ]4      t]
! ]P
                  P,                  4      t]
! ]P
                  P0                  4      t]
! ]P
                  P4                  4      t]
! ]P
                  P6                  4      t]
V 3R lR l4       t]
RV 3R lR ll4       t]
RV 3R	 lR
 ll4       t]
RV 3R lR ll4       tRt V t!R# )ÚMtiaInterfacei<  c                   óx   a € ] tR tRt o ]V 3R lR l4       t]V 3R lR l4       t]R
V 3R lR ll4       tR	tV t	R# )ÚMtiaInterface.WorkeriB  c                ó$   <€ V ^8„  d   QhRS[ RR/# rI   rJ   )r   r   s   "€r   r   Ú!MtiaInterface.Worker.__annotate__D  rä   r   c                ó   € V \         R &   R# )ÚmtiaNrç   rN   s   &r   rO   ÚMtiaInterface.Worker.set_deviceC  rê   r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   r*  H  rì   r   c                 ón   € R \         9   d   \         R ,          # \        P                  P                  4       # )r,  )rè   r   r,  rU   r(   r   r   rU   Ú#MtiaInterface.Worker.current_deviceG  rï   r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   r*  N  rñ   r   c                óR  € V eƒ   \        V \        4      '       dA   \        P                  ! V 4      p V P                  R8w  d   \        RV P                   R24      h\        V \        P                  4      '       d   V P                  p V f   \        P                  P                  4       p R\        9  d]   \        \        P                  P                  4       4       Uu. uF"  p\        P                  P                  V4      NK$  	  ppV\        R&   \        R,          V ,          # u upi )Nr,  z"Expected device type 'mtia', got 'ró   )rô   rõ   r   r   rÈ   rö   rÇ   r&  r]   rU   r÷   rø   r,  rq   rY   rù   s   &  r   rY   Ú*MtiaInterface.Worker.get_device_propertiesM  rý   rþ   r(   r!   rÿ   r0   s   @r   r]   r(  B  r   r   r]   c                ó    <€ V ^8„  d   QhRS[ /# rS   rt   )r   r   s   "€r   r   ÚMtiaInterface.__annotate__u  s   ø€ ÷ ñ ™$ñ r   c                 óB   € \         P                  P                  4       p V # r!   )r   r,  rw   )Úrets    r   rw   ÚMtiaInterface.is_availablet  s   € ä�j‰j×%Ñ%Ó'ˆØˆ
r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   r5  z  ó%   ø€ ÷ ñ ¡u§{¡{×'9Ñ'9ð ÁSñ r   c                óD   € \         P                  P                  V 4      pV# r!   )r   r,  r
  ©r   Úccs   & r   rŸ   Ú$MtiaInterface.get_compute_capabilityy  s   € ä�Z‰Z×-Ñ-¨fÓ5ˆØˆ	r   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r¶   )r   r   s   "€r   r   r5    ó%   ø€ ÷ ñ ¡%§+¡+×"4Ñ"4ð Áñ r   c                ó   € R # ©Tr(   rN   s   &r   r¸   ÚMtiaInterface.is_triton_capable~  ó   € ár   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r5  ƒ  s)   ø€ ÷ Uñ U©E¯K©K×,>Ñ,>ð UÈ$ñ Ur   c                ó`   € ^ RI p^ RIHp RVP                  P                  9  d	   V! R4      hR# )r  Nr¼   r,  z(triton not built with the 'mtia' backend©r  r¾   r½   r  ©r   r  r½   s   &  r   r¿   Ú)MtiaInterface.raise_if_triton_unavailable‚  s+   € ãå<à˜Ÿ™×1Ñ1Ô1Ù(Ð)SÓTÐTñ 2r   r(   r!   )"r*   r+   r,   r-   r   r,  r   r=   rE   r]   r\   rU   rO   rq   rz   r�   r†   r�   r˜   rY   Úget_mtia_streamr”   r"  rm   r#  ri   r³   r¦   rw   rŸ   r¸   r¿   r.   r/   r0   s   @r   r&  r&  <  s¶  ø‡ € Ø�Z‰Z×Ñ€FØ�J‰J×Ñ€EØ�Z‰Z×Ñ€F÷ Dñ  DñD " %§*¡*×";Ñ";Ó<€NÙ˜eŸj™j×3Ñ3Ó4€JÙ §
¡
× 7Ñ 7Ó8€LÙ˜%Ÿ*™*×+Ñ+Ó,€FÙ! %§*¡*×";Ñ";Ó<€NÙ˜eŸj™j×3Ñ3Ó4€JÙ$ U§Z¡Z×%AÑ%AÓBÐÙ˜uŸz™z×5Ñ5Ó6€KÙ(¨¯©×)IÑ)IÓJÐÙ! /Ó2€NÙ" 5§:¡:×#>Ñ#>Ó?€OÙ(¨¯©×)JÑ)JÓKÐÙ# E§J¡J×$?Ñ$?Ó@ÐÙ$ U§Z¡Z×%AÑ%AÓBÐð ÷ó ðð ÷ñ ó ðð ÷ñ ó ðð ÷Uñ Uó öUr   r&  )Ú_xpu_getCurrentRawStreamc                   ó  a € ] tR tRt o ]P
                  P                  t]P
                  P                  t]P
                  P                  t ! R R4      t	]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                  4      t]
! ]P
                  P                   4      t]
! ]P
                  P"                  4      t]
! ]P
                  P$                  4      t]
! ]P
                  P&                  4      t]
! ]4      t]
! ]P
                  P,                  4      t]
! ]P
                  P0                  4      t]
! ]P
                  P4                  4      t]
V 3R lR l4       t]
RV 3R lR ll4       t]
RV 3R	 lR
 ll4       t]
RV 3R lR ll4       t]
RV 3R lR ll4       tRt V t!R# )ÚXpuInterfacei“  c                   óx   a € ] tR tRt o ]V 3R lR l4       t]V 3R lR l4       t]R
V 3R lR ll4       tR	tV t	R# )ÚXpuInterface.Workeri™  c                ó$   <€ V ^8„  d   QhRS[ RR/# rI   rJ   )r   r   s   "€r   r   Ú XpuInterface.Worker.__annotate__›  s   ø€ ÷ 	;ñ 	;™sð 	; tñ 	;r   c                ó   € V \         R &   R# )ÚxpuNrç   rN   s   &r   rO   ÚXpuInterface.Worker.set_deviceš  s   € à4:Ô*¨5Ó1r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   rQ  Ÿ  s   ø€ ÷ 	.ñ 	.¡ñ 	.r   c                 ón   € R \         9   d   \         R ,          # \        P                  P                  4       # )rS  )rè   r   rS  rU   r(   r   r   rU   Ú"XpuInterface.Worker.current_devicež  s)   € àÔ6Ô6Ü5°eÕ<Ð<Ü—9‘9×+Ñ+Ó-Ð-r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   rQ  ¥  s)   ø€ ÷ 	Cñ 	C©%¯+©+×*<Ñ*<ð 	CÉñ 	Cr   c                óR  € V eƒ   \        V \        4      '       dA   \        P                  ! V 4      p V P                  R8w  d   \        RV P                   R24      h\        V \        P                  4      '       d   V P                  p V f   \        P                  P                  4       p R\        9  d]   \        \        P                  P                  4       4       Uu. uF"  p\        P                  P                  V4      NK$  	  ppV\        R&   \        R,          V ,          # u upi )NrS  z!Expected device type 'xpu', got 'ró   )rô   rõ   r   r   rÈ   rö   rÇ   rM  r]   rU   r÷   rø   rS  rq   rY   rù   s   &  r   rY   Ú)XpuInterface.Worker.get_device_properties¤  sð   € àÒ!Ü˜f¤c×*Ò*Ü"Ÿ\š\¨&Ó1�FØ—{‘{ eÔ+Ü,Ø?ÀÇÁ¸}ÈAÐNóð ô ˜f¤e§l¡l×3Ò3Ø#Ÿ\™\�FØŠ~Ü%×,Ñ,×;Ñ;Ó=�àÔ<Ô<ô #¤5§9¡9×#9Ñ#9Ó#;Ô<óá<˜ô —I‘I×3Ñ3°AÖ6Ù<ð ð ð ;FÔ0°Ñ7ä3°EÕ:¸6ÕBÐBùòrþ   r(   r!   rÿ   r0   s   @r   r]   rO  ™  sG   ø‡ € Ø	÷	;ó 
ð	;ð 
÷	.ó 
ð	.ð
 
÷	Cñ 	Có 
ö	Cr   r]   c                ó    <€ V ^8„  d   QhRS[ /# rS   rt   )r   r   s   "€r   r   ÚXpuInterface.__annotate__Ë  s   ø€ ÷ (ñ (™$ñ (r   c                 ó>   € \         P                  P                  4       # r!   )r   rS  rw   r(   r   r   rw   ÚXpuInterface.is_availableÊ  s   € ä�y‰y×%Ñ%Ó'Ð'r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   r\  Ï  r:  r   c                óD   € \         P                  P                  V 4      pV# r!   )r   rS  r
  r<  s   & r   rŸ   Ú#XpuInterface.get_compute_capabilityÎ  s   € ä�Y‰Y×,Ñ,¨VÓ4ˆØˆ	r   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r¢   rt   )r   r   s   "€r   r   r\  Ô  s   ø€ ÷ -ñ -©tð -Áñ -r   c                ó>   € \         P                  P                  4       # r!   )r   rS  r¦   r¥   s   &r   r¦   ÚXpuInterface.is_bf16_supportedÓ  s   € ä�y‰y×*Ñ*Ó,Ð,r   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r¶   )r   r   s   "€r   r   r\  Ø  r@  r   c                ó   € R # rB  r(   rN   s   &r   r¸   ÚXpuInterface.is_triton_capable×  rD  r   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r\  Ü  s)   ø€ ÷ Vñ V©E¯K©K×,>Ñ,>ð VÈ$ñ Vr   c                ó`   € ^ RI p^ RIHp RVP                  P                  9  d	   V! R4      hR# )r  Nr¼   Úintelz)triton not built with the 'intel' backendrG  rH  s   &  r   r¿   Ú(XpuInterface.raise_if_triton_unavailableÛ  s+   € ãå<à˜&Ÿ/™/×2Ñ2Ô2Ù(Ð)TÓUÐUñ 3r   r(   r!   rÁ   )"r*   r+   r,   r-   r   rS  r   r=   rE   r]   r\   rU   rO   rq   rz   r�   r†   r�   r˜   rY   Úget_xpu_streamr”   r"  rm   r#  ri   r³   rw   rŸ   r¦   r¸   r¿   r.   r/   r0   s   @r   rM  rM  “  s¸  ø‡ € Ø�Y‰Y×Ñ€FØ�I‰I�O‰O€EØ�Y‰Y×Ñ€F÷ Cñ  CñD " %§)¡)×":Ñ":Ó;€NÙ˜eŸi™i×2Ñ2Ó3€JÙ §	¡	× 6Ñ 6Ó7€LÙ˜%Ÿ)™)×*Ñ*Ó+€FÙ! %§)¡)×":Ñ":Ó;€NÙ˜eŸi™i×2Ñ2Ó3€JÙ$ U§Y¡Y×%@Ñ%@ÓAÐÙ˜uŸy™y×4Ñ4Ó5€KÙ(¨¯©×)HÑ)HÓIÐÙ! .Ó1€NÙ" 5§9¡9×#=Ñ#=Ó>€OÙ(¨¯©×)IÑ)IÓJÐÙ# E§I¡I×$>Ñ$>Ó?Ðð ÷(ó ð(ð ÷ñ ó ðð ÷-ñ -ó ð-ð ÷ñ ó ðð ÷Vñ Vó öVr   rM  c                   ó,   a € ] tR tRt o V 3R ltRtV tR# )ÚCpuDevicePropertiesiå  c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )r   Úmulti_processor_countrJ   )r   r   s   "€r   r   Ú CpuDeviceProperties.__annotate__å  s   ø‡ ‚ áÑò r   r(   N)r*   r+   r,   r-   Ú__annotate_func__r.   r/   r0   s   @r   rn  rn  å  s   ø‡ ‡ „ r   rn  c                   óR  a € ] tR tRt o  ! R R]P
                  4      t ! R R4      t]V 3R lR l4       t]RV 3R lR	 ll4       t	]RV 3R lR ll4       t
]V 3R lR l4       t]V 3R lR l4       t]RV 3R lR ll4       t]RV 3R lR ll4       t]RV 3R lR ll4       tRtV tR
# )ÚCpuInterfaceiê  c                   ó^   a € ] tR tRt o R
V 3R lR lltV 3R lR ltRV 3R lR lltR	tV tR# )ÚCpuInterface.Eventiì  c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úenable_timingr   Nrt   )r   r   s   "€r   r   ÚCpuInterface.Event.__annotate__í  s   ø€ ÷ 	ñ 	©$ð 	¸$ñ 	r   c                ó   € R V n         R# )g        N©Útime)rÐ   rx  s   &&r   rÑ   ÚCpuInterface.Event.__init__í  s	   € ØˆDŽIr   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Úotherr   )r   Úfloat)r   r   s   "€r   r   ry  ð  s   ø€ ÷ 	3ñ 	3¡cð 	3©eñ 	3r   c                óJ   € VP                   V P                   ,
          R ,          # )iè  r{  )rÐ   r  s   &&r   Úelapsed_timeÚCpuInterface.Event.elapsed_timeð  s   € Ø—J‘J §¡Õ*¨dÕ2Ð2r   Nc                ó$   <€ V ^8„  d   QhRS[ RR/# r„   r7   )r   r   s   "€r   r   ry  ó  s   ø€ ÷ 	,ñ 	,¡ð 	,°ñ 	,r   c                ó:   € \         P                  ! 4       V n         R # r!   )r|  Úperf_counter)rÐ   rz   s   &&r   ÚrecordÚCpuInterface.Event.recordó  s   € Ü×)Ò)Ó+ˆDŽIr   r{  rB  r!   )	r*   r+   r,   r-   rÑ   r‚  r‡  r.   r/   r0   s   @r   r=   rv  ì  s(   ø‡ € ÷	ò 	÷	3ð 	3÷	,÷ 	,ð 	,r   r=   c                   ó@   a € ] tR tRt o ]RV 3R lR ll4       tRtV tR# )ÚCpuInterface.Workeri÷  Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   )r   r   r   rn  )r   r   s   "€r   r   Ú CpuInterface.Worker.__annotate__ù  s'   ø€ ÷ 	2ñ 	2Ù—K‘K×&Ñ&ð	2á ñ	2r   c                ó@   € ^ RI pVP                  4       p\        V4      # )r  N)ÚmultiprocessingÚ	cpu_countrn  )r   rŽ  r�  s   &  r   rY   Ú)CpuInterface.Worker.get_device_propertiesø  s    € ó #à'×1Ñ1Ó3ˆIÜ& yÓ1Ð1r   r(   r!   )r*   r+   r,   r-   r\   rY   r.   r/   r0   s   @r   r]   rŠ  ÷  s   ø‡ € Ø	÷	2ñ 	2ó 
ö	2r   r]   c                ó    <€ V ^8„  d   QhRS[ /# rS   rt   )r   r   s   "€r   r   ÚCpuInterface.__annotate__  s   ø€ ÷ ñ ™$ñ r   c                 ó   € R # rB  r(   r(   r   r   rw   ÚCpuInterface.is_available  rD  r   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r¢   rt   )r   r   s   "€r   r   r’    ó   ø€ ÷ ñ ©tð Áñ r   c                ó   € R # rB  r(   r¥   s   &r   r¦   ÚCpuInterface.is_bf16_supported  rD  r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   ©r   r   r   rõ   )r   r   s   "€r   r   r’  
  ó%   ø€ ÷ ñ ¡u§{¡{×'9Ñ'9ð ÁSñ r   c                ó   € R # ©Ú r(   rN   s   &r   rŸ   Ú#CpuInterface.get_compute_capability	  ó   € ár   c                ó&   <€ V ^8„  d   QhRS[ RS[/# r�   )r   rK   )r   r   s   "€r   r   r’    s   ø€ ÷ ñ ¡3ð ©3ñ r   c                ó   € ^ # ©r  r(   r“   s   &r   r”   ÚCpuInterface.get_raw_stream  ó   € ár   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   r’    ó   ø€ ÷ ñ ™Cñ r   c                 ó   € ^ # r£  r(   r(   r   r   rU   ÚCpuInterface.current_device  r¥  r   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r’    s%   ø€ ÷ ñ ™EŸK™K×.Ñ.ð ¸$ñ r   c                ó   € R # r!   r(   rN   s   &r   r˜   ÚCpuInterface.synchronize  s   € ár   c                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r¶   )r   r   s   "€r   r   r’    r@  r   c                ó   € R # rB  r(   rN   s   &r   r¸   ÚCpuInterface.is_triton_capable  rD  r   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r’    s)   ø€ ÷ Tñ T©E¯K©K×,>Ñ,>ð TÈ$ñ Tr   c                ó`   € ^ RI p^ RIHp RVP                  P                  9  d	   V! R4      hR# )r  Nr¼   Úcpuz'triton not built with the 'cpu' backendrG  rH  s   &  r   r¿   Ú(CpuInterface.raise_if_triton_unavailable  s+   € ãå<à˜Ÿ™×0Ñ0Ô0Ù(Ð)RÓSÐSñ 1r   r(   rÁ   r!   )r*   r+   r,   r-   r   r=   r]   r\   rw   r¦   rŸ   r”   rU   r˜   r¸   r¿   r.   r/   r0   s   @r   rt  rt  ê  sÛ   ø‡ € ô,�—‘ô ,÷2ñ 2ð ÷ó ðð ÷ñ ó ðð ÷ñ ó ðð ÷ó ðð ÷ó ðð ÷ñ ó ðð ÷ñ ó ðð ÷Tñ Tó öTr   rt  c                   óì   a € ] tR tRt o ]RV 3R lR ll4       t]RV 3R lR ll4       t]V 3R lR l4       t]V 3R lR	 l4       t	]RV 3R lR ll4       t
]RV 3R lR ll4       t ! R R4      tRtV tR
# )ÚMpsInterfacei'  c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r¢   rt   )r   r   s   "€r   r   ÚMpsInterface.__annotate__)  r–  r   c                ó   € R # rB  r(   r¥   s   &r   r¦   ÚMpsInterface.is_bf16_supported(  rD  r   c                ó@   <€ V ^8„  d   QhRS[ P                  RS[RS[/# r©   r«   )r   r   s   "€r   r   r·  -  s)   ø€ ÷ ñ Ù—K‘KðÙ6:ðá	ñr   c                óT   € V\         P                  \         P                  39   d   R # R# )FT)r   Úfloat64Ú
complex128r®   s   &&&r   r¯   ÚMpsInterface.is_dtype_supported,  s!   € ð ”U—]‘]¤E×$4Ñ$4Ð5Ô5ÙÙr   c                ó    <€ V ^8„  d   QhRS[ /# rS   rt   )r   r   s   "€r   r   r·  5  s   ø€ ÷ 1ñ 1™$ñ 1r   c                 óR   € \         P                  P                  P                  4       # r!   )r   r  Úmpsrw   r(   r   r   rw   ÚMpsInterface.is_available4  s   € ä�~‰~×!Ñ!×.Ñ.Ó0Ð0r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   r·  9  r§  r   c                 ó   € ^ # r£  r(   r(   r   r   rU   ÚMpsInterface.current_device8  r¥  r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   rš  )r   r   s   "€r   r   r·  =  r›  r   c                ó   € R # r�  r(   rN   s   &r   rŸ   Ú#MpsInterface.get_compute_capability<  r   r   c                óL   <€ V ^8„  d   QhRS[ P                  P                  RR/# rI   rd   )r   r   s   "€r   r   r·  A  s%   ø€ ÷  ñ  ™EŸK™K×.Ñ.ð  ¸$ñ  r   c                óB   € \         P                  P                  4        R # r!   )r   rÁ  r˜   rN   s   &r   r˜   ÚMpsInterface.synchronize@  s   € ä�	‰	×ÑÖr   c                   ó\   a € ] tR tRt o ]RV 3R lR ll4       t]V 3R lR l4       tRtV tR# )	ÚMpsInterface.WorkeriE  Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   Ú MpsInterface.Worker.__annotate__G  ó%   ø€ ÷ 	ñ 	©%¯+©+×*<Ñ*<ð 	Éñ 	r   c                ót   € \        R R.4      ! \        P                  P                  P	                  4       4      # )ÚMPSPropertiesrp  )r   r   r  rÁ  Úget_core_countrN   s   &r   rY   Ú)MpsInterface.Worker.get_device_propertiesF  s0   € ä˜oÐ0GÐ/HÔIÜ—‘×"Ñ"×1Ñ1Ó3óð r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   rÏ  M  ó   ø€ ÷ 	ñ 	¡ñ 	r   c                 ó   € ^ # r£  r(   r(   r   r   rU   Ú"MpsInterface.Worker.current_deviceL  ó   € ár   r(   r!   ©	r*   r+   r,   r-   r\   rY   rU   r.   r/   r0   s   @r   r]   rÍ  E  ó0   ø‡ € Ø	÷	ñ 	ó 
ð	ð
 
÷	ó 
ö	r   r]   r(   rÁ   r!   )r*   r+   r,   r-   r\   r¦   rÂ   r¯   rw   rU   rŸ   r˜   r]   r.   r/   r0   s   @r   rµ  rµ  '  s™   ø‡ € Ø÷ñ ó ðð ÷ñ ó ðð ÷1ó ð1ð ÷ó ðð ÷ñ ó ðð ÷ ñ  ó ð ÷	÷ 	r   rµ  c                   óÌ   a € ] tR tRt o ]RV 3R lR ll4       t]RV 3R lR ll4       t]V 3R lR l4       t]V 3R lR	 l4       t	]RV 3R lR ll4       t
 ! R R4      tRtV tR
# )ÚTpuInterfaceiQ  c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r¢   rt   )r   r   s   "€r   r   ÚTpuInterface.__annotate__S  r–  r   c                ó   € R # rB  r(   r¥   s   &r   r¦   ÚTpuInterface.is_bf16_supportedR  rD  r   c                ó@   <€ V ^8„  d   QhRS[ P                  RS[RS[/# r©   r«   )r   r   s   "€r   r   rß  W  s)   ø€ ÷ 	
ñ 	
Ù—K‘Kð	
Ù6:ð	
á	ñ	
r   c                ó¢   € V\         P                  \         P                  \         P                  \         P                  \         P
                  39  # r!   )r   r¼  Ú	complex32Ú	complex64r½  Úhalfr®   s   &&&r   r¯   ÚTpuInterface.is_dtype_supportedV  s;   € ð Ü�M‰MÜ�O‰OÜ�O‰OÜ×ÑÜ�J‰Jð
ñ 
ð 	
r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rt   )r   r   s   "€r   r   rß  c  s   ø€ ÷ ñ ™$ñ r   c                 ó   € \        4       # r!   r
   r(   r   r   rw   ÚTpuInterface.is_availableb  s
   € ä‹Ðr   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   rß  g  r§  r   c                 ó   € ^ # r£  r(   r(   r   r   rU   ÚTpuInterface.current_devicef  r¥  r   Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   rš  )r   r   s   "€r   r   rß  k  r›  r   c                ó   € R # r�  r(   rN   s   &r   rŸ   Ú#TpuInterface.get_compute_capabilityj  r   r   c                   ó\   a € ] tR tRt o ]RV 3R lR ll4       t]V 3R lR l4       tRtV tR# )	ÚTpuInterface.Workerio  Nc                óN   <€ V ^8„  d   QhRS[ P                  P                  RS[/# r   r   )r   r   s   "€r   r   Ú TpuInterface.Worker.__annotate__q  rÐ  r   c                ó(   € \        R R.4      ! ^4      # )ÚTPUPropertiesrp  r   rN   s   &r   rY   Ú)TpuInterface.Worker.get_device_propertiesp  s   € ä˜oÐ0GÐ/HÔIØóð r   c                ó    <€ V ^8„  d   QhRS[ /# rS   rJ   )r   r   s   "€r   r   rô  w  rÖ  r   c                 ó   € ^ # r£  r(   r(   r   r   rU   Ú"TpuInterface.Worker.current_devicev  rÙ  r   r(   r!   rÚ  r0   s   @r   r]   rò  o  rÛ  r   r]   r(   rÁ   r!   )r*   r+   r,   r-   r\   r¦   rÂ   r¯   rw   rU   rŸ   r]   r.   r/   r0   s   @r   rÝ  rÝ  Q  s€   ø‡ € Ø÷ñ ó ðð ÷	
ñ 	
ó ð	
ð ÷ó ðð ÷ó ðð ÷ñ ó ð÷	÷ 	r   rÝ  Fc                ót   € V ^8„  d   QhR\         \        P                  ,          R\        \        ,          RR/# )r   r   rÆ   r   N©rõ   r   r   rÈ   r   )r   s   "r   r   r     s2   € ÷ 1ñ 1Ü”%—,‘,Õð1Ü26´Õ2Gð1à	ñ1r   c                 óp   € \        V \        P                  4      '       d   V P                  p V\        V &   R # r!   )rô   r   r   rÈ   Údevice_interfaces)r   rÆ   s   &&r   Úregister_interface_for_devicerÿ    s)   € ô �&œ%Ÿ,™,×'Ò'Ø—‘ˆØ 0Ô�fÓr   c                óp   € V ^8„  d   QhR\         \        P                  ,          R\        \        ,          /# r   rü  )r   s   "r   r   r   ‡  s,   € ÷ Cñ C¤S¬5¯<©<Õ%7ð C¼DÄÕ<Qñ Cr   c                 óÒ   € \        V \        P                  4      '       d   V P                  p \        '       g   \        4        V \        9   d   \        V ,          # \        R V  24      h)zNo interface for device )rô   r   r   rÈ   Ú_device_initializedÚinit_device_regrþ  r#   rN   s   &r   Úget_interface_for_devicer  ‡  sO   € Ü�&œ%Ÿ,™,×'Ò'Ø—‘ˆßÓÜÔØÔ"Ô"Ü  Õ(Ð(Ü
Ð 8¸¸ÐAÓ
BÐBr   c                ór   € V ^8„  d   QhR\         \        \        \        \        ,          3,          ,          /# rS   )r   Útuplerõ   rÈ   r   )r   s   "r   r   r   ‘  s'   € ÷ %ñ %¬(´5¼¼dÄ?Õ>SÐ9SÕ3TÕ*Uñ %r   c                  óV   € \         '       g   \        4        \        P                  4       # r!   )r  r  rþ  Úitemsr(   r   r   Ú get_registered_device_interfacesr	  ‘  s   € ßÓÜÔÜ×"Ñ"Ó$Ð$r   c                ó   € V ^8„  d   QhRR/# rÔ   r(   )r   s   "r   r   r   —  s   € ÷ ñ ˜ñ r   c                  óP  € \        R \        4       \        \        P                  P                  4       4       F  p \        RV  2\        4       K  	  \        R\        4       \        \        P                  P                  4       4       F  p \        RV  2\        4       K  	  \        R\        4       \        \        P                  P                  4       4       F  p \        RV  2\        4       K  	  \        R\        4       \        R\        4       \        R\        4       R	sR
# )ræ   zcuda:rS  zxpu:r,  zmtia:r²  rÁ  ÚtpuTN)rÿ  rß   rø   r   ræ   rq   rM  rS  r&  r,  rt  rµ  rÝ  r  )rú   s    r   r  r  —  sÎ   € ä! &¬-Ô8Ü”5—:‘:×*Ñ*Ó,Ö-ˆÜ%¨¨a¨S k´=ÖAñ .ô " %¬Ô6Ü”5—9‘9×)Ñ)Ó+Ö,ˆÜ%¨¨Q¨C j´,Ö?ñ -ô " &¬-Ô8Ü”5—:‘:×*Ñ*Ó,Ö-ˆÜ%¨¨a¨S k´=ÖAñ .ô " %¬Ô6Ü! %¬Ô6Ü! %¬Ô6àÒr   c                ó  € V ^8„  d   Qh/ ^ \         9   d#   \        \        .\        3,          R,          ;R&   ^\         9   d   \        \        \
        3,          ;R&   ^\         9   d   \        \        \        3,          ;R&   ^\         9   d#   \        \        .\        3,          R,          ;R&   ^\         9   d#   \        \        .\        3,          R,          ;R&   ^\         9   d&   \        \        \        \        ,          3,          ;R&   # )r   Nr!  r÷   rè   rJ  rl  rþ  )Ú__conditional_annotations__r   rK   Údictrõ   r   rÈ   r   )r   s   "r   r   r      sÑ   € ÷ ñ ÷8 -Ò ,”œ3˜%¤˜*Õ%¨Õ,Ñ ,ñ9÷F 6Ò 5¤$¤s¬C x¥.Ñ 5ñG÷H 4Ò 3¤¤S¬# X¥Ñ 3ñI÷h	 -Ò ,”œ3˜%¤˜*Õ%¨Õ,Ñ ,ñi	÷V ,Ò +”œ#˜¤˜Õ$ tÕ+Ñ +ñW÷t 9Ò 8”4œœT¤/Õ2Ð2Õ3Ñ 8òur   ).r  r[   r  r|  Úcollectionsr   Úcollections.abcr   r   Údataclassesr   Útypingr   r	   r   Útorch.utils._pallasr   ræ   Ú_is_compiledÚtorch._Cr   r!  r÷   rè   r   rÄ   rß   r,  r$  rJ  r&  rS  rK  rl  rM  rn  rt  rµ  rÝ  rþ  r  rÿ  r  r	  r  r   )r  s   @r   Ú<module>r     sK  øðöó" Û Ý "ß .Ý !ß ã Ý -ó -Ø‡:�:×Ñ×ÒÞEà€Oð 46Ð  Ó 5Ø13Ð Ó 3÷Kñ K÷\ñ ô6aW�Oô aWóH -Ø‡:�:×Ñ×ÒÞEà€OôMU�Oô MUó` ,Ø‡9�9×Ñ×ÒÞCà€NôOV�?ô OVðd ÷ð ó ðô:T�?ô :Tôz'�?ô 'ôT'�?ô 'ðT 79Ð Ó 8ØÐ õ1õCõ%÷r   