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

SeqInfo

struct SeqInfo

Describes a sequence's length and starting offset for a work tile.

Carries the sequence length, start-of-sequence offset, and the originating WorkInfo coordinates used by the attention kernel to index into the KV cache.

Fields​

  • ​seq_len (UInt32):
  • ​start_of_seq (UInt32):
  • ​prompt_offset (UInt32):
  • ​head_idx (UInt32):
  • ​prompt_idx (UInt32):

Implemented traits​

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

Methods​

__init__​

def __init__(seq_len: UInt32, start_of_seq: UInt32, work: WorkInfo) -> Self

is_valid​

def is_valid(self) -> Bool

Returns:

Bool

create​

static def create[ValidLengthType: OptionalPointer, //](work: WorkInfo, valid_length: ValidLengthType, max_seq_len: UInt32) -> Self

Was this page helpful?