Skip to main content

Python function

attention_dispatch_metadata_list

attention_dispatch_metadata_list()โ€‹

max.nn.kv_cache.attention_dispatch_metadata_list(kv_collections)

source

Extracts AttentionDispatchMetadata from each KV collection.

Parameters:

kv_collections (Sequence[PagedCacheValues]) โ€“ A sequence of per-device paged KV cache values.

Returns:

A list of AttentionDispatchMetadata instances, one per device, in the same order as kv_collections.

Raises:

ValueError โ€“ If any collection is missing its dispatch_metadata.

Return type:

list[AttentionDispatchMetadata[TensorValue]]