flashinfer.attention.prims_ts.batch_decode_with_paged_kv_cache¶
- flashinfer.attention.prims_ts.batch_decode_with_paged_kv_cache(q: Tensor, paged_kv_cache: Tensor | tuple[Tensor, Tensor], paged_kv_indptr: Tensor, paged_kv_indices: Tensor, paged_kv_last_page_len: Tensor, *, seq_len_q: int = 1, qo_indptr: Tensor | None = None, max_seq_len_q: int | None = None, mask_type: Literal['dense', 'causal'] = 'dense', window_left: int = -1, kv_layout: Literal['HND'] = 'HND', bmm1_scale: float | None = None, bmm2_scale: float = 1.0, out: Tensor | None = None, out_dtype: dtype | None = None) Tensor¶
One-shot fixed or packed-Q native-CSR paged decode.
SQ1 preserves the
[B, Hq, D]query/output contract. For fixedseq_len_q>1, query and output are both token-major[B, SQ, Hq, D]. Providing cumulativeqo_indptrselects packed[total_q, Hq, D]query/output; the wrapper derivesmax_seq_len_qonce when it is omitted. No transpose is hidden here.