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
sparse_kv_row
def sparse_kv_row[physical_indices: Bool](kv_lut: T, batch_idx: UInt32, index: Int32) -> Int32
Returns the KV TMA row a sparse index names, or -1 for an unused slot.
Parameters:
- βphysical_indices (
Bool): Whetherindexis an already-pagedphysical_block * page_size + offsetrow (the indexer's physical rows, or latent sparse attention's flat rows) rather than a token position withinbatch_idx's entry.
Args:
- βkv_lut (
T): Cache operand the index addresses. - βbatch_idx (
UInt32): Batch entry the index belongs to; unread whenphysical_indices. - βindex (
Int32): The sparse index,-1for an unused slot.
Returns:
Int32: The TMA row, or -1.