For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
K2qCsr
struct K2qCsr
Reverse-CSR + schedule for one sparse-MHA forward pass (host-built).
All buffers are owned List[Int32]; index them with the strides documented
on each field. total_rows, max_kv_blocks and work_capacity are the
sizing the future kernel allocates against.
Fieldsβ
- βhead_kv (
Int): - βtotal_q (
Int): - βtopk (
Int): - βbatch (
Int): - βblk_kv (
Int): - βmax_seqlen_q (
Int): - βtotal_rows (
Int): - βmax_kv_blocks (
Int): - βwork_capacity (
Int): - βk2q_row_ptr (
List[Int32]): - βqsplit_indices (
List[Int32]): - βscheduler_metadata (
List[Int32]): - βwork_count (
Int): - βsplit_counts (
List[Int32]): - βrow_coords (
List[Int32]):
Implemented traitsβ
AnyType,
ImplicitlyDeletable,
Movable
Methodsβ
__init__β
def __init__(out self, head_kv: Int, total_q: Int, topk: Int, batch: Int, blk_kv: Int, max_seqlen_q: Int, total_rows: Int, max_kv_blocks: Int, work_capacity: Int)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!