IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Python class

MLAAttnKey

MLAAttnKeyโ€‹

class max.nn.kv_cache.MLAAttnKey(batch_size, max_prompt_length, num_partitions)

source

Bases: AttnKey

Decode dispatch metadata for multi-latent attention (MLA).

Parameters:

  • batch_size (int)
  • max_prompt_length (int)
  • num_partitions (int)

dispatch_metadata_spec()โ€‹

classmethod dispatch_metadata_spec()

source

MLA decode kernels read three ints, on the accelerator.

Return type:

DispatchMetadataSpec

pack_into()โ€‹

pack_into(into, max_cache_valid_length)

source

Writes batch size, prompt width and partition count.

The cache length is not part of the MLA dispatch buffer; it is carried separately in max_cache_length.

Parameters:

Return type:

None