IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

simple_greedy_schedule

simple_greedy_schedule(body: LoopBody) -> List[Int]

Generic dependency-respecting greedy scheduler.

At each step, picks the lowest-index ready op. Unlike greedy_schedule(), this has no structural assumptions (no half-isolation, no MMA-terminated blocks) and works with any LoopBody.

Used as a seed for optimal_schedule() to provide a strong initial upper bound, enabling early pruning of the backtracking search.

Args:

  • body (LoopBody): The loop body whose ops are to be scheduled.

Returns:

List[Int]: Permutation of [0, num_ops) — a valid execution ordering.