Skip to content

Bump cuda-oxide pin to upstream main @ b099f64 (tcgen05.st landed) #56

Closed

Description

@feitreim

Motivation

Supersedes #34, whose central caveat is now stale: as of upstream main (b099f64, 2026-07-25) tcgen05.st is exposed (full tcgen05_st_* family in cuda-device/src/generated/tcgen05.rs — 16x128b, x1–x16, raw/unpack16). That was the v0.2.1 gap forcing the flash kernels' segment-restart correction workaround and blocking a separate correction warpgroup.

The bump is also step 0 for the planned tile-library ("kittens") work: the generated-intrinsics catalog on main provides essentially the entire primitive layer. We target tcgen05/sm_100a only — no wmma/wgmma tile backends.

What the bump picks up (v0.2.1 4514af2 2026-06-10 → b099f64 2026-07-25)

Beyond everything already listed in #34 (generated-intrinsics infra #406, rustc-independent PTX backend #314, launch contracts #318, --no-fmad #326):

  • tcgen05.st register→TMEM stores — unblocks FA4-style in-TMEM output rescaling (drops the segment-restart + register-drain workaround)
  • Hardware ex2.approx / tanh.approx (#458/#459, ex2_approx_f32 in generated/float.rs) — replaces the software exp2 in the flash softmax with one SFU instruction, still pure-PTX-safe
  • ldmatrix (#311) / movmatrix (#310) — the missing register↔shared tile movers
  • Generated intrinsics catalog reshuffle — mbarrier_basic/mbarrier_extended, generated tcgen05, stmatrix, tma, etc. Module paths moved; expect a mechanical migration pass over gpu/flash-attn/src/tcgen05.rs (~2.9k lines) and friends
  • libdevice linked at IR level on the PTX path (#410) + rounding/scalar math lowered to LLVM intrinsics (#466/#458) — the "no libdevice math on the tcgen05 path" discipline may be obsolete; verify and relax the module-header contract if so
  • Cross-crate device fns link via -Zalways-encode-mir (#454) — prerequisite for shipping the tile library as a real separate crate
  • Const-generic kernel entries (#316) / bounded kernel family selection (#317) — candidate replacement for the SWEEP const-rewriting harness (separate issue if pursued)
  • ptx_asm! multi-output (#411/#443), cargo oxide sanitize (#325), packed f16x2/bf16x2 atomics (#322), fp8 mma.sync shapes, many MIR-lowering fixes (closures-in-closures, iter().map().sum(), split_at_mut_checked, arr[i].field assigns)

Toolchain: upstream main at b099f64 still pins nightly-2026-04-03 — no rust-toolchain or Modal-image nightly bump. Per SPEC §2 the pin and CUDA_OXIDE_REF must move together; re-verify at the rev actually landed.

Work items

  • Pin target rev b099f64c1a32869b74be99f4f88242fb68655b51 (or upstream HEAD at time of work; record final 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 standalone Cargo.lock
  • modal_app.py: update CUDA_OXIDE_REF, switch generated workspace deps and the cargo install --git … --tag … line to the rev; rebuild the Modal image
  • Migrate imports to the generated-intrinsics module paths (mbarrier, tcgen05, stmatrix, tma)
  • Absorb API churn from #318 (launch contracts) and build-flow changes from #314
  • Verify whether libdevice math is now legal on the tcgen05/pure-PTX path; update the tcgen05.rs module-header contract accordingly
  • 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)
  • 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-ups unlocked (separate issues)

  • Swap software exp2 → ex2_approx_f32 in the flash softmax; measure
  • FA4-style conditional rescaling in TMEM via tcgen05.st (removes the segment-restart machinery; enables a dedicated correction warpgroup)
  • Tile library (gpu/kittens) on the generated catalog — tcgen05-only backend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions