o
    :/i
                     @   sb   d dl mZ d dlmZmZ d dlmZmZ d dlm	Z	 d dl
mZ ed Ze	G dd dZd	S )
    )Callable)AnyLiteral)Fieldfield_validator)config)	safe_hash)	autotriton	deep_gemmcutlassflashinfer_trtllmflashinfer_cutlassflashinfer_cutedslmarlinaiterc                   @   s   e Zd ZU dZeddZeed< 	 dZe	ed< 	 e
ddded	ed
efddZ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_autotuner	   moe_backendbefore)modevaluereturnc                 C   s   t |tr| ddS |S )N-_)
isinstancestrlowerreplace)clsr    r!   _/lsinfo/ai/hellotax_ai/llm_service/venv_vllm/lib/python3.10/site-packages/vllm/config/kernel.py_normalize_moe_backend-   s   
z#KernelConfig._normalize_moe_backendc                 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   r   encode	hexdigest)selffactorshash_strr!   r!   r"   compute_hash4   s   zKernelConfig.compute_hashwraphandlerc                 C   s   |du r|S ||S )zFSkip validation if the value is `None` when initialization is delayed.Nr!   )r    r   r,   r!   r!   r"   _skip_none_validationF   s   z"KernelConfig._skip_none_validation)__name__
__module____qualname____doc__r   r   bool__annotations__r   
MoEBackendr   classmethodr   r#   r   r*   r   r-   r!   r!   r!   r"   r      s   
 

r   N)collections.abcr   typingr   r   pydanticr   r   vllm.config.utilsr   vllm.utils.hashingr   r4   r   r!   r!   r!   r"   <module>   s   