CacheKey

Applicable Products

Product

Supported (Yes/No)

Ascend 950PR/Ascend 950DT

No

Atlas A3 training products/Atlas A3 inference products

Yes

Atlas A2 training products/Atlas A2 inference products

Yes

Atlas 200I/500 A2 inference products

No

Atlas inference products

No

Atlas training products

No

Note: For the Atlas A2 training products/Atlas A2 inference products, only the Atlas 800I A2 inference server and A200I A2 Box heterogeneous subrack are supported.

Function Description

Constructs a CacheKey instance, which is usually used as the parameter type in allocate_cache and pull_cache of KvCacheManager.

Prototype

1
__init__(*args, **kwargs)

Parameters

Parameter

Data Type

Value Description

prompt_cluster_id

int

(Mandatory) ID of the remote cluster where the cache is located.

req_id

int

(Mandatory) Request ID associated with the cache.

model_id

int

ID of the model associated with the cache. The default value is 0.

prefix_id

int

Common prefix ID associated with the cache. The default value is 264 – 1.

Example

1
2
from llm_datadist import CacheKey
cache_key = CacheKey(0, 1, 0)

Returns

In normal cases, a CacheKey instance is returned.

If the input data type is incorrect, a TypeError or ValueError is thrown.

Constraints

None