Skip to content

Bump cuda-oxide pin from v0.2.1 to current upstream main #34

Closed as not planned

Description

@feitreim

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)

  • 6a9a637 Generate CUDA intrinsics from pinned LLVM metadata (#406) + 2409204 CI probes — the intrinsic-growth path we care about
  • 7efa409 rustc-independent dialect-mir → PTX backend (#314) — may change the build flow cargo oxide uses
  • 29396b7 typed kernel launch contracts (#318) — possible API churn in #[kernel]/generated launchers
  • 2b71354 honor --no-fmad throughout device codegen (#326) — can change FMA contraction, i.e. numerics
  • c51e31b/b5d35e0 new mma.sync tf32/s8 intrinsics
  • 932183a cargo-oxide debug executable discovery fix, aa0f77b gemm-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 standalone Cargo.lock
  • modal_app.py: update CUDA_OXIDE_REF, change the generated workspace deps and the cargo 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

  1. added
    enhancement
    on Jul 19, 2026
  2. feitreim commented on Jul 19, 2026

    @feitreim
    OwnerAuthor

    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-offset head·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.

  3. feitreim commented on Jul 25, 2026

    @feitreim
    OwnerAuthor

    Superseded by #56 — written against upstream 2409204 (2026-07-18), when tcgen05.st was 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.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions