create_cpu_cache

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

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

Function Description

Creates a CPU cache.

Prototype

1
create_cpu_cache(cache_desc: CacheDesc, addrs: List[int])

Parameters

Parameter

Data Type

Description

cache_desc

CacheDesc

Description of the cache.

addrs

List[int]

Address of the CPU cache.

Example

1
2
from llm_datadist import Cache
cpu_cache = Cache.create_cpu_cache(cpu_cache_desc, cpu_addrs) # cpu_addrs is obtained from the created CPU tensors.

Returns

In normal cases, a CPU cache of the cache type is returned.

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

If the input parameter is None, an AttributeError is thrown.

Restrictions

None