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
PositionSummary
struct PositionSummary
Holds the computed number of keys and the score row index for an attention tile.
Fields
- num_keys (
UInt32): - score_row (
UInt32):
Implemented traits
AnyType,
Copyable,
Deinitable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TrivialRegisterPassable
Methods
__init__
def __init__(num_keys: UInt32, score_row: UInt32) -> Self
get_start_pos
static def get_start_pos[KVLUTType: MHAOperand, //, ragged: Bool, _is_cache_length_accurate: Bool](kv_lut: KVLUTType, seq_info: SeqInfo, num_keys_arg: UInt32) -> UInt32
Returns:
get_num_keys
static def get_num_keys[MaxSeqLenType: OptionallyStaticInt, KVInputRowOffsetsType: OptionalPointer, //, ragged: Bool, _is_cache_length_accurate: Bool](kv_input_row_offsets: KVInputRowOffsetsType, seq_info: SeqInfo, max_seq_len: MaxSeqLenType, num_keys_arg: UInt32, start_pos: UInt32) -> UInt32
Returns:
get_score_row
static def get_score_row[*, ragged: Bool, _is_cache_length_accurate: Bool, decoding: Bool](seq_info: SeqInfo, num_keys: UInt32, start_pos: UInt32) -> UInt32
Returns:
create
static def create[KVLUTType: MHAOperand, KVRowOffsetsType: OptionalPointer, MaxSeqLenType: OptionallyStaticInt, //, ragged: Bool, _is_cache_length_accurate: Bool](kv_lut: KVLUTType, seq_info: SeqInfo, num_keys_arg: UInt32, kv_input_row_offsets: KVRowOffsetsType, max_seq_len: MaxSeqLenType) -> Self