o
    „o™i+  ã                   @   sŠ   d dl Z d dlmZ d dlmZ ddd„ZG dd„ dƒZG dd	„ d	ƒZG d
d„ dƒZ	G dd„ dƒZ
G dd„ dƒZddd„Zeƒ  eƒ  dS )é    N)ÚAnyÚreturnc                  C   s@   t jt } | t jd< | t jd< | t jd< | t jd< | t jd< d S )Nz"lightning.pytorch.accelerators.hpuz)lightning.pytorch.strategies.hpu_parallelz'lightning.pytorch.strategies.single_hpuz'lightning.pytorch.plugins.io.hpu_pluginz'lightning.pytorch.plugins.precision.hpu)ÚsysÚmodulesÚ__name__)Úself© r   úT/home/ubuntu/.local/lib/python3.10/site-packages/lightning/pytorch/_graveyard/hpu.pyÚ_patch_sys_modules   s   




r
   c                   @   s:   e Zd ZdZdZdZdZdZdZde	de	ddfdd„Z
dS )ÚHPUAccelerator.Ú_Ú__r   Nc                 O   ó   t dƒ‚)Na  The `HPUAccelerator` class has been moved to an external package. Install the extension package as `pip install lightning-habana` and import with `from lightning_habana import HPUAccelerator`. Please see: https://github.com/Lightning-AI/lightning-Habana for more details.©ÚNotImplementedError©r   r   r   r   r   r	   Ú__init__   ó   ÿzHPUAccelerator.__init__)r   Ú
__module__Ú__qualname__Úauto_device_countÚget_parallel_devicesÚis_availableÚparse_devicesÚsetup_deviceÚteardownr   r   r   r   r   r	   r      s    r   c                   @   sN   e Zd Zdededdfdd„Zdededdfdd„Zdededefd	d
„ZdS )ÚHPUParallelStrategyr   r   r   Nc                 O   r   )Na  The `HPUParallelStrategy` class has been moved to an external package. Install the extension package as `pip install lightning-habana` and import with `from lightning_habana import HPUParallelStrategy`. Please see: https://github.com/Lightning-AI/lightning-Habana for more details.r   r   r   r   r	   r   "   r   zHPUParallelStrategy.__init__c                 O   ó   t ‚©Nr   r   r   r   r	   Úsetup*   ó   zHPUParallelStrategy.setupc                 O   r   r   r   r   r   r   r	   Úget_device_stats-   r    z$HPUParallelStrategy.get_device_stats)r   r   r   r   r   r   Údictr!   r   r   r   r	   r   !   s    r   c                   @   ó"   e Zd Zdededdfdd„ZdS )ÚSingleHPUStrategyr   r   r   Nc                 O   r   )Na  The `SingleHPUStrategy` class has been moved to an external package. Install the extension package as `pip install lightning-habana` and import with `from lightning_habana import SingleHPUStrategy`. Please see: https://github.com/Lightning-AI/lightning-Habana for more details.r   r   r   r   r	   r   2   r   zSingleHPUStrategy.__init__©r   r   r   r   r   r   r   r   r	   r$   1   ó    r$   c                   @   r#   )ÚHPUCheckpointIOr   r   r   Nc                 O   r   )Na  The `HPUCheckpointIO` class has been moved to an external package. Install the extension package as `pip install lightning-habana` and import with `from lightning_habana import HPUCheckpointIO`. Please see: https://github.com/Lightning-AI/lightning-Habana for more details.r   r   r   r   r	   r   <   r   zHPUCheckpointIO.__init__r%   r   r   r   r	   r'   ;   r&   r'   c                   @   r#   )ÚHPUPrecisionPluginr   r   r   Nc                 O   r   )Na  The `HPUPrecisionPlugin` class has been moved to an external package. Install the extension package as `pip install lightning-habana` and import with `from lightning_habana import HPUPrecisionPlugin`. Please see: https://github.com/Lightning-AI/lightning-Habana for more details.r   r   r   r   r	   r   F   r   zHPUPrecisionPlugin.__init__r%   r   r   r   r	   r(   E   r&   r(   c                   C   sj   t tjdtƒ t tjdtƒ t tjdtƒ t tjdtƒ t tjj	dtƒ t tjdt
ƒ t tjjdt
ƒ d S )Nr   r   r$   r'   r(   )ÚsetattrÚplÚacceleratorsr   Ú
strategiesr   r$   Úpluginsr'   Úior(   Ú	precisionr   r   r   r	   Ú_patch_classesO   s   r0   )r   N)r   Útypingr   Úlightning.pytorchÚpytorchr*   r
   r   r   r$   r'   r(   r0   r   r   r   r	   Ú<module>   s    
	





