remove_cache_key

产品支持情况

产品

是否支持

Atlas 800I A2 推理产品/A200I A2 Box 异构组件

Atlas A2 训练系列产品

x

Atlas 200I/500 A2 推理产品

x

Atlas 推理系列产品

x

Atlas 训练系列产品

x

函数功能

移除CacheKey。

移除CacheKey后,该Cache将无法再被pull_cache拉取。

函数原型

1
remove_cache_key(cache_key: CacheKey)

参数说明

参数名称

数据类型

取值说明

cache_key

CacheKey

需要被移除的CacheKey。

调用示例

1
2
3
4
5
from llm_datadist import *
...
cache_keys = [CacheKey(1, req_id=1), CacheKey(1, req_id=2)]
cache_manager.remove_cache_key(cache_keys[0])
cache_manager.remove_cache_key(cache_keys[1])

返回值

正常情况下无返回值。

参数错误可能抛出TypeError或ValueError。

执行时间超过sync_kv_timeout配置会抛出LLMException异常。

约束说明

如果CacheKey不存在或已移除,该操作为空操作。