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 struct

Struct_chunked_qkv_rope_store_ragged_paged

struct Struct_chunked_qkv_rope_store_ragged_paged[qk_head_dim: Int, v_head_dim: Int, chunk_padding: Int = Int(0)]

Registers chunked QKV unpacking, partial NeoX RoPE, and paged stores.

The execute method receives value_scale as a CPU Float32 operand and applies it to V before rounding to BF16.

Parameters​

  • ​qk_head_dim (Int): Unpadded query and key head width.
  • ​v_head_dim (Int): Unpadded value head width.
  • ​chunk_padding (Int): Trailing projection rows to ignore in each chunk.

Implemented traits​

AnyType, Deinitable, Movable

Methods​

execute​

static def execute[cache_dtype: DType, //, target: StaticString](output: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=output.static_spec], qkv: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=qkv.static_spec], input_row_offsets: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input_row_offsets.static_spec], freqs_cis: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=freqs_cis.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, value_scale: Float32, ctx: DeviceContext)

Was this page helpful?