IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

tile_layout_k_major

def tile_layout_k_major[dtype: DType, BM: Int, BK: Int, swizzle_mode: TensorMapSwizzle = TensorMapSwizzle.SWIZZLE_NONE, page_dense: Bool = False]() -> Layout

Creates a K-major layout for tensor core operations.

Constructs a layout optimized for K-major access patterns in tensor core operations, with optional swizzling for improved memory access patterns.

Parameters:

  • dtype (DType): Element data type of the tensor.
  • BM (Int): Size of the M dimension in the tile.
  • BK (Int): Size of the K dimension in the tile.
  • swizzle_mode (TensorMapSwizzle): Memory access pattern swizzling mode (default: SWIZZLE_NONE).
  • page_dense (Bool): When True, return the native chunk-inner (row-major atoms) k-major layout instead of the default chunk-outer form. The two are byte-distinct when BK spans more than one swizzle atom (num_chunks >= 2); the chunk-inner form lays each page contiguously so one TMA fills it (the SM100 row-major page-fold path, K-side analog of the tile_layout_mn_major page_dense branch). SWIZZLE_128B only.

Returns:

Layout: Layout - A K-major layout configured for the specified dimensions and swizzle mode.