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 struct
Struct_kv_cache_gather_rows_ragged_paged
struct Struct_kv_cache_gather_rows_ragged_paged
Registers the mo.kv_cache.gather_rows.ragged.paged graph op with the graph compiler.
Copies the key or value rows a per-row slot list names out of one layer
of a paged cache, one head per slot. See nn.kv_cache_gather.
Implemented traitsโ
Methodsโ
executeโ
static def execute[kv_type: DType, //, key_or_value: Int, target: StringSpan[ImmStaticOrigin]](output: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=output.static_spec], slots: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=slots.static_spec], row_offsets: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=row_offsets.static_spec], kv_blocks: ManagedTensorSlice[IOSpec[_, _].MutableInput, static_spec=kv_blocks.static_spec], page_stride: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=page_stride.static_spec], cache_lengths: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cache_lengths.static_spec], kv_lookup_table: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=kv_lookup_table.static_spec], max_prompt_length: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=max_prompt_length.static_spec], max_cache_length: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=max_cache_length.static_spec], layer_idx: UInt32, context: DeviceContext)