You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reductions: column-wise, whole-tile, and a generic reduce #6
ThunderKittens has, on register and shared tiles: row_max row_min row_sum row_prod row_reduce, the col_* mirrors, and whole-tile max min sum prod, plus generic row_reduce / col_reduce taking an op.
What we have.quad_max and quad_sum on RegVec / RegTile — row-wise max and sum only, via quad shuffle — plus online_rescale and scale_rows for the flash softmax pattern.
Missing: every column-wise reduction, prod, min, generic row_reduce / col_reduce, whole-tile reductions, and all shared-tile reductions.
The hard part is columns. The fragment map replicates a row's statistic across the 4 lanes of a quad, which is exactly what makes quad_max / quad_sum cheap. A column reduction has the opposite access pattern: values for one logical column are spread across lanes at stride 4 and across the two row blocks a thread owns. It needs a different shuffle (butterfly across the quad's stride-4 neighbours, then across row blocks), not a reparameterization of the existing one. Worth writing once as a generic col_reduce and deriving col_max / col_sum / col_min / col_prod from it.
Depends on #1 for coordinates, #5 for the op traits, #4 to check the shuffle patterns against a reference.
Acceptance: update examples/ as part of closing this.
softmax and layernorm want row_max/row_sum/col_sum and a whole-tile sum; flash_forward wants the row forms. Note the examples' observation that quad_max/quad_sum are only the second half of a row reduction — the fold across a thread's own VALUES registers is open-coded in every kernel today.
The examples crate (#18) exists so that "done" is checkable in the terms a kernel author cares about, rather than as a claim about a primitive nobody has tried to hold. Concretely, on closing this:
Delete any workaround or GAP fence in examples/src/ that this issue removes the need for, and replace it with the real API.
If a kernel becomes fully unblocked, move it from aspirational to compiles: flip its header, take it out of its feature gate, and confirm modal run modal_app.py::build builds it for sm_100a.
Update the status table and the blocked-on lists in examples/README.md.
If the example still does not compile afterwards, that is a finding worth writing down — say what is still missing rather than leaving the README stale.
Activity
feitreim commentedon Jul 27, 2026
Acceptance: update
examples/as part of closing this.softmaxandlayernormwantrow_max/row_sum/col_sumand a whole-tilesum;flash_forwardwants the row forms. Note the examples' observation thatquad_max/quad_sumare only the second half of a row reduction — the fold across a thread's ownVALUESregisters is open-coded in every kernel today.The examples crate (#18) exists so that "done" is checkable in the terms a kernel author cares about, rather than as a claim about a primitive nobody has tried to hold. Concretely, on closing this:
GAPfence inexamples/src/that this issue removes the need for, and replace it with the real API.aspirationaltocompiles: flip its header, take it out of its feature gate, and confirmmodal run modal_app.py::buildbuilds it forsm_100a.examples/README.md.If the example still does not compile afterwards, that is a finding worth writing down — say what is still missing rather than leaving the README stale.
Generic map mechanism and the standard elementwise op set (#26)
Shared to register load: ldst::load_fragment (#33)
SwizzledChunks spans stacked subtiles (#35)
examples: the reductions, and what is left after #5 and #6
reg: ReduceOp, and spell the lane-local fold out at each reduction
Reductions: generic row/column/whole-tile folds over a ReduceOp (#37)
GAPS.md: audit every claim against the source, and hold the landed ha…
A work item belongs to a cluster, and the GEMM that proved it got slo…