Repository navigation
Description
Blocked on #66. Rewrite the flash-attention forward path (flash_forward_tcgen05, flash_forward_pipelined, flash_forward_persistent in gpu/flash-attn/src/tcgen05.rs) as one kernel on current ferro-kittens, collapsing the three generations.
Reference
examples/src/flash_forward.rs in feitreim/ferro-kittens is a working tcgen05 flash forward on the current surface — start from its shape rather than translating the old kernel.
Surface that did not exist at extraction
mm_abt/mm_ab— fresh-accumulator entry points (the S = Q·Kᵀ and O = P·V calls state their initialization statically instead of threading a bool).- The softmax toolkit:
online_rescale/scale_rows(the flash rescale pattern is a library op now),row_max/row_sumreductions,Exp2Approx/Exp2Hw. - Masking with a coordinate origin (
make_causal(diagonal), Start milestone 7a: add CUDA-event step profiler #7) — the tile is a sub-block of the score matrix and the diagonal sits atquery_base - key_base; the old origin-free masking is only right for the diagonal block. pipeline::run/run_stealingfor the persistent form;plan::SharedPlanfor the shared layout (ferro Residency is measured, and cuBLASLt's configuration is read (#80) #85 tracked flash_forward's plan specifically).
Known ferro-kittens sharp edges to watch (already filed there)
tmem::alloc_blocktakes runtimecolumnsand checks nothing — ferro's own flash_forward requested an illegal 192 columns undetected (ferro MoE binning walks in vectors, and the SwiGLU tile arm loses on transaction shape #128).pipeline::Jobgives every warp the same item — a warp-asynchronous item stream isn't expressible (ferro Checkpoint v6: don't materialize step-0 AdamW moments — it would flip the init-cache verdict #132). If the persistent form wants it, that's the issue to weigh in on, not a local workaround.
Anything new the kernel needs that the library lacks: file it on feitreim/ferro-kittens and link it from the PR.
Process
Branch off main, PR, never touch main. Correctness against the existing CPU/reference gates; performance on B200 via modal_app.py against the current flash_forward_persistent numbers as baseline. A Modal check red in ~15s is the spend limit, not the code.
Activity
One flash-attention forward, at 128 query rows
Merge pull request #74 from feitreim/feat/issue-68-flash-forward