Skip to content

The pin reaches ferro main, and the module the driver refused loads: #227 confirmed downstream - #130

Merged
feitreim merged 1 commit into
mainfrom
ferro-bump-227
Aug 7, 2026
Merged

feitreim merged 1 commit into
mainfrom
ferro-bump-227

Conversation

@feitreim

@feitreim feitreim commented Aug 7, 2026 •

Copy link
Copy Markdown
Owner

Bumps the pinned ferro-kittens revision from 3ae07a8 (#218) to b589b8a
(ferro #227), across all four manifests. Zero source churn — the diff is
four rev = strings and the four lockfiles that follow them.

This is a bump, but the reason it exists is the experiment. oxide-train#127
stopped one commit short of ferro main because ferro #219 put four brx.idx
jump tables in gemm_tcgen05_bf16_optimized and the driver's PTX JIT refused
the module at the first cuModuleLoadData with DriverError(218), before a
line of gate output. ferro #227 restored the compare-chain lowering — and
could not reproduce the refusal
, which is why this bump is the only test that
exists (ferro #225, ferro #227's "Follow-up"). Confirmation is posted on
ferro#225.

The headline: the module loads

cargo oxide run gemm, the exact run that died:

ptxas budgets (registers/thread, spill bytes, .maxntid)
  gemm_tcgen05_bf16_optimized 160 regs,    0 spill bytes, maxntid 192
  gemm_tcgen05_f32_optimized  172 regs,    0 spill bytes, maxntid 192
  gemm_tcgen05_f32_accumulate 146 regs,    0 spill bytes, maxntid 192
✓ fp32 and tcgen05 bf16 GEMM store/accumulate parity passed

Same B200, same driver 580.95.05 the failure was reported on, same tree that
was red at ferro 41f9e57. #227 fixes the downstream failure.

What that does and does not settle is worth stating, because ferro #227 was
careful about it and this PR should be too. ferro's own tree JIT-loads 55
jump-tabled kernels on this driver, shared_drain_quad's four-tables-in-one-entry
included, so brx alone is not sufficient — the trigger is some interaction with
the rest of this module that ferro has no kernel big enough to reach. What is
now established is the consumer-side bisect in both directions: red exactly when
the tables are present, green exactly when they are not, across two independent
changes to how the dispatch lowers, with nothing else in this repo moving. The
mechanism ferro #227 names — an exhaustive match over a repr(usize) enum
materialises rungs a caller has constant-folded away, four cases table where
three branch — is consistent with every observation on both sides.

The window, checked against the diffs

Over 3ae07a8..b589b8a only four files under ferro's src/ change at all:

  • src/global.rs — the only behavioural change that reaches this repo.
    AccessWidth and access_width keep #219's typing; the drains dispatch on a
    new private access_width_bytes (three arms and a wildcard) and hold their
    coverage obligation through AccessWidth::RUNGS + a const { assert! }. The
    rest of the file's diff is #224's occupancy note.
  • src/lib.rs — #![feature(variant_count)], for RUNGS. Internal to
    ferro; the toolchain is already the same pinned nightly-2026-04-03, so it
    costs consumers nothing.
  • src/ldst.rs, src/mma.rs — documentation only.

gpu/gemm/src/optimized.rs:537,541 is this repo's only caller of either drain,
and nothing calls access_width directly, so #219's enum return — the churn
worth checking for — reaches no call site here. #223 is examples/experiments,
#224 is docs, #226 is ferro's own CI. Local typecheck (cuda_cudart 13.0 redist

  • CUDA_TOOLKIT_PATH) clean on all four crates.

Gates: all four green, at existing tolerances

gate result
gemm ✓ fp32 and tcgen05 bf16 store/accumulate parity
flash-attn flash ✓ two probes, five forward shapes, the ramped-key case, three backward shapes
ops ✓ seventeen forward/backward checks
model ✓ fourteen checks, tcgen05 MoE and block-linear ladders included

flash is bit-identical to main, and the gate was run on main to say so
rather than quoting #127's numbers.
Both logs' whole parity section — 107
lines: the swizzle and transpose_b probes (score_mma probe max abs error 1.907e-6), every y0 gpu / ref row at all five forward shapes and the
ramped-key case, every max abs error, every correction count including the
ramped-key case's 32 of 32 (100.00%), and dq/dk/dv at all three backward
shapes — diffs to nothing. The only lines that move in the entire log are
the four benchmark timings, in separate containers and under 1%:

bench [32,1024,24,128] main this branch
forward 0.804 ms, 272.5 TFLOP/s 0.799 ms, 274.2 TFLOP/s
backward kv 1.019 ms, 859.9 TFLOP/s 1.016 ms, 862.2 TFLOP/s
backward q 0.621 ms, 1059.0 TFLOP/s 0.616 ms, 1067.3 TFLOP/s
backward, both 1.636 ms, 669.6 TFLOP/s 1.665 ms, 657.8 TFLOP/s

model losses. Every initial loss is identical to six decimals — 2.949841
(MoE with aux loss), 1.526770 (AdamW and Muon), 3.105546 (block linears) —
and both dense overfits terminate at 0.000000. The two terminal values that
move are the ones that are nondeterministic in the code itself: the MoE aux-loss
overfit reads 0.000039 here against main's 0.000030 and #127's 0.000042 /
0.000112, and the block-linear overfit 0.000097 against 0.000056 and
0.000077 / 0.000093. Both land inside a spread two runs of an unchanged
branch already produce; that is the MoE scatter's atomics, not a numerics change.

Codegen: the module is instruction-for-instruction main's

rebuilds --kernel gemm, both trees, offline ptxas. Every entry allocates
identically
, and the branch is self-consistent across two fresh builds:

entry main (#218) this branch (#227)
gemm_tcgen05_bf16_optimized 160 / 0 160 / 0
gemm_tcgen05_f32_optimized 172 / 0 172 / 0
gemm_tcgen05_f32_accumulate 146 / 0 146 / 0
register_gemm_store 56 / 0 56 / 0
register_gemm_accumulate 56 / 0 56 / 0
register_gemm_tn_accumulate 56 / 0 56 / 0
register_gemm_nt_store 48 / 0 48 / 0
residency_probe_cg2 18 / 0 18 / 0
residency_probe_cg4 16 / 0 16 / 0
descriptor_transpose_probe 23 / 0 23 / 0
device_atomic_probe 8 / 0 8 / 0
libdevice_math_probe 15 / 0 15 / 0

(registers / stack frame bytes; zero spill everywhere)

gemm.ptx's sha256 does differ across the two trees, and it is worth saying
why rather than waving at it
— #127 quoted digests, and a digest is not
actually the right instrument here. Dumping both modules (PTX=1 ./run.sh gemm)
and comparing them per entry:

  • Opcode census: identical at all twelve entries, instruction count included
    (gemm_tcgen05_bf16_optimized 1622 → 1622, f32_optimized 1062 → 1062,
    f32_accumulate 609 → 609, and so down).
  • brx: 0 on both sides. .branchtargets: 0. .local: 0. The jump tables
    are gone, which is the point of the PR, and nothing took their place.
  • Normalising LLVM's virtual-register and basic-block numbering and the crate's
    -C metadata disambiguator, all nine gemm.ptx entries are
    line-for-line identical
    and so are transpose_probe.ptx's three.

So the entire byte difference is two things, neither of them code: the gemm
crate's disambiguator (CslX9098XTmGh_ → Cs1wjYWhUtbSC_, which any change to
the dependency graph moves, and it rides inside every mangled
__dynamic_smem__ symbol), and the entry emission order, which permutes
between containers and renumbers every virtual register downstream of it. That
second one is oxide-train#122's known codegen nondeterminism, and it is exactly
why rebuild_stability builds every round at the same path — the harness
controls for it within a run and cannot across two. A per-function digest is
therefore not a cross-container instrument in this repo; the opcode census and
the normalised instruction stream are, and both say nothing moved.

The second, independent reading agrees. compare_profile model main builds both
arms in one container and prints bin/profile's whole table for each: 37
gpu/ops kernels with their registers, spill, maxntid, blocks/SM and
threads/SM, plus the three tcgen05 GEMMs. Diffs to nothing — all 42 lines
identical, gemm_tcgen05_bf16_optimized 202 / f32_optimized 174 /
f32_accumulate 194, 4224 spill bytes, 1 CTA/SM on both sides.

(The crate-composition gap #127 documented is main's too and unchanged here: the
same three GEMMs are 160 / 172 / 146 with zero spill inside gpu/gemm and
202 / 174 / 194 with 4224 B inside gpu/model.)

The harness prints that table four times across the run — both arms' build-time
run and both arms' warmed run — and all four are identical, so this is not a
single lucky reading.

Its timed halves, same container, back to back: 723.1253 ms full step on
main (721.3919 in kernels, 99.76%) against 713.4329 ms here, and the
warmed === baseline main === pass at 716.6606 ms (714.9037, 99.75%). All
three sit within 1.3% of each other, which is drift and not a claim — with every
static counter above identical there is no mechanism for a real one, and #127
measured the same 99.76% kernel fraction at a baseline of 736.5460 ms in a
different container.

Unlocked, not taken here

  • ferro #201 — ldst::{store_row_vec, load_row_vec} and SharedVec::slice,
    the library route for flash's hand-rolled shared arrays. Flagged in The accumulator carries the MMA shape and the column count, and the pin stops where the drains' access ladder becomes a jump table #127 as
    the first thing to pick up; still is, and still a separate PR.
  • ferro #208 re-measure — Exp2Hw against software exp2_approx on this
    repo's flash forward, given ferro's −3.9% on its own.
  • ferro #222's occupancy pole — new prose in global.rs/ldst.rs says a
    tile walk over load_rows loses 2.1× to a block-per-row loop on a row-wise
    norm. gpu/ops' norms are the place that claim would be checked against.

Unrelated, pre-existing

gpu/flash-attn/src/main.rs:763 still calls naive_module.split_group2, which
gpu/ops renamed to split_group3. That bin does not compile on main either,
no gate builds it, and this PR does not touch it.

Bumps `ferro-kittens` from `3ae07a8` (#218) to `b589b8a` (#227) across all
four manifests. Zero source churn: this repo never called `access_width`
directly, only the two drains, and #227 left their signatures alone.

This bump is also the experiment ferro #227 could not run. #219's exhaustive
`match AccessWidth` put four `brx.idx` jump tables in
`gemm_tcgen05_bf16_optimized` and the driver's PTX JIT refused the module at
`cuModuleLoadData` with `DriverError(218)` (oxide #127, ferro #225). ferro
could not reproduce the refusal -- the same tables load fine there -- and
restored the compare-chain lowering anyway. Whether `cargo oxide run gemm`
loads at this pin is the only test that exists.
@feitreim
feitreim merged commit a74128a into main Aug 7, 2026
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