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

lora_qkv_plane_row_offset

def lora_qkv_plane_row_offset[splits: IndexList[Int(2)]](out_col: Int, plane_stride: Int) -> Int

Additive row offset into a 3-plane row-stacked activation [3*M, K].

Lets a grouped matmul read a different plane of the activation per output-column region within a single launch, without a capturing closure (which the warp-specialized kernel's GPU slicer cannot handle in the load path). Used by the LoRA-B QKV expand to select the matching plane of the planar shrink output P [3, M, R] for the Q / K / V output regions.

For output column out_col, the plane is 0 when out_col < splits[0], 1 when out_col < splits[1], else 2; the returned offset is plane * plane_stride. splits == (0, 0) disables it (returns 0), so the default is a no-op for every other caller.

Returns:

Int