Skip to content

Tracking: SM89+ device intrinsics (Ada Lovelace, Hopper, Blackwell) #335

Closed

Description

@honeyspoon

What problem does this solve?

cuda-oxide has substantial SM90 (Hopper) support on main — WGMMA (bf16/f16/tf32), TMA (1D–5D g2s/s2g + multicast), thread block clusters, mbarrier, and tcgen05 (Blackwell). However, the FP8 ecosystem and several SM89/SM90-specific instruction families are missing. This tracks filling those gaps.

Split out from the SM80 tracking issue (#274) to keep scope clear.

Scope

Each item follows the established 4-layer pattern (cuda-device > dialect-nvvm > mir-importer > mir-lower) plus lowering tests.


Phase 1: FP8 conversions (sm_89+)

FP8 (E4M3 and E5M2) data types were introduced on Ada Lovelace (sm_89). These conversions are the foundation for all FP8 compute.

  • cvt.rn.satfinite.e4m3x2.f32 — pack two f32 → e4m3x2 (round-to-nearest, saturate-to-finite)
  • cvt.rn.satfinite.e5m2x2.f32 — pack two f32 → e5m2x2
  • cvt.rn.satfinite.relu.e4m3x2.f32 — with fused ReLU
  • cvt.rn.satfinite.relu.e5m2x2.f32 — with fused ReLU
  • cvt.rn.satfinite.e4m3x2.f16x2 — f16x2 → e4m3x2
  • cvt.rn.satfinite.e5m2x2.f16x2 — f16x2 → e5m2x2
  • cvt.rn.f16x2.e4m3x2 — e4m3x2 → f16x2 (unpack)
  • cvt.rn.f16x2.e5m2x2 — e5m2x2 → f16x2 (unpack)
  • cvt.f32.e4m3 — scalar e4m3 → f32
  • cvt.f32.e5m2 — scalar e5m2 → f32

Note: FP8 types are packed as pairs (e4m3x2/e5m2x2) in 16-bit registers, similar to f16x2/bf16x2. Requires PTX ISA 8.1+.

Phase 2: FP8 MMA (sm_89+)

Ada Lovelace 4th-gen Tensor Cores add FP8 input types to mma.sync. These are the most important SM89-specific MMA shapes.

  • mma.sync.aligned.m16n8k16.row.col.f32.e4m3.e4m3.f32
  • mma.sync.aligned.m16n8k16.row.col.f32.e5m2.e5m2.f32
  • mma.sync.aligned.m16n8k16.row.col.f32.e4m3.e5m2.f32 (mixed FP8)
  • mma.sync.aligned.m16n8k16.row.col.f32.e5m2.e4m3.f32 (mixed FP8)
  • mma.sync.aligned.m16n8k32.row.col.f32.e4m3.e4m3.f32
  • mma.sync.aligned.m16n8k32.row.col.f32.e5m2.e5m2.f32
  • mma.sync.aligned.m16n8k32.row.col.f32.e4m3.e5m2.f32 (mixed FP8)
  • mma.sync.aligned.m16n8k32.row.col.f32.e5m2.e4m3.f32 (mixed FP8)

Note: FP8 MMA is critical for inference workloads. E4M3 retains more mantissa precision; E5M2 has wider dynamic range. Mixed-input variants (e4m3 × e5m2) are commonly used when activations and weights use different FP8 formats.

Phase 3: FP8 sparse MMA (sm_89+)

Extends structured sparsity (2:4) to FP8 inputs.

  • mma.sp.sync.aligned.m16n8k64.row.col.f32.e4m3.e4m3.f32
  • mma.sp.sync.aligned.m16n8k64.row.col.f32.e5m2.e5m2.f32
  • mma.sp.sync.aligned.m16n8k64.row.col.f32.e4m3.e5m2.f32 (mixed)
  • mma.sp.sync.aligned.m16n8k64.row.col.f32.e5m2.e4m3.f32 (mixed)

Phase 4: FP8 WGMMA variants (sm_90a)

Hopper's warpgroup-level MMA with FP8 inputs. cuda-oxide already has WGMMA for bf16/f16/tf32 but not FP8.

  • wgmma.mma_async.*.f32.e4m3.e4m3 (f32 accumulator, e4m3 inputs)
  • wgmma.mma_async.*.f32.e5m2.e5m2 (f32 accumulator, e5m2 inputs)
  • wgmma.mma_async.*.f32.e4m3.e5m2 (mixed FP8 inputs)
  • wgmma.mma_async.*.f32.e5m2.e4m3 (mixed FP8 inputs)

Note: FP8 WGMMA is the highest-throughput FP8 path on Hopper, sourcing one or both operands from shared memory via TMA.

Phase 5: Additional WGMMA shapes (sm_90a)

Remaining WGMMA matrix shapes beyond the current m64n64k16 variants.

  • wgmma.mma_async.m64n128k16.f32.f16 (wider N)
  • wgmma.mma_async.m64n128k16.f32.bf16 (wider N)
  • wgmma.mma_async.m64n256k16.f32.f16 (widest N)
  • wgmma.mma_async.m64n256k16.f32.bf16 (widest N)
  • wgmma.mma_async.m64n128k8.f32.tf32
  • wgmma.mma_async.m64n256k8.f32.tf32
  • wgmma.mma_async.m64n8k16.f32.f16 (narrow N for epilogue)
  • wgmma.mma_async.m64n16k16.f32.f16
  • wgmma.mma_async.m64n24k16.f32.f16
  • wgmma.mma_async.m64n32k16.f32.f16
  • wgmma.mma_async.m64n48k16.f32.f16

Phase 6: Hopper-specific instructions (sm_90 / sm_90a)

Instructions unique to Hopper that are not yet implemented.

  • setmaxnreg — dynamic register allocation (sm_90a)
  • barrier.cluster.arrive / barrier.cluster.wait — cluster-wide barrier (already have cluster_sync, but explicit arrive/wait may be missing)
  • fence.proxy.async — async proxy fence
  • cp.async.bulk.prefetch.tensor — TMA prefetch (global → L2, no shared memory)
  • cp.reduce.async.bulk — async reduction copy (sm_90+)
  • redux.sync.{add,min,max}.{s32,u32,f32} — additional redux variants beyond existing

Phase 7: DPX (Dynamic Programming) instructions (sm_90+)

Three-way comparison and fused add-max operations for genomics and dynamic programming workloads.

  • vimnmx.{s32,u32} — three-way min/max (max(min(a,b), c))
  • vimax3.{s32,u32} — three-way max (max(a, max(b, c)))
  • vimin3.{s32,u32} — three-way min (min(a, min(b, c)))
  • viaddmax.{s32,u32} — fused add-max (max(a+b, c))
  • viaddmin.{s32,u32} — fused add-min (min(a+b, c))

Note: DPX instructions accelerate Smith-Waterman alignment and similar DP algorithms by 7× vs discrete ops on SM80. They are Hopper-exclusive.

Phase 8: Blackwell tcgen05 FP8 variants (sm_100+)

The existing tcgen05 implementation covers bf16/f16/tf32. FP8 variants are needed for Blackwell FP8 workloads.

  • tcgen05.mma.*.f32.e4m3 — FP8 E4M3 inputs
  • tcgen05.mma.*.f32.e5m2 — FP8 E5M2 inputs
  • tcgen05.mma.*.f32.e4m3.e5m2 — mixed FP8
  • FP6/FP4 narrow types (e3m2, e2m3, e2m1) — PTX ISA 8.7+ (sm_100+)

Note: Blackwell extends the type system further with FP6 and FP4 narrow floating-point types. These require the kind::f8f6f4 suffix on the PTX instruction.


What already exists on main

Feature Status Crate locations
WGMMA (bf16/f16/tf32) ✅ cuda-device/wgmma.rs, dialect-nvvm/ops/wgmma.rs
TMA (1D–5D, g2s/s2g, multicast) ✅ cuda-device/tma.rs, dialect-nvvm/ops/tma.rs, mir-importer/tma.rs, mir-lower/tma.rs
Thread block clusters ✅ cuda-device/cluster.rs, dialect-nvvm/ops/cluster.rs, mir-importer/cluster.rs, mir-lower/cluster.rs
mbarrier (init/arrive/wait/inval) ✅ cuda-device/barrier.rs, dialect-nvvm/ops/mbarrier.rs
elect.sync ✅ Already on main
tcgen05 (bf16/f16/tf32, TMEM, fence, commit/wait) ✅ cuda-device/tcgen05.rs, dialect-nvvm/ops/tcgen05.rs, mir-importer/tcgen05.rs, mir-lower/tcgen05.rs
bf16x2 arithmetic ✅ cuda-device/bf16x2.rs, dialect-nvvm/ops/bf16x2.rs
FP8 (any) ❌ Not implemented
DPX instructions ❌ Not implemented
setmaxnreg ❌ Not implemented

Additional context

Activity

  1. honeyspoon commented on Jul 3, 2026

    @honeyspoon
    ContributorAuthor

    Split into per-architecture tracking issues for cleaner scope:

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