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
#219's AccessWidth enum lowers the store ladder to brx jump tables the driver JIT refuses (DriverError 218) #225
Found by oxide-train's rev-bump agent (oxide-train PR #127). Bumping oxide-train's pin toward ferro main died at the first cuModuleLoadData with DriverError(218) — before any gate output — while offline ptxas --gpu-name=sm_100a -O3 accepts the same PTX with register counts identical to the previous pin.
Bisected: green at 3ae07a8 (#218), red at 41f9e57 (main). A whole-module opcode diff of the consumer's gemm.ptx isolates it to one instruction class: brx is the only opcode present after the bump and absent before — four brx.idx/.branchtargets jump tables in the bf16 tcgen05 GEMM.
Cause: #219 (f4354d0) changed access_width to return a #[repr(usize)]AccessWidth enum. The now-exhaustive four-discriminant matches in store_shared_rows/accumulate_shared_rows lower through LLVM as jump tables where the old compare chain lowered as branches — and the driver's PTX JIT (580.95.05, B200) refuses the module. A typing change that was not supposed to move codegen moved it into a construct the runtime compiler rejects, invisibly to ferro's own CI (whatever ferro's device jobs load evidently doesn't exercise this path the same way — worth confirming why ferro CI stayed green).
Downstream state: oxide-train pinned at 3ae07a8 (#218) — nothing between #218 and main is load-bearing for it (#223 is examples/experiments, #224 is docs), so it loses nothing today, but the pin can't advance past #219 until this is fixed.
Suggested fix directions (pick by measurement):
Restore a compare-chain lowering: e.g. rewrite the exhaustive match as an if/else ladder, mark the match arms in a way LLVM won't table-ize (#[cold] on rare arms, or a small match_likely shape), or revert the enum to the raw usize with named consts.
Verify with the consumer's failure mode: the reproducer is loading the module through the driver JIT (cuModuleLoadData of the PTX text), not offline ptxas — an offline-ptxas-only check will pass and prove nothing.
Consider a CI guard: a device job that JIT-loads every shipped module's PTX (not offline-compiled) so runtime-compiler refusals surface in ferro rather than downstream.
Also worth noting from the same bump: #203's stricter typing caught a real latent bug downstream (an M128 issued over a 64-row Panel — accumulator rows 64..127 read trailing shared memory; harmless-but-invisible until the types refused it). The typing direction is paying for itself; this issue is just the codegen edge it tripped.
Confirmed downstream: #227 fixes it. The module loads.
oxide-train's pin is bumped 3ae07a8 (#218) → b589b8a (#227) and cargo oxide run gemm — the exact run that died at the first cuModuleLoadData with DriverError(218), before a line of gate output — loads and passes:
Same B200 tier, same image, same consumer tree that was red at 41f9e57.
The register counts are 3ae07a8's to the digit, so the compare-chain
lowering restored the green build's codegen exactly — not merely something
the driver tolerates.
What this settles, and what it does not.#227's reproduction attempt
failed and its writeup was right to be careful: brx is necessary here and
not sufficient in general — ferro's own 55 tabled kernels, shared_drain_quad's
four tables in one entry included, JIT-load fine on 580.95.05. So the honest
reading is that the trigger is some interaction between the jump tables and
the rest of gemm_tcgen05_bf16_optimized's module that ferro has no kernel
large enough to hit, not the construct alone. What is now established is the
consumer-side half of the bisect in both directions: red exactly when the
tables are there, green exactly when they are not, across two independent
changes to how the dispatch lowers. Nothing about the consumer's module moved
between them.
Closing the loop on the follow-up #227 named: the bump is oxide-train#130, and
the remaining gates (flash-attn, ops, model) plus the register/occupancy A/B
are in that PR.
Correction: the tables were#219's. The bisect was right all along.
This issue currently records "brx is necessary but not sufficient; ferro's own
55 tabled kernels, shared_drain_quad's four tables in one entry included,
JIT-load fine on 580.95.05." Half of that is a stale-build artifact. Re-measured
on three refs, each through #228's _freshen and each with all four crates seen
to recompile in the container log (#229):
#219 introduced every jump table in ferro and #227 removed every one of them.
The consumer's bisect to #219 was correct in ferro's own PTX too, in both
directions, and #227's claim that 3ae07a8 "already carried 51 of the same set"
is superseded: AccessWidth does not exist at 3ae07a8. #219 is the commit that
made the ladder a type; before it both drains dispatched on access_width_bytes
— three cases, which LLVM branches, which is exactly the lowering #227 restored.
Zero is the only count that tree can produce. The 51 came from a regcount run
inside the window where the cargo-cache volume was serving builds it had not
compiled — the bug #228 found and fixed. So did #227's "identical counts across
the fix": the real delta is 55 → 0.
The fix in #227 is unaffected and was right for the reason it gave. What was
wrong is the measurement it took of itself.
What that does to "necessary but not sufficient" — it splits.
"shared_drain_quad proves four tables in one entry load"is withdrawn.
That probe was added on the fix branch, after the fix had put both drains back
on a three-case dispatch. It has never carried a jump table — it is inside
main's 0 of 319 — so it is the consumer's shape minus the construct the
consumer failed on. Its doc has been corrected.
So the honest statement is narrower than what is written above: ferro has run
tabled kernels on this driver and they loaded, so brx alone is still not a
sufficient condition — but nothing in this repo has ever exercised four tables
in one entry, which is the consumer's actual shape and the thing the failing
module had. If anyone wants that question answered, it takes a probe that is
deliberately built with a four-case dispatch; shared_drain_quad is not it.
Guarding it.#229 arms the census into a gate: regcount now fails when any
kernel in the shipped set carries a brx. Watched in both directions — green at
main's 0 of 319, red against bda3329's sources naming the nine shipped kernels
that carried one. The #219 regression would not reach a consumer again.
cc oxide-train: the pin at b589b8a is correct and unchanged by any of this;
what changes is the story, and any note that cites "ferro loads 55 tabled
kernels fine, including four in one entry" should drop the second clause.
Activity
The drains dispatch on the ladder's byte count again, and the jump ta…
feitreim commentedon Aug 7, 2026
Confirmed downstream: #227 fixes it. The module loads.
oxide-train's pin is bumped
3ae07a8(#218) →b589b8a(#227) andcargo oxide run gemm— the exact run that died at the firstcuModuleLoadDatawithDriverError(218), before a line of gate output —loads and passes:
Same B200 tier, same image, same consumer tree that was red at
41f9e57.The register counts are
3ae07a8's to the digit, so the compare-chainlowering restored the green build's codegen exactly — not merely something
the driver tolerates.
What this settles, and what it does not. #227's reproduction attempt
failed and its writeup was right to be careful:
brxis necessary here andnot sufficient in general — ferro's own 55 tabled kernels,
shared_drain_quad'sfour tables in one entry included, JIT-load fine on 580.95.05. So the honest
reading is that the trigger is some interaction between the jump tables and
the rest of
gemm_tcgen05_bf16_optimized's module that ferro has no kernellarge enough to hit, not the construct alone. What is now established is the
consumer-side half of the bisect in both directions: red exactly when the
tables are there, green exactly when they are not, across two independent
changes to how the dispatch lowers. Nothing about the consumer's module moved
between them.
Closing the loop on the follow-up #227 named: the bump is oxide-train#130, and
the remaining gates (flash-attn, ops, model) plus the register/occupancy A/B
are in that PR.
feitreim commentedon Aug 7, 2026
Correction: the tables were #219's. The bisect was right all along.
This issue currently records "
brxis necessary but not sufficient; ferro's own55 tabled kernels,
shared_drain_quad's four tables in one entry included,JIT-load fine on 580.95.05." Half of that is a stale-build artifact. Re-measured
on three refs, each through #228's
_freshenand each with all four crates seento recompile in the container log (#229):
brx3ae07a8bda332909beda9#219 introduced every jump table in ferro and #227 removed every one of them.
The consumer's bisect to #219 was correct in ferro's own PTX too, in both
directions, and #227's claim that
3ae07a8"already carried 51 of the same set"is superseded:
AccessWidthdoes not exist at3ae07a8. #219 is the commit thatmade the ladder a type; before it both drains dispatched on
access_width_bytes— three cases, which LLVM branches, which is exactly the lowering #227 restored.
Zero is the only count that tree can produce. The 51 came from a
regcountruninside the window where the cargo-cache volume was serving builds it had not
compiled — the bug #228 found and fixed. So did #227's "identical counts across
the fix": the real delta is 55 → 0.
The fix in #227 is unaffected and was right for the reason it gave. What was
wrong is the measurement it took of itself.
What that does to "necessary but not sufficient" — it splits.
point in
modal_app.pymounts the cache volume (The cargo cache belongs on the CPU tiers, and the GPU's build is irreducible #226 measured that the cacheloses on a GPU container), so device runs have always built from source, stale
window or not. The drains dispatch on the ladder's byte count again, and the jump tables were never this tree's (#225) #227's B200 runs at then-main really were runs of the 55-table
tree, and those modules really did load on 580.95.05.
shared_drain_quadproves four tables in one entry load" is withdrawn.That probe was added on the fix branch, after the fix had put both drains back
on a three-case dispatch. It has never carried a jump table — it is inside
main's 0 of 319 — so it is the consumer's shape minus the construct the
consumer failed on. Its doc has been corrected.
So the honest statement is narrower than what is written above: ferro has run
tabled kernels on this driver and they loaded, so
brxalone is still not asufficient condition — but nothing in this repo has ever exercised four tables
in one entry, which is the consumer's actual shape and the thing the failing
module had. If anyone wants that question answered, it takes a probe that is
deliberately built with a four-case dispatch;
shared_drain_quadis not it.Guarding it. #229 arms the census into a gate:
regcountnow fails when anykernel in the shipped set carries a
brx. Watched in both directions — green atmain's 0 of 319, red against
bda3329's sources naming the nine shipped kernelsthat carried one. The #219 regression would not reach a consumer again.
cc oxide-train: the pin at
b589b8ais correct and unchanged by any of this;what changes is the story, and any note that cites "ferro loads 55 tabled
kernels fine, including four in one entry" should drop the second clause.
The jump tables were #219's after all, and the census that missed it …