o
    ˜à·iç  ã                   @   s,   d dl mZ ddlmZ G dd„ deƒZdS )é    )Úfxé   )ÚVllmInductorPassc                   @   s*   e Zd ZdZejdejddfdd„ƒZdS )ÚPostCleanupPassa  
    This pass performs cleanup after custom passes.
    It topologically sorts the graph and removes unused nodes.
    This is needed because the pattern matcher does not guarantee producing
    a topologically sorted graph, and there may be unused nodes left around.
    ÚgraphÚreturnNc                 C   s    ddl m} ||ƒ | ¡  d S )Nr   )Ústable_topological_sort)Útorch._inductor.pattern_matcherr   Úeliminate_dead_code)Úselfr   r   © r   úb/home/ubuntu/vllm_env/lib/python3.10/site-packages/vllm/compilation/passes/utility/post_cleanup.pyÚ__call__   s   zPostCleanupPass.__call__)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Útime_and_logr   ÚGraphr   r   r   r   r   r      s    r   N)Útorchr   Úvllm_inductor_passr   r   r   r   r   r   Ú<module>   s   