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
paged_record
def paged_record[value_bytes: Int, scale_bytes: Int](cache: MutPointer[UInt8, MutAnyOrigin], slot: Int, page_size: Int, page_stride: Int) -> Tuple[Pointer[UInt8, MutAnyOrigin], Pointer[UInt8, MutAnyOrigin]]
Locates a slot's values and scales in a paged cache.
Parameters:
- value_bytes (
Int): The bytes of values in one record. - scale_bytes (
Int): The bytes of scales in one record.
Args:
- cache (
MutPointer[UInt8, MutAnyOrigin]): The first page. - slot (
Int): A slot in[0, 2^32). - page_size (
Int): The slots in one page. - page_stride (
Int): The bytes from one page to the next.
Returns:
Tuple[Pointer[UInt8, MutAnyOrigin], Pointer[UInt8, MutAnyOrigin]]: The slot's values and its scales.