create_cpu_cache
Applicability
Product |
Supported (Yes/No) |
|---|---|
Atlas 350 Accelerator Card |
No |
Yes |
|
Yes |
|
No |
|
No |
|
No |
Note: For the
Function Description
Creates a CPU cache.
Prototype
1 | create_cpu_cache(cache_desc: CacheDesc, addrs: Union[List[int], List[List[int]]]) |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
cache_desc |
Cache description. |
|
addrs |
Union[List[int], List[List[int]]] |
Address of the CPU cache. |
Example
1 2 3 4 5 | from llm_datadist import KvCache cpu_addrs = [] # Configure the addresses of multiple devices in single-process multi-device mode. # cpu_addrs = [[]] cpu_cache = KvCache.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 KvCache 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.
Constraints
None
Parent topic: KvCache