o
    Tio                     @   sD   d dl mZmZ d dlmZmZ d dlZdZdZG dd deZ	dS )    )ABCabstractmethod)IterableTupleNmegatronhuggingfacec                   @   s0   e Zd ZdZedeeeej	f  fddZ
dS )CheckpointEngineBasea  
    Abstract interface for checkpoint engines to implement.

    There is no ``__init__`` method here by design, since the creation of the checkpoint
    engine will happen outside the policy/engine code. The tradeoff being made here is
    that we will write different frontends for different checkpoint engines, but these
    frontends can be tailored to the specific checkpoint engine/model source needs.
    returnc                 C   s   dS )a  
        This method should create a generator of tuples of the form (name, parameter) for
        all parameters in the model. The name should be the fully qualified name of the
        parameter, and the parameter should be a torch.Tensor.

        The expected use of a checkpoint engine is the following:
        ```python
        for name, parameter in checkpoint_engine.parameters():
            container_map.map_param(name, parameter)
        ```
        For a concrete use example, see ``InferenceV2Policy``.
        N )selfr
   r
   a/home/ubuntu/.local/lib/python3.10/site-packages/deepspeed/inference/v2/checkpoint/base_engine.py
parameters   s   zCheckpointEngineBase.parametersN)__name__
__module____qualname____doc__r   r   r   strtorchTensorr   r
   r
   r
   r   r      s    	"r   )
abcr   r   typingr   r   r   MEGATRONHUGGINGFACEr   r
   r
   r
   r   <module>   s   