Skip to content

Tracking: SM89 (Ada Lovelace) device intrinsics — FP8 types, conversions, and MMA #337

Open

Description

@honeyspoon

What problem does this solve?

Ada Lovelace (SM89) introduced FP8 data types (E4M3 and E5M2) and FP8 tensor core operations. This tracks adding FP8 conversions, FP8 MMA, and FP8 sparse MMA for SM89+.

Split from #335 for per-architecture tracking. See also: SM80 (#274), SM90 (#338), SM100 (#339).

Status (2026-07-27)

PR #406 (pinned-LLVM intrinsics autogen) landed most of this issue:

  • Phase 2 (FP8 MMA): complete. All eight checklist shapes are generated in crates/cuda-device/src/generated/register_mma.rs as the mma_m16n8k16_fp8_* and mma_m16n8k32_fp8_* families, each in both f32- and f16-accumulator forms (16 functions), lowering to e.g. mma.sync.aligned.m16n8k16.row.col.f32.e4m3.e4m3.f32. Blackwell-class kind::f8f6f4 m16n8k32 variants (FP8 mixed with FP6/FP4 inputs) were generated alongside.
  • Phase 1 (conversions): partial (4 of 10). The four f32-source packs (cvt_rn_satfinite[_relu]_{e4m3x2,e5m2x2}_f32) are generated in crates/cuda-device/src/generated/convert.rs. The f16x2-source packs, the unpacks back to f16x2, and the scalar cvt.f32.e4m3 / cvt.f32.e5m2 are still missing.
  • Phase 3 (sparse MMA): not covered for sm_89. What exists is the sp::ordered_metadata + kind::f8f6f4 form (32 functions in crates/cuda-device/src/generated/sparse_mma.rs, f16 and f32 accumulators), which targets newer architectures. The plain sm_89 mma.sp.sync.aligned.m16n8k64 FP8 forms tracked below are still unimplemented, so those boxes stay unchecked.

Remaining items go through the #406 workflow: append to intrinsics/overlay/*.toml + intrinsics/abi-v1.toml and regenerate.

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+, PTX ISA 8.1+)

FP8 (E4M3 and E5M2) data types were introduced on Ada Lovelace. 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.

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)

Note: the sp::ordered_metadata + kind::f8f6f4 forms of these shapes are already generated (see Status above); the plain sm_89 forms are what remains.


References

Activity

  1. honeyspoon commented on Jul 18, 2026

    @honeyspoon
    ContributorAuthor

    Update: Upstream PR #406 merged, autogenerating all CUDA intrinsic APIs from pinned LLVM 22 data (781 admitted contracts). Many intrinsics tracked here are now covered by the generator. To add any remaining ones, append to intrinsics/overlay/*.toml + intrinsics/abi-v1.toml and regenerate — see #406 for the full workflow.

  2. honeyspoon commented on Jul 24, 2026

    @honeyspoon
    ContributorAuthor

    The autogen system (#406, intrinsics/overlay/register_mma_fp8.toml) already covers the FP8 MMA intrinsics listed here. Generated output in crates/cuda-device/src/generated/register_mma.rs:

    Phase 2 (FP8 MMA): All 8 m16n8k16 variants with f32 and f16 accumulators are generated:

    • mma_m16n8k16_fp8_f32_e4m3_e4m3, mma_m16n8k16_fp8_f32_e4m3_e5m2, etc.
    • mma_m16n8k16_fp8_f16_e4m3_e4m3, mma_m16n8k16_fp8_f16_e4m3_e5m2, etc.
    • Plus m16n8k32 variants (with kind::f8f6f4 PTX syntax)

    Phase 1 (FP8 conversions): 4 generated functions in crates/cuda-device/src/generated/convert.rs (e4m3/e5m2 packed conversions).

    Phase 3 (FP8 sparse MMA): 32 generated functions in crates/cuda-device/src/generated/sparse_mma.rs.

    66 FP8 register MMA + 4 FP8 conversion + 32 FP8 sparse MMA = 102 FP8 functions total.

    The tracking checklist items can likely be checked off as covered by autogen, similar to how #274 was updated.

  3. added
    tracking
    enhancement
    intrinsics
    cuda-feature
    on Jul 27, 2026
  4. midiareshadi commented on Aug 28, 2026

    @midiareshadi

    I've been exercising the sm_89 FP8 path on an L4 (Ada) and wanted to share some on-hardware verification, since the intrinsics here shipped via the #406 autogen and I had Ada silicon to test them on.

    Phase 2 (FP8 MMA), verified numerically correct on sm_89. I ran the mma_m16n8k16_fp8_* family against CPU references on the L4, with distinct small-integer operands (exactly representable in e4m3/e5m2, so f32 accumulation is exact and the comparison is bitwise):

    • f32 accumulator: e4m3×e4m3, e5m2×e5m2, e4m3×e5m2, e5m2×e4m3, all 128/128 elements correct
    • f16 accumulator: e4m3×e4m3, e5m2×e5m2, all correct
    • PTX confirms the expected mma.sync.aligned.m16n8k16.row.col.f32.e4m3.e4m3.f32 (etc.) is emitted

    I also exercised the e4m3 conversion round-trip (cvt_rn_f16x2_e4m3x2 and the relu variant), which round-trips correctly on the L4.

    Offer: I have clean, self-contained examples that demonstrate the above on sm_89: an FP8 conversion round-trip check and the MMA numeric check, both with host-side CPU references and a SUCCESS marker. I don't see FP8 examples for sm_89 yet (only the Blackwell mma_mxf8f6f4), and CONTRIBUTING notes new intrinsics should ship with a demonstrating example. Would a PR adding these under examples/ be welcome? Happy to follow the DCO/format requirements.

  5. added this to the cuda oxide v0.5.0 milestone on Oct 25, 2026
  6. added
    cuda-oxide
    on Oct 29, 2026
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

    cuda-featurecuda-oxideenhancementintrinsicstracking

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions