Repository navigation
Description
Motivation
The FA4-shaped flash-attention plan identified missing device intrinsics (most notably a register→TMEM tcgen05.st) as the biggest cuda-oxide v0.2.1 gap: without it, conditional softmax rescaling has to work around TMEM immutability via segment restarts + register merges. Staying pinned to a June tag also makes any future upstream contribution (e.g. adding tcgen05.st ourselves) a bigger jump than it needs to be.
Caveat up front: as of upstream main (2409204, 2026-07-18) tcgen05.st is still not exposed, so this bump alone does not close that gap. It does pick up the new generated-intrinsics infrastructure (#406, "Generate CUDA intrinsics from pinned LLVM metadata"), which should make adding it — locally or upstream — substantially cheaper.
What the bump picks up (v0.2.1 4514af2 2026-06-10 → 2409204 2026-07-18)
6a9a637Generate CUDA intrinsics from pinned LLVM metadata (#406) +2409204CI probes — the intrinsic-growth path we care about7efa409rustc-independent dialect-mir → PTX backend (#314) — may change the build flowcargo oxideuses29396b7typed kernel launch contracts (#318) — possible API churn in#[kernel]/generated launchers2b71354honor--no-fmadthroughout device codegen (#326) — can change FMA contraction, i.e. numericsc51e31b/b5d35e0newmma.synctf32/s8 intrinsics932183acargo-oxide debug executable discovery fix,aa0f77bgemm-sol cuBLASLt runtime pin
Toolchain: upstream main still pins nightly-2026-04-03, so no rust-toolchain/Modal-image nightly bump is required at this HEAD. Per SPEC §2 the pin and CUDA_OXIDE_REF must move together — re-verify at whatever rev we actually land on.
Work items
- Pick the target rev (suggest upstream HEAD at time of work; record the SHA here)
- Switch
tag = "v0.2.1"→rev = "<sha>"in the seven crate manifests:gpu/bench-util,gpu/flash-attn,gpu/gemm,gpu/model,gpu/ops,gpu/tensor-gpu,gpu/vecadd; regenerate each standaloneCargo.lock -
modal_app.py: updateCUDA_OXIDE_REF, change the generated workspace deps and thecargo install --git … --tag …line to use the rev; rebuild the Modal image - Absorb API churn from #318 (launch contracts) and any build-flow changes from #314
- Re-run the full gate ladder on B200: per-crate correctness mains (
./run.sh <kernel>), gemm/flash parity vs oracles, model parity + tiny-overfit gate (the #326 fmad fix can shift rounding — the 7e7 knife-edge lesson applies) - Same-container before/after profile per SPEC §10.1 (
BASELINE_REF=<pre-bump> ./run.sh model profile) to catch codegen perf regressions - Update SPEC §2 (pinned ref) and the decision log
Acceptance
- All
gpu/crates build and pass correctness on B200 at the new rev - Model parity/overfit gates green
- Full-step profile within noise of the pre-bump baseline (or regressions understood and accepted)
Follow-up (separate issue when we get there)
Feature-request or PR tcgen05.st (register→TMEM store) upstream via the #406 generated-intrinsics path, so FA4-style in-TMEM output rescaling stops needing the segment-restart workaround.
Activity
feitreim commentedon Jul 19, 2026
Plan note from the FA4 flash-attention discussion (parking it here so it isn't lost):
The FA4-shaped forward originally budgeted a spike to validate TMA strided per-head maps + SWIZZLE_128B directly over the interleaved fp32
[N, H·HD]activation layout (128×64 box, global width 1536, x-offsethead·64). Decision: skip the spike and go straight to bf16 de-interleaved staging — the fp32→bf16 quantize pass for Q/K/V has to exist anyway (tcgen05 wants bf16 operands, softmax scale·log₂e folds into Q in the same pass), so it will write[B·H, T, HD]contiguous per head and the kernel uses plain contiguous TMA maps, same as gemm's.The strided-map approach stays on record as a later optimization (drops the de-interleave from the staging copy, and would matter more if the quantize pass is ever fused into the QKV projection epilogue, whose natural output layout is interleaved). If anyone picks it up: the on-paper alignment checks pass (3072 B row stride, 128 B head offsets, box inner extent = swizzle span), but the strided-source + swizzled-box + tcgen05 SMEM-descriptor combination has never been exercised in this repo — validate on a tiny MMA-against-known-matrix harness first.
feitreim commentedon Jul 25, 2026
Superseded by #56 — written against upstream
2409204(2026-07-18), whentcgen05.stwas still missing. It has since landed on main, so the caveat and follow-up here are stale; #56 carries the updated work items and target rev.