deallocate_cache

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

x

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 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

Releases the cache.

If the cache is associated with a cache key during allocation, the actual release is delayed until all cache keys are pulled or remove_cache_key is executed.

Prototype

1
deallocate_cache(cache: Cache)

Parameters

Parameter

Data Type

Value Description

cache

Cache

Cache to be released.

Example

1
2
3
from llm_datadist import *
...
cache_manager.deallocate_cache(cache)

Returns

In normal cases, no value is returned.

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

If the execution time exceeds the value of sync_kv_timeout, an LLMException is thrown.

Constraints

If Cache does not exist or has been released, this operation is a no-operation.