Skip to main content

Mojo struct

TileScheduler

@register_passable(trivial) struct TileScheduler[tile_shape: UInt32, num_heads: UInt32, /, num_ctas: UInt32 = H100.sm_count, schedule: MHASchedule = MHASchedule.DEFAULT]

Implemented traits

AnyType, Copyable, Defaultable, DevicePassable, ImplicitlyCopyable, MHATileScheduler, Movable, UnknownDestructibility

Aliases

__copyinit__is_trivial

alias __copyinit__is_trivial = True

__del__is_trivial

alias __del__is_trivial = True

__moveinit__is_trivial

alias __moveinit__is_trivial = True

device_type

alias device_type = TileScheduler[tile_shape, num_heads, num_ctas, schedule]

may_advance

alias may_advance = True

mha_schedule

alias mha_schedule = schedule

Methods

__init__

__init__() -> Self

get_type_name

static get_type_name() -> String

Returns:

String

get_device_type_name

static get_device_type_name() -> String

Returns:

String

get_current_work_info

get_current_work_info[ValidLengthType: OptionalPointer, //](self, ts: MHATileSummary[ValidLengthType], state: MHATileState) -> WorkInfo

Returns:

WorkInfo

fetch_next_work

fetch_next_work(self, ts: MHATileSummary[ValidLengthType], mut state: MHATileState) -> WorkInfo

Returns:

WorkInfo

advance

advance[ValidLengthType: OptionalPointer, //, producer: Bool, sync: MHASchedulerSynchronization = MHASchedulerSynchronization.DEFAULT](self, ts: MHATileSummary[ValidLengthType], mut state: MHATileState, pipeline_idx: UInt32) -> OptionalReg[SeqInfo]

Returns:

OptionalReg

grid_dim

static grid_dim(batch_size: UInt32, max_num_prompt_tiles: UInt32) -> Tuple[Int, Int, Int]

Returns:

Tuple

initial_state

initial_state[ValidLengthType: OptionalPointer, //](self, ptr: LegacyUnsafePointer[UInt32, address_space=AddressSpace.SHARED], tile_summary: MHATileSummary[ValidLengthType]) -> MHATileState

Returns:

MHATileState

unsafe_seq_info

unsafe_seq_info[ValidLengthType: OptionalPointer, //](self, ts: MHATileSummary[ValidLengthType], state: MHATileState) -> SeqInfo

Returns:

SeqInfo

Was this page helpful?