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

EpilogueKContext

struct EpilogueKContext[origin: MutOrigin, input_origin: MutOrigin, opc: OutputPipelineConfig, num_input_stages: Int]

Per-K context manager for epilogue warp in blockwise FP8.

Bundles output pipeline (MMA→Epilogue sync) and input pipeline (A-scales) into a single context manager for clean per-K iteration handling.

Example usage: for k_iter in range(num_iters): with epi_ctx.per_k_stage(input_pipeline) as epi_stage: accum.promote(epi_stage, ...) # exit signals BOTH pipelines

enter: Waits for MMA to complete this K iteration, returns EpilogueKStage exit: Signals both output consumer barrier AND input consumer_step

Fields​

  • ​output_pipeline_ptr (Pointer[OutputTilePipeline[opc], origin]):
  • ​input_pipeline_ptr (Pointer[ProducerConsumerPipeline[num_input_stages], input_origin]):
  • ​output_stage (EpilogueKContext[origin, input_origin, opc, num_input_stages].OutputStageType):
  • ​input_stage_index (UInt32):

Implemented traits​

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

comptime members​

CombinedStageType​

comptime CombinedStageType = EpilogueKStage[opc, num_input_stages]

cta_group​

comptime cta_group = opc.cta_group

InputPipelineType​

comptime InputPipelineType = ProducerConsumerPipeline[num_input_stages]

num_output_stages​

comptime num_output_stages = opc.num_stages

OutputPipelineType​

comptime OutputPipelineType = OutputTilePipeline[opc]

OutputStageType​

comptime OutputStageType = OutputStage[opc]

Methods​

__init__​

def __init__(output_pipeline_ptr: Pointer[OutputTilePipeline[opc], origin], input_pipeline_ptr: Pointer[ProducerConsumerPipeline[num_input_stages], input_origin]) -> Self

__enter__​

def __enter__(mut self) -> Self.CombinedStageType

Returns:

Self.CombinedStageType

__exit__​

def __exit__(mut self)