Skip to main content

Mojo function

generic_get_paged_cache

generic_get_paged_cache[dtype: DType](blocks: ManagedTensorSlice[MutableInput, static_spec=static_spec], cache_lengths: ManagedTensorSlice[Input, static_spec=static_spec], lookup_table: ManagedTensorSlice[Input, static_spec=static_spec], max_lengths: ManagedTensorSlice[Input, static_spec=static_spec], out result: PagedKVCacheCollection[dtype, KVCacheStaticParams(UInt(static_spec.shape.get[4]()), UInt(static_spec.shape.get[5]()), (static_spec.shape.get[1]() == 1)), static_spec.shape.get[3]()])

Returns:

PagedKVCacheCollection

generic_get_paged_cache[dtype: DType, kv_params: KVCacheStaticParams, page_size: Int](blocks: LayoutTensor[dtype, Layout.row_major[6](), origin], cache_lengths: LayoutTensor[DType.uint32, Layout(IntTuple(-1)), origin], lookup_table: LayoutTensor[DType.uint32, Layout.row_major[2](), origin], max_lengths: LayoutTensor[DType.uint32, Layout.row_major[2](), origin], out result: PagedKVCacheCollection[dtype, kv_params, page_size])

Returns:

PagedKVCacheCollection

Was this page helpful?