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 package
pipeline
Generic compile-time software pipelining for GPU kernels: schedule generation and verification.
This package simplifies defining a pipelined GPU kernel schedule: the ordered list of operations in a loop (global loads, shared-memory reads, MMA instructions, barriers, and hardware waits) for each execution phase. For example, in a tiled matmul kernel, that ordering overlaps fetching the next A/B tile from DRAM into LDS with multiplying the current tile in registers. The schedule splits into a prologue (prime buffers before overlap is possible), a kernel phase (steady overlap on every iteration), and an epilogue (drain without issuing new loads).
You describe the operations in one iteration β loads, fragment reads,
MMA β and a per-target cost model for your GPU. At comptime, this
package builds a dependency graph from those declarations, schedules the
operations, derives hardware wait counts and barriers, and verifies
structural safety. You consume the result as a flat ScheduleEntry list
that unrolls into straight-line code with no runtime scheduling cost.
Import from submodules directly:
from pipeline.types import OpDesc, ResourceKind, OpRole
from pipeline.config import PipelineConfig, ScheduleConfig
from pipeline.compiler import PipelineSchedule, compile_schedule
from pipeline.schedulers import optimal_schedule_with_halves
from pipeline.program_builder import verify_schedule, build_kernel_programModulesβ
- β
compiler: Pipeline schedule compiler: PipelineSchedule trait, ScheduleCompiler struct, and compile_schedule function. - β
config: Pipeline configuration structs: LoopCarriedSpec, BlockSizing, FragOrder, SchedulingStrategy, ScheduleConfig, WarpStaggerRule, PipelineConfig, and TargetProfile. - β
debug: Diagnostic tooling for compiled pipeline schedules. - β
dependency_graph: Loop Dependency Graph (LDG) types: OpNode and LoopBody. - β
geometry: Kernel-geometry-derived scheduling constants. - β
phase_derivation: Phase derivation: recipes, default prologue/kernel/epilogue, and edge rules. - β
pipeline_dsl: Pipeline DSL: ScheduleEntry, EntryBuilder, Pipe, pipe, annotate_pipe. - β
program: MMABlockSpec and PipelineProgram β declarative pipeline program representation. - β
program_builder: Program builder: constructs PipelineProgram from a loop body. - β
schedulers: Scheduling algorithms: greedy and within-iteration optimal schedulers. - β
strategies: Strategy structs that group relatedScheduleConfigflags. - β
types: Core types for the pipeline scheduling framework.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!