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

indexer_remap_sparse_columns

def indexer_remap_sparse_columns[block_kv: Int](columns: TileTensor[.int32, Engine=columns.Engine, address_space=columns.address_space, linear_idx_type=columns.linear_idx_type], blocks: TileTensor[.int32, Engine=blocks.Engine, address_space=blocks.address_space, linear_idx_type=blocks.linear_idx_type], starts: TileTensor[.int32, Engine=starts.Engine, address_space=starts.address_space, linear_idx_type=starts.linear_idx_type], output: TileTensor[.int32, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], count: Int, width: Int, ctx: DeviceContextBase)

Map selected sparse columns to local tokens; invalid columns yield -1.

Each tensor is a row-major [rows, stride] tile whose row stride is its second dimension. width is the scored sparse-column width, not a row's valid-prefix length. The selector owns masking by the latter before this operation.

Parameters:

  • ​block_kv (Int): Tokens per block, either 8 or 16.

Args:

Was this page helpful?