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
BarrierStrategy
struct BarrierStrategy
How the schedule emits barriers and barrier-adjacent fences.
Fields:
minimal: Suppress per-block s_barriers and set_prio pairs;
emit s_barrier only at top-of-half and the first
cross-stage block. See ScheduleConfig.minimal_barriers.
omit_set_prio: When minimal=True, drop the pre-MMA
s_setprio[1] entirely. See
ScheduleConfig.omit_mma_set_prio.
sched_barrier_mask: Bitmask of which blocks get trailing
schedule_barrier fences. Default: 0b01010101.
wrap_waits_sched_barrier: Wrap each contiguous wait/barrier
group with schedule_barrier on both sides. See
ScheduleConfig.wrap_waits_with_sched_barrier.
barrier_before_pre_ops: Move the pre_sync + barrier section
ahead of the frag/global section in each block. See
ScheduleConfig.barrier_before_pre_ops.
Fieldsβ
- βminimal (
Bool): Suppresses per-blocks_barriers andset_priopairs; emitss_barrieronly at top-of-half and the first cross-stage block. SeeScheduleConfig.minimal_barriers. - βomit_set_prio (
Bool): Whenminimal=True, drops the pre-MMAs_setprio[1]entirely. SeeScheduleConfig.omit_mma_set_prio. - βsched_barrier_mask (
Int): Bitmask of which blocks get trailingschedule_barrierfences. Default:0b01010101. - βwrap_waits_sched_barrier (
Bool): Wraps each contiguous wait/barrier group withschedule_barrieron both sides. SeeScheduleConfig.wrap_waits_with_sched_barrier. - βbarrier_before_pre_ops (
Bool): Moves the pre_sync + barrier section ahead of the frag/global section in each block. SeeScheduleConfig.barrier_before_pre_ops.
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyDestructible,
Movable
Methodsβ
defaultβ
static default() -> Self
Returns the ping-pong default: full barriers, no minimal mode.
Returns:
Self: A BarrierStrategy matching the framework default.
minimal_no_set_prioβ
static minimal_no_set_prio(sched_barrier_mask: Int = 0, wrap_waits: Bool = False, barrier_before_pre_ops: Bool = False) -> Self
Returns the cross-stage-rotation default: minimal barriers, no set_prio.
Args:
- βsched_barrier_mask (
Int): Bitmask of which blocks get trailingschedule_barrierfences. - βwrap_waits (
Bool): Wrap wait/barrier groups withschedule_barrieron both sides. - βbarrier_before_pre_ops (
Bool): Move pre_sync + barrier ahead of the frag/global section in each block.
Returns:
Self: A BarrierStrategy configured for the cross-stage rotation
kernel pattern.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!