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

Mojo function

mla_prefill_split_kv_combine

def mla_prefill_split_kv_combine[output_type: DType, num_heads: Int, v_depth: Int](output_ptr: MutPointer[Scalar[output_type], MutUntrackedOrigin], partial_ptr: ImmPointer[Float32, ImmUntrackedOrigin], lse_ptr: ImmPointer[Float32, ImmUntrackedOrigin], total_rows: Int32, num_splits_arg: Int32)

Merges the KV splits of an AMD MLA prefill into the output.

One warp per (row, head): weights each split's normalized fp32 partial by exp2(lse_split - lse_max); splits with no key tiles (lse = -inf) are skipped, so their unwritten partials are never read.

Was this page helpful?