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
pipeline::run + trait Job is a faithful port of ThunderKittens' prototype::lcf (load-compute-finish). The rest of prototype/ is missing:
lcsf — load-compute-store-finish. The store stage is what a training kernel with a producer-consumer epilogue needs; without it the store folds into finish and cannot overlap the next work item's load. The most useful of the three.
lcsc — the store-compute variant.
common/templates.cuh — the shared config/state plumbing all three prototypes sit on. Our Job trait is the equivalent for lcf alone; a second prototype is the point at which that plumbing wants to be shared rather than duplicated.
interpreter — instruction-driven kernel where a persistent grid dispatches over an opcode stream. Newest and most speculative part of ThunderKittens; listed for completeness, not proposed.
lcsf depends on #9 — a store stage with no TMA store path is not worth building.
A second reason to want lcsf, from the examples work (#18).
This issue is filed as depending on #9 (TMA store), which is right. The GEMM example surfaces an independent motivation: with the store folded into finish, a persistent GEMM cannot overlap its epilogue with the next output tile's first K loads. The store phase and the next tile's load phase are exactly the two things a persistent kernel most wants in flight together, and lcf's shape forbids it.
So lcsf is not only "the variant with a store phase" — it is the variant that makes the persistent scaffold worth using for GEMM at all. Worth weighing when this comes up the order.
Related: #24 records that pipeline::run cannot schedule a cluster today (work items are blockIdx.x-strided, so a CTA pair gets different items), which is the other reason the GEMM example does not use the persistent scaffold.
Acceptance: update examples/ as part of closing this.
gemm does not use the persistent scaffold at all. Getting it to is the acceptance test — see the comment above on epilogue overlap.
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.
Scoping note from Finn, and it corrects how #107 was framed here.
#107 measured lcsf on gemm_cg2 and found it hides nothing — f ≈ 0, −5.4% to +1.2% over two B200 sessions. That is a rejection for this kernel, not for the library, and the two should not be conflated. The prototype layer exists because a training kernel with a producer-consumer epilogue needs a store stage that overlaps the next item's load; the GEMM is not that shape, and #107 explains exactly why it isn't — the overlap window is one pipeline fill, and at [256, 256] @ STAGES = 3 that is short.
A kernel with a longer fill, a cheaper drain, or an epilogue that is genuinely bandwidth-bound would land differently. #107's own HotStore probe is the discriminator worth reusing: it priced deleting a gigabyte of streaming HBM writes at 0–1.2%, which is what "issue-bound epilogue" looks like. A kernel where that probe reads large is a kernel lcsf should be tried on.
So what #107 settles is narrow and worth stating precisely: the shared/TMA staging route buys nothing over the cheap reordering, and the cheap reordering buys nothing on this kernel. It does not settle whether lcsf belongs in pipeline.rs.
Also useful and not specific to the GEMM: #107 found lcsf needs none of the 250–400 lines of fp32 plumbing that #94 and #9 both assumed. An undrained accumulator survives the item boundary in tensor memory, so the store stage is a reordering inside Job::work and pipeline::run is untouched — lcf's scaffold already admits an lcsf job. Whoever picks this up for a second kernel starts from there rather than from the plumbing estimate.
Remaining in this issue and untouched: lcsc, common/templates.cuh, and interpreter. Worth splitting if any of them gets picked up on its own.
Activity
feitreim commentedon Jul 27, 2026
A second reason to want
lcsf, from the examples work (#18).This issue is filed as depending on #9 (TMA store), which is right. The GEMM example surfaces an independent motivation: with the store folded into
finish, a persistent GEMM cannot overlap its epilogue with the next output tile's first K loads. The store phase and the next tile's load phase are exactly the two things a persistent kernel most wants in flight together, andlcf's shape forbids it.So
lcsfis not only "the variant with a store phase" — it is the variant that makes the persistent scaffold worth using for GEMM at all. Worth weighing when this comes up the order.Related: #24 records that
pipeline::runcannot schedule a cluster today (work items areblockIdx.x-strided, so a CTA pair gets different items), which is the other reason the GEMM example does not use the persistent scaffold.feitreim commentedon Jul 27, 2026
Acceptance: update
examples/as part of closing this.gemmdoes not use the persistent scaffold at all. Getting it to is the acceptance test — see the comment above on epilogue overlap.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.
TMA store path, and softmax runs (#41)
gemm runs on the scaffold, at the cap a clock had to find (#51)
gemm runs on the scaffold, at the cap a clock had to find (#51) (#83)
Price the occupancy step on a dead allocation, and #94's third is a s…
The store stage cost a reordering to try, and it hides nothing (#15) (#…
feitreim commentedon Jul 29, 2026
Scoping note from Finn, and it corrects how #107 was framed here.
#107 measured
lcsfongemm_cg2and found it hides nothing —f ≈ 0, −5.4% to +1.2% over two B200 sessions. That is a rejection for this kernel, not for the library, and the two should not be conflated. The prototype layer exists because a training kernel with a producer-consumer epilogue needs a store stage that overlaps the next item's load; the GEMM is not that shape, and #107 explains exactly why it isn't — the overlap window is one pipeline fill, and at[256, 256] @ STAGES = 3that is short.A kernel with a longer fill, a cheaper drain, or an epilogue that is genuinely bandwidth-bound would land differently. #107's own
HotStoreprobe is the discriminator worth reusing: it priced deleting a gigabyte of streaming HBM writes at 0–1.2%, which is what "issue-bound epilogue" looks like. A kernel where that probe reads large is a kernellcsfshould be tried on.So what #107 settles is narrow and worth stating precisely: the shared/TMA staging route buys nothing over the cheap reordering, and the cheap reordering buys nothing on this kernel. It does not settle whether
lcsfbelongs inpipeline.rs.Also useful and not specific to the GEMM: #107 found
lcsfneeds none of the 250–400 lines of fp32 plumbing that #94 and #9 both assumed. An undrained accumulator survives the item boundary in tensor memory, so the store stage is a reordering insideJob::workandpipeline::runis untouched —lcf's scaffold already admits anlcsfjob. Whoever picks this up for a second kernel starts from there rather than from the plumbing estimate.Remaining in this issue and untouched:
lcsc,common/templates.cuh, andinterpreter. Worth splitting if any of them gets picked up on its own.The epilogue's shared half, as a ring with the fences in it (#15) (#111)
A shared tile out to global memory, by plain vectorized stores (#15) (#…
The epilogue's stores were the wrong shape, and stmatrix fixes 20% of…
The 1.02 ceiling is an 8192-cubed fact, and the residual is stmatrix's (