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 function
verify_schedule
def verify_schedule(program: PipelineProgram, config: PipelineConfig, lgkm_per_a: Int, lgkm_per_b: Int, wait_lgkm_first: Int, wait_vm_last: Int)
Verify structural invariants of a finalized pipeline schedule.
Runs at compile time, zero runtime cost. Catches bugs in schedule construction that would otherwise surface as silent GPU miscomputes.
Checks:
- Block completeness: every block has exactly 1 MMA op
- Wait count bounds: wait values are non-negative and bounded
- Distribution invariant: uniform global loads when max_globals > 0
- Stage consistency: fragment/global ops use correct stage for half
- Prefetch coverage: at least one global is marked prefetch
- Completion coverage: each half has a completion load
- Warp stagger LDS safety: no cross-block prefetch/fragment race
Note: these are structural checks on the generated program. They do not verify that the execution ordering respects all LDG dependency edges; that is enforced by the scheduler (greedy_schedule / optimal_schedule) which only places ops whose d=0 predecessors are already scheduled.
Args:
- βprogram (
PipelineProgram): The finalizedPipelineProgramto verify. - βconfig (
PipelineConfig): Pipeline configuration providing block structure geometry and partition count. - βlgkm_per_a (
Int): Per-channel lgkm cost for channel 0 loads, used to boundwait_lgkm_first. 0 means unknown (skips the bound check). - βlgkm_per_b (
Int): Per-channel lgkm cost for channel 1 loads, used to boundwait_lgkm_first. 0 means unknown (skips the bound check). - βwait_lgkm_first (
Int): The lgkm wait count applied at the first block of each half. 255 means no wait is emitted. - βwait_vm_last (
Int): The vm wait count applied at the last block of each half.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!