o
    
۾iT                     @   s   U d dl Z d dlmZmZmZ d dlmZ eeZda	da
eed< deddfdd	Zdeddfd
dZdaeed< dddZdeddfddZdS )    N)CompilationConfigCompilationMode
VllmConfig)init_loggerg        torch_compile_start_timevllm_configreturnc                 C   sj   t   a| j}|  }|jtjkr1|r3dd l}|jddd t	
d| || at  d S d S d S )Nr   T)parentsexist_okzDumping depyf output to %s)timer   compilation_configcompile_debug_dump_pathmoder   VLLM_COMPILEdepyfmkdirloggerdebugprepare_debugas_posixcontext_manager	__enter__)r   r   pathr    r   L/home/ubuntu/.local/lib/python3.10/site-packages/vllm/compilation/monitor.pystart_monitoring_torch_compile   s   r   c                 C   sJ   | j }|jtjkr!tjd|jdd td ur#td d d  d ad S d S d S )Nz#torch.compile takes %.2f s in totallocal)scope)	r   r   r   r   r   	info_oncecompilation_timer   __exit__)r   r   r   r   r   end_monitoring_torch_compile   s   r!   Tcudagraph_capturing_enabledc                   C   s   t stdd S )Nz]CUDA graph capturing detected at an inappropriate time. This operation is currently disabled.)r"   RuntimeErrorr   r   r   r   $validate_cudagraph_capturing_enabled0   s
   r$   enabledc                 C   s   | a d S )N)r"   )r%   r   r   r   set_cudagraph_capturing_enabled<   s   r&   )r   N)r   vllm.configr   r   r   vllm.loggerr   __name__r   r   r   float__annotations__r   r!   r"   boolr$   r&   r   r   r   r   <module>   s   

