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 struct

OutputKPipeline

struct OutputKPipeline[origin: MutOrigin, opc: OutputPipelineConfig]

Per-K-iteration view of OutputTilePipeline.

Unlike standard producer()/consumer() which signal once per tile (after all K iterations), this view signals after each K iteration. Use for kernels with per-K accumulation patterns (e.g., blockwise FP8).

Example (MMA warp): for i in range(num_iters): with mma_ctx.output_pipeline.per_k().produce() as stage: mma(stage.tmem, ...) # exit signals mma_arrive for this K iteration

Example (Epilogue warp): for k_iter in range(num_iters): with epi_ctx.output_pipeline.per_k().consume() as stage: promote(stage.tmem, ...) # exit signals consumer_step for this K iteration

Fields​

  • ​pipeline_ptr (Pointer[OutputTilePipeline[opc], origin]):

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable

comptime members​

TilePipelineType​

comptime TilePipelineType = OutputTilePipeline[opc]

Methods​

__init__​

def __init__(pipeline_ptr: Pointer[OutputTilePipeline[opc], origin]) -> Self

produce​

def produce(self) -> MmaKStage[origin, opc]

Get MMA stage context manager for one K iteration.

Returns:

MmaKStage[origin, opc]: Context manager that acquires stage on enter and signals mma_arrive on exit.

consume​

def consume(self) -> PerKConsumerStage[origin, opc]

Get consumer context manager for one K iteration.

Returns:

PerKConsumerStage[origin, opc]: Context manager that waits for MMA on enter and signals consumer_step on exit.