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
launch
def launch[Body: RowBody, //, axis: Int, simd_width: Int, supports_tiled: Bool = False, associative: Bool = False](body: Body, shape: Coord)
Top-level CPU scaffolder. Picks the tier from axis and supports_tiled, parallelizes over outputs (or output tiles), and invokes the body once per output (or tile).
Tier choice:
- Inner axis (
axis == rank - 1) β one worker per row, vectorize within the row atsimd_width.emit_tile_width = 1. - Non-inner axis with
supports_tiledβ one worker per slice; each walks the innermost-non-axis dim insimd_widthtiles, with a scalar tail for the remainder.emit_tile_width = simd_width. - Non-inner axis without
supports_tiledβ one worker per output, scalar reduce.emit_tile_width = 1.
Parameters:
- βaxis (
Int): Axis being reduced. - βsimd_width (
Int): SIMD width for tile dispatch. Bodies compute it viarowwise.pick_simd_width[...]and pass it directly; the scaffolder no longer derives it from a dtype. - βsupports_tiled (
Bool): Whether the body can run in the tiled tier (emit_tile_width > 1). Single-output reductions (reduce_sum, β¦) set thisTrue; multi-output kernels (softmax, layernorm) set itFalse. - βassociative (
Bool): Opt in the inner-axis cooperative tier's wide (_CPU_ILP_ACCUMULATORS * simd_width) same-dtype accumulator for rows>= _CPU_WIDE_ACC_MIN_ROW, breaking the serial accumulate dependency chain. Additive reductions (reduce_sum,reduce_mean) set thisTrue; everything else keeps the native width.
Args:
- βbody (
Body): The per-row computation. Receives aContextand the row'sCoord; usesreduce/pjoin/once/simdto compose the algorithm. - βshape (
Coord): Tensor shape.
Raises:
If a worker raises.