Skip to main content

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()​

get_metrics(replica_idx)

source

Returns empty metrics.

Parameters:

replica_idx (int)

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