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
pjoin
def pjoin[State: ReduceOp, params: ContextParams, //](mut state: State, mut ctx: Context[params])
CPU: drives the monoid's pjoin body via SerialReducer in the cooperative tier, or merges the cross-worker partials buffer in the split-axis tier.
Three tiers, picked from params:
- Cooperative (
emit_tile_width == 1,!is_splitk_tier): callstate.pjoin(SerialReducer()). No cross-worker combine (one worker per output), but monoids may carry per-state finalization inpjoin(e.g.ReduceSumhorizontally reducing its SIMD accumulator into the scalaraccfield). - Tiled (
emit_tile_width > 1): per-output accumulators already final; each lane is a separate output; skip the cross-participant join. - Split-axis (
is_splitk_tier): write this worker's partial to its slot inctx._partials_base, atomically incrementcounters_base[row_idx], and β only the worker whose increment brings the counter toblocks_per_rowβ gather all partials,jointhem intoself.state, and setctx._is_last_blocksorowwise.oncegates emission.
Parameters:
- βState (
ReduceOp): The monoid type being joined. - βparams (
ContextParams): Comptime dispatch parameters.
Args:
- βstate (
State): The body's monoid accumulator. On return, holds the finalized value. - βctx (
Context[params]): The dispatch bundle. Mutated in the split-axis tier sorowwise.onceknows which worker emits.