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

q_coord

def q_coord[*, depth: Int, decoding: Bool](row: UInt32, head_idx: UInt32) -> StaticTuple[UInt32, Int(4) if decoding else Int(3)]

Returns the coordinates for a tma load on the Q matrix. This load can be 3D, 4D, or 5D.

Arguments: row: the row to load from. head_idx: q_head_idx if prefill, kv_head_idx if decoding.

Returns:

StaticTuple[UInt32, Int(4) if decoding else Int(3)]