o
    i.                     @   sV   d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
 eG dd dZdS )	    )Callable)Any)Fieldfield_validator)config)	safe_hashc                   @   sZ   e Zd ZU dZeddZeed< 	 defddZ	e
ddd	ed
ededefddZdS )KernelConfigz7Configuration for kernel selection and warmup behavior.N)defaultenable_flashinfer_autotunereturnc                 C   s    g }t t| dd }|S )a  
        WARNING: Whenever a new field is added to this config,
        ensure that it is included in the factors list if
        it affects the computation graph.

        Provide a hash that uniquely identifies all the configs
        that affect the structure of the computation
        graph from input ids/embeddings to the final hidden states,
        excluding anything before input ids/embeddings and after
        the final hidden states.
        F)usedforsecurity)r   strencode	hexdigest)selffactorshash_str r   H/home/ubuntu/vllm_env/lib/python3.10/site-packages/vllm/config/kernel.pycompute_hash   s   zKernelConfig.compute_hashwrap)modevaluehandlerc                 C   s   |du r|S ||S )zFSkip validation if the value is `None` when initialization is delayed.Nr   )clsr   r   r   r   r   _skip_none_validation&   s   z"KernelConfig._skip_none_validation)__name__
__module____qualname____doc__r   r
   bool__annotations__r   r   r   classmethodr   r   r   r   r   r   r   r      s   
 
r   N)collections.abcr   typingr   pydanticr   r   vllm.config.utilsr   vllm.utils.hashingr   r   r   r   r   r   <module>   s   