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
WaitStrategy
struct WaitStrategy
How the schedule derives and places vmcnt/lgkmcnt waits.
Fields:
auto_waits: Auto-derive wait counts from program structure.
drain_lgkm_mask: Per-block bitmask for selective LDS drains.
auto_drain: Auto-derive drain_lgkm_mask from channel
analysis.
wait_lgkm_first: Manual wait_lgkm override (used when
auto_waits=False). 255 = unset.
wait_vm_last: Manual wait_vm override.
lgkm_after_last: Insert wait_lgkm(0) after the last block's
barrier.
inter_block_lgkm_drain: Emit wait_lgkm(0) at non-top,
non-cross interior block starts.
partial_prologue_drain: Skip standard wait_vm(0) drains in
the framework prologue (kernel emits its own partial
drains via bootstrap_frags).
Fieldsβ
- βauto_waits (
Bool): Auto-derives wait counts from program structure. - βdrain_lgkm_mask (
Int): Per-block bitmask for selective LDS drains. - βauto_drain (
Bool): Auto-derivesdrain_lgkm_maskfrom channel analysis. - βwait_lgkm_first (
Int): Manualwait_lgkmoverride (used whenauto_waits=False).255means unset. - βwait_vm_last (
Int): Manualwait_vmoverride for the last block. - βlgkm_after_last (
Bool): Insertswait_lgkm(0)after the last block's barrier. - βinter_block_lgkm_drain (
Bool): Emitswait_lgkm(0)at non-top, non-cross interior block starts. - βpartial_prologue_drain (
Bool): Skips standardwait_vm(0)drains in the framework prologue (kernel emits its own partial drains viabootstrap_frags).
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyDestructible,
Movable
Methodsβ
defaultβ
static default() -> Self
Returns the ping-pong default: auto waits, no inter-block drain.
Returns:
Self: A WaitStrategy matching the framework default.
auto_with_inter_block_drainβ
static auto_with_inter_block_drain(partial_prologue_drain: Bool = False) -> Self
Returns auto-derived waits plus inter-block lgkm drain (4-wave pattern).
Args:
- βpartial_prologue_drain (
Bool): Skip standardwait_vm(0)drains in the framework prologue.
Returns:
Self: A WaitStrategy configured for the 4-wave kernel pattern.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!