下载
中文
注册

update_cache_policy接口

接口功能

根据cache_manager中的npu_mem和cpu_mem申请NPU和CPU对应的KV Cache。(属于内部调度接口,暂不支持对外功能。)

接口实现

def update_cache_policy(self, cache_manager):
        self.cache_pool = CachePool(cache_manager, self.device)
        self.cache_pool.allocate_cpu_cache()
        self.cache_pool.allocate_npu_cache()

参数说明

参数名称

是否必选

类型

默认值

描述

cache_manager

CacheManager

-

根据模型信息进行npu和cpu的block的计算,接口需配合llm的调度模块,当前作为内部实现。