IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

DummyKVCache

DummyKVCache​

class max.pipelines.kv_cache.DummyKVCache(*args, **kwargs)

source

Bases: PagedKVCacheManager

No-op KV cache implementation for testing or when cache is disabled.

Initializes the dummy cache with a single replica and no host swapping.

Parameters:

alloc()​

alloc(*args, **kwargs)

source

No-op.

Parameters:

Return type:

None

claim()​

claim(request_id, replica_idx)

source

No-op.

Parameters:

Return type:

None

contains()​

contains(request_id, replica_idx)

source

Returns True for any request.

Parameters:

Return type:

bool

get_metrics_aggregated()​

get_metrics_aggregated()

source

Returns empty aggregated metrics.

Return type:

KVCacheMetrics

get_num_disk_pages()​

get_num_disk_pages(replica_idx)

source

Returns 1.

Parameters:

replica_idx (int)

Return type:

int

get_num_host_pages()​

get_num_host_pages(replica_idx)

source

Returns 1.

Parameters:

replica_idx (int)

Return type:

int

get_num_pages()​

get_num_pages(replica_idx)

source

Returns 1.

Parameters:

replica_idx (int)

Return type:

int

get_num_used_disk_pages()​

get_num_used_disk_pages(replica_idx)

source

Returns 1.

Parameters:

replica_idx (int)

Return type:

int

get_num_used_host_pages()​

get_num_used_host_pages(replica_idx)

source

Returns 1.

Parameters:

replica_idx (int)

Return type:

int

get_num_used_pages()​

get_num_used_pages(replica_idx)

source

Returns 1.

Parameters:

replica_idx (int)

Return type:

int

get_pct_used_blocks_after_allocation()​

get_pct_used_blocks_after_allocation(*args, **kwargs)

source

Returns a fixed low percentage (0.01).

Parameters:

Return type:

float

release()​

release(request_id, replica_idx)

source

No-op.

Parameters:

Return type:

None

reset_metrics()​

reset_metrics()

source

No-op.

Return type:

None

step()​

step(*args, **kwargs)

source

No-op.

Parameters:

Return type:

None