Skip to content

All four gpu/* ferro-kittens pins to e26c75c, and the one thing in that range that is not additive (#94) - #97

Merged
feitreim merged 1 commit into
mainfrom
flash-bwd-pin-bump
Aug 5, 2026
Merged

feitreim merged 1 commit into
mainfrom
flash-bwd-pin-bump

Conversation

@feitreim

@feitreim feitreim commented Aug 5, 2026

Copy link
Copy Markdown
Owner

All four gpu/* ferro-kittens pins to e26c75c, and the one thing in that range that is not additive (#94)

gpu/flash-attn and gpu/ops were pinned at c648c67 (ferro #182), gpu/gemm and gpu/model at 9b58025 (ferro #187). All four now name e26c75ce4920795b7a30786c58b382e6a26d5733, the merge of ferro-kittens#193. The pins have to match across the four crates because kittens re-exports cuda_device types they hand each other.

This is the prerequisite for #94's remedy 3, which is stacked on it. It is measured on its own so that its effects and the kernel change's can never be confused.

What the bump brings

#193 is what the split needs: tmem::warp_lanes(), the const { assert!(M <= 32) } guards on tile/tile_x8/tile_x8_batched/store_tile, and the ownership clauses that now say a warp addresses the 32 TMEM lanes at warp_id() % 4 whatever warpgroup it is in. Nothing in this repository calls any of it yet.

Everything else in the range — ferro #183 (scatter_tile), #187 (commit_add_2d, fp32 tensor maps), #188/#189, #190 — is new API, and no existing signature or body changes.

One thing is not additive, and it is the whole of what this bump moves: ferro #191 unrolled RegTile::mask's two walks. make_causal_at and make_causal_t_at are its only callers in this repository, both in the two backward kernels.

Gates, at the bump alone

gate result
--kernel flash-attn green (the two-oracle gate)
--kernel flash-attn --bin flash green, after the two pins below
--kernel ops green
--kernel model green, all 14 checks; the MoE overfit lands 2.949803 → 0.000031
--kernel gemm green, 134 / 168 / 146 exactly — unmoved, and no const assert fires

Parity is byte-identical to main at every gated flash shape: dq 7.299e-4 / 5.203e-4 / 6.458e-4, dk 7.322e-4 / 7.437e-4 / 7.084e-4, dv 2.933e-3 / 2.717e-3 / 2.911e-3, y ≤ 1.469e-3, lse ≤ 9.537e-7 — the same digits #96 published. The forced-correction shape still corrects on 100.00% of its 32 eligible visits and every other shape on 0.00%.

Bench, clean container, [32,1024,24,128], against two containers of the base:

base (ferro 5e4d3ff) #96's own this bump
forward 0.832 0.832 0.840
backward q 0.681 0.681 0.680
backward kv 1.449 1.404 1.500
both backwards 2.136 2.088 2.181

backward q is flat to the millisecond's third digit across all three. backward kv reads 1.404 / 1.449 / 1.500 in three containers, which is the ±3.5% spread that row has and not a signal. Nothing here claims a timing change and nothing measured one.

The two pins that move, and the bisect that says why

backward q 189 → 192 and backward kv 198 → 200, both still zero spill. The forward does not move: it is 128 / 0 before and after, because it masks by clamping its key count rather than through RegTile::mask.

The mechanism is bisected rather than argued. Building the same tree against ferro 5e4d3ff — the commit immediately before #191 — gives 189 / 198 to the register, the #96 pins exactly; e26c75c gives 192 / 200. The three other commits in the range are additive API and move nothing.

An unrolled masking walk keeps every set(slot, value, fill) a constant slot, which is more live registers and no frame — #166's trade, on the side it is wanted. Zero spill either way, and residency is pinned at 1 CTA/SM by BACKWARD_TMEM_COLUMNS = 512 regardless, so nothing about occupancy moves.

Both pins are ratcheted to the measured numbers with that note in flash.rs.

Not in this PR

No kernel source changes at all: git diff here is four manifests, four lock files, one comment block and two integers. The pass split is the next commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant