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

Mojo function

compute_mla_dispatch_scalars

def compute_mla_dispatch_scalars[num_heads: Int, _is_cache_length_accurate: Bool = False, is_fp8_kv: Bool = False, half_sms: Int = Int(74), fold_shared_index: Bool = False](batch_size: Int, max_cache_valid_length: Int, q_max_seq_len: Int, sm_count: Int) -> Tuple[Int, Int, Int]

Pure computation of the packed MLA dispatch metadata.

Returns (batch_size, q_max_seq_len, num_partitions). These three values are baked into the size-3 GPU buffer. effective_split_len is computed directly inside the MoGG ops from max_cache_length (max_cache_valid_length + q_max_seq_len when _is_cache_length_accurate=False, else max_cache_valid_length), and no longer needs to be returned here.

Returns:

Tuple[Int, Int, Int]

Was this page helpful?