
    -`i                     J    d dl mZmZ d dlmZmZ d dlZ G d de          ZdS )    )ABCabstractmethod)AnyNoReturnNc                       e Zd ZdZedej        j        j        ddfd            Z	ede
dz  fd            Zde
dz  fdZde
defd	ZdS )
Torch25CustomGraphPassaI  
    This class replaces CustomGraphPass from torch==2.6 when using torch<2.6.
    It conforms to the 2.6 interface but also supports pickling, as that's what
    the inductor code cache uses to determine the cache key before 2.6.
    (in 2.6 and above, uuid() is used.)

    Subclasses can just "pretend" that uuid is used.
    graphreturnNc                     dS )z4
        Implementation of the custom pass.
        N )selfr	   s     ~/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/compilation/torch25_custom_graph_pass.py__call__zTorch25CustomGraphPass.__call__             c                     dS )z
        Return an ID to uniquely identify your custom pass implementation.
        Return None to skip inductor code caching entirely.
        Nr   r   s    r   uuidzTorch25CustomGraphPass.uuid   r   r   c                 *    |                                  S )z
        Pickling is used instead of uuid() in torch<2.6. Just return uuid()
         to enable subclasses to only have to implement uuid.
        )r   r   s    r   __getstate__z#Torch25CustomGraphPass.__getstate__    s    
 yy{{r   statec                      t          d          )NzCannot unpickle CustomGraphPass because pickling is used for cache key uuid. Use torch>=2.6 with native uuid support for custom passes.)
ValueError)r   r   s     r   __setstate__z#Torch25CustomGraphPass.__setstate__'   s    6
 
 	
r   )__name__
__module____qualname____doc__r   torchfxr	   Graphr   r   r   r   r   r   r   r   r   r   r   	   s          ehn2 t    ^
 cDj    ^cDj    
# 
( 
 
 
 
 
 
r   r   )abcr   r   typingr   r   r   r   r   r   r   <module>r$      st    $ # # # # # # #                 #
 #
 #
 #
 #
S #
 #
 #
 #
 #
r   