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

bt_frag_coord

def bt_frag_coord(lane: Int, i: Int) -> IndexList[Int(2)]

(n, k) in the 16x32 right operand for element i under transpose_right=1.

Under transpose_right=1 the op reads the right operand as (N, K) instead of (K, N). The B-fragment lane->element map is the SWAP of the base bc_frag_coord: the base row-axis (frag_row_base + (sub>>2)*8, plus half*16) carries N, and the base col-axis (frag_col_base + (sub%4)) carries K. So consecutive elements walk K CONTIGUOUSLY, which is stride-1 for an (N, K) weight -> a coalesced load (the fix for the stride-K scattered NT B gather). The C-store map is UNCHANGED (bc_frag_coord); transpose_right permutes only the right operand, not C. Matched bit-exact against a host oracle.

Args:

  • lane (Int): Simdgroup lane index in [0, 32); determines the lane's base (n, k) in the 16x32 right operand.
  • i (Int): B-fragment element index in [0, 16); selects which of this lane's 16 held B elements to map to (n, k) under transpose_right=1.

Returns:

IndexList[Int(2)]

Was this page helpful?