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

generic_fused_qk_rope_bshd_paged

def generic_fused_qk_rope_bshd_paged[dtype: DType, //, *, interleaved: Bool, target: StringSpan[ImmStaticOrigin]](q_proj: TileTensor[dtype, Engine=q_proj.Engine, address_space=q_proj.address_space, linear_idx_type=q_proj.linear_idx_type], kv_collection: PagedKVCacheCollection[scale_dtype_=kv_collection.scale_dtype_, quantization_granularity_=kv_collection.quantization_granularity_], freqs_cis: TileTensor[dtype, Engine=freqs_cis.Engine, address_space=freqs_cis.address_space, linear_idx_type=freqs_cis.linear_idx_type], layer_idx: UInt32, valid_lengths: TileTensor[.uint32, Engine=valid_lengths.Engine, address_space=valid_lengths.address_space, linear_idx_type=valid_lengths.linear_idx_type], output: TileTensor[dtype, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], context: DeviceContext)

Performs a fused RoPE projection for Q and K with paged KV cache.

Applies RoPE to both Q (returned) and K (in the paged cache) to ensure proper dependency ordering after fused_qkv_padded_matmul.

Args:

Was this page helpful?