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

q_tma_prefill

def q_tma_prefill[dtype: DType, //, swizzle_mode: TensorMapSwizzle, *, BM: Int, depth: Int, q_num_heads: Int, num_qk_stages: Int = Int(1)](ctx: DeviceContext, ptr: Pointer[Scalar[dtype]], rows: Int) -> QTMATilePrefill[dtype, swizzle_mode, BM=BM, depth=depth, num_qk_stages=num_qk_stages]

Creates a split TMA descriptor for a prefill (rank-3) Q tensor tile, pairing the shared-memory tile shape with the global-memory layout.

Args:

  • โ€‹ctx (DeviceContext): Device context used to create the TMA descriptor.
  • โ€‹ptr (Pointer[Scalar[dtype]]): Base pointer to the Q tensor in global memory.
  • โ€‹rows (Int): Number of rows in the Q tensor exposed via the TMA descriptor.

Returns:

QTMATilePrefill[dtype, swizzle_mode, BM=BM, depth=depth, num_qk_stages=num_qk_stages]

Was this page helpful?