o
    ۷i&                     @   sJ   d dl mZ ddlmZ ddlmZ d dlmZ eeZG dd dZ	dS )	    )Optional   )BasicCacheConfig)CalibratorConfig)init_loggerc                   @   s(   e Zd Z		ddedee fddZdS )ParamsModifierNcache_configcalibrator_configc                 K   s<  i | _ |dd |dd |dd |dd |dd |dd |dd |dd |d	d d
	}dd | D }|rWtd |d urP|jdi | ntdi |}|d ur`|| j d< |dd d usp|dd d urtd ddlm} ||d|d|dd|ddd}|d ur|| j d< d S d S )NFn_compute_blocksBn_compute_blocksmax_warmup_stepsmax_cached_stepsmax_continuous_cached_stepsresidual_diff_thresholdenable_separate_cfgcfg_compute_firstcfg_diff_compute_separate)	r
   r   r   r   r   r   r   r   r   c                 S   s   i | ]\}}|d ur||qS )N ).0kvr   r   W/home/ubuntu/vllm_env/lib/python3.10/site-packages/cache_dit/caching/params_modifier.py
<dictcomp>%   s    z+ParamsModifier.__init__.<locals>.<dictcomp>zManually settup DBCache context without BasicCacheConfig is deprecated and will be removed in the future, please use `cache_config` parameter instead!r   enable_taylorseerenable_encoder_taylorseerzManually settup TaylorSeer calibrator without TaylorSeerCalibratorConfig is deprecated and will be removed in the future, please use `calibrator_config` parameter instead!r   )TaylorSeerCalibratorConfigtaylorseer_cache_typeresidualtaylorseer_orderr   )enable_calibratorenable_encoder_calibratorcalibrator_cache_typer   r	   r   )	_context_kwargsgetitemsloggerwarningupdater   ,cache_dit.caching.cache_contexts.calibratorsr   )selfr   r	   kwargsdeprecated_kwargsr   r   r   r   __init__   sH   	











zParamsModifier.__init__)NN)__name__
__module____qualname__r   r   r   r,   r   r   r   r   r      s    r   N)
typingr   cache_contextsr   r   cache_dit.loggerr   r-   r%   r   r   r   r   r   <module>   s    