IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo function

split_k_reduce

def split_k_reduce(c: TileTensor[Engine=c.Engine, address_space=c.address_space, linear_idx_type=c.linear_idx_type], work_space: TileTensor[Engine=work_space.Engine, address_space=work_space.address_space, linear_idx_type=work_space.linear_idx_type], ctx: DeviceContext)

Reduces a split-K workspace into the output tensor by summing across K partitions.

Loads each (m, n) element from every partition in work_space, accumulates them, and stores the result into c.

Args:

def split_k_reduce[EpilogueFnType: ElementwiseEpilogueFn, //](c: TileTensor[Engine=c.Engine, address_space=c.address_space, linear_idx_type=c.linear_idx_type], work_space: TileTensor[Engine=work_space.Engine, address_space=work_space.address_space, linear_idx_type=work_space.linear_idx_type], epilogue_fn: EpilogueFnType, ctx: DeviceContext)

Reduces a split-K workspace by summing across K partitions and hands each reduced output to epilogue_fn.

Parameters:

Args:

def split_k_reduce[ComputeFnType: ElementwiseComputeFn, //](c: TileTensor[Engine=c.Engine, address_space=c.address_space, linear_idx_type=c.linear_idx_type], work_space: TileTensor[Engine=work_space.Engine, address_space=work_space.address_space, linear_idx_type=work_space.linear_idx_type], compute_fn: ComputeFnType, ctx: DeviceContext)

Reduces a split-K workspace by summing across K partitions and stores compute_fn of each reduced output into c.

Parameters:

Args:

Was this page helpful?