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

kv_cache_gather_rows_ragged

def kv_cache_gather_rows_ragged[cache_t: KVCacheT, dtype: DType, //, target: StringSpan[ImmStaticOrigin]](output: TileTensor[dtype, Engine=output.Engine, linear_idx_type=output.linear_idx_type], slots: TileTensor[.int32, Engine=slots.Engine, linear_idx_type=slots.linear_idx_type], row_offsets: TileTensor[.uint32, Engine=row_offsets.Engine, linear_idx_type=row_offsets.linear_idx_type], cache: cache_t, ctx: DeviceContext)

Copies cache rows at slots into output.

Parameters:

  • ​cache_t (KVCacheT): The key or value cache type (inferred); one head per slot.
  • ​dtype (DType): The output element type (inferred); must be the cache's.
  • ​target (StringSpan[ImmStaticOrigin]): Compilation target string, selects the CPU or GPU path.

Args:

Was this page helpful?