CacheKeyByIdAndIndex

Applicability

Product

Supported (√/x)

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

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

Function Description

Constructs a CacheKeyByIdAndIndex instance, which is usually used as the parameter type in pull_cache and push_cache of CacheManager.

Prototype

1
__init__(cluster_id: int, cache_id: int, batch_index: int = 0)

Parameters

Parameter

Data Type

Description

cluster_id

int

Cluster ID of the node where the cache is located.

cache_id

int

Cache ID associated with the cache.

batch_index

int

Batch index of the cache.

Example

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

Returns

In normal cases, a CacheKeyByIdAndIndex instance is returned.

If the input data type is incorrect, the TypeError or ValueError exception is reported.

Restrictions

None