IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo struct

OffsetPosition

struct OffsetPosition[config: MLA_SM100_Decode_Config, KVLUTType: MHAOperand, ragged: Bool, is_cache_length_accurate: Bool, ValidLengthType: OptionalPointer, decoding_warp_split_k: Bool = False, sparse: Bool = False, has_extra_kv: Bool = False, has_variable_topk: Bool = False]

Fields​

  • ​seq_len (Int):
  • ​max_seq_len (Int):
  • ​num_keys (Int):
  • ​q_row_offset (Int):
  • ​out_row_offset (Int):
  • ​split_idx (Int):
  • ​batch_idx (Int):
  • ​kv_start_row (Int):
  • ​num_keys_this_split (Int):
  • ​q_token_idx (Int):

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable

Methods​

__init__​

def __init__(k: KVLUTType, valid_length: UnsafePointer[Scalar[ValidLengthType.dtype], ImmutAnyOrigin], max_seq_len: Int, num_partitions: Int, batch_size: Int, sparse_indices_stride: Int = 0, sparse_topk_lengths: OptionalReg[UnsafePointer[Int32, MutAnyOrigin]] = None, sparse_extra_indices_stride: Int = 0, sparse_extra_topk_lengths: OptionalReg[UnsafePointer[Int32, MutAnyOrigin]] = None) -> Self

cache_len​

def cache_len(self) -> Int

Returns:

Int

start_pos​

def start_pos(self, cache_start_pos: UInt32) -> UInt32

Returns:

UInt32

q_row_offset_at​

def q_row_offset_at(self, q_local: Int) -> Int

Returns:

Int

out_row_offset_at​

def out_row_offset_at(self, q_local: Int) -> Int

Returns:

Int

q_token_idx_at​

def q_token_idx_at(self, q_local: Int) -> Int

Returns:

Int