Skip to main content

Mojo trait

MHATileScheduler

Implemented traits

AnyType, UnknownDestructibility

Aliases

__del__is_trivial

alias __del__is_trivial

A flag (often compiler generated) to indicate whether the implementation of __del__ is trivial.

The implementation of __del__ is considered to be trivial if:

  • The struct has a compiler-generated trivial destructor and all its fields have a trivial __del__ method.

In practice, it means that the __del__ can be considered as no-op.

may_advance

alias may_advance

mha_schedule

alias mha_schedule

The MHATileScheduler trait describes a schedule for the persistent kernel.

Methods

get_current_work_info

get_current_work_info(self: _Self, ts: MHATileSummary, state: MHATileState) -> WorkInfo

Returns the current WorkInfo.

Returns:

WorkInfo

advance

advance[ragged: Bool, producer: Bool, sync: MHASchedulerSynchronization = MHASchedulerSynchronization(1)](self: _Self, ts: MHATileSummary, mut state: MHATileState, pipeline_idx: SIMD[uint32, 1]) -> OptionalReg[SeqInfo]

Advance state to the next work item. func must return a Bool indicating whether there is more work. Returns True if there is more work.

Returns:

OptionalReg

grid_dim

static grid_dim(batch_size: SIMD[uint32, 1], max_num_prompt_tiles: SIMD[uint32, 1]) -> Tuple[Int, Int, Int]

Return the grid_dim required for the kernel.

Returns:

Tuple

initial_state

initial_state(self: _Self, ptr: UnsafePointer[SIMD[uint32, 1], address_space=AddressSpace(3)], tile_summary: MHATileSummary) -> MHATileState

Create the initial state object.

Returns:

MHATileState

unsafe_seq_info

unsafe_seq_info[ragged: Bool](self: _Self, ts: MHATileSummary, state: MHATileState) -> SeqInfo

Returns:

SeqInfo

Was this page helpful?